From c046ca0ed7db35109caea4228919cf9606213c25 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sun, 14 Aug 2011 20:05:20 +0200 Subject: [PATCH] Backout bug 675075 for bustage --- docshell/base/nsDocShell.cpp | 20 ++++++++++---------- dom/base/nsGlobalWindow.cpp | 15 ++------------- dom/base/nsGlobalWindow.h | 1 - dom/base/nsPIDOMWindow.h | 6 +++--- dom/interfaces/base/nsIDOMWindow.idl | 7 ------- dom/locales/en-US/chrome/dom/dom.properties | 2 +- xpfe/appshell/src/nsXULWindow.cpp | 4 +--- 7 files changed, 17 insertions(+), 38 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index f7e75ae8714..70931c8b8a3 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -215,14 +215,6 @@ #include "nsPluginError.h" #include "nsContentUtils.h" -#include "nsContentErrors.h" -#include "nsIChannelPolicy.h" -#include "nsIContentSecurityPolicy.h" - -#include "nsXULAppAPI.h" - -#include "nsDOMNavigationTiming.h" -#include "nsITimedChannel.h" static NS_DEFINE_CID(kDOMScriptObjectFactoryCID, NS_DOM_SCRIPT_OBJECT_FACTORY_CID); @@ -233,6 +225,15 @@ static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID); #define DEBUG_PAGE_CACHE #endif +#include "nsContentErrors.h" +#include "nsIChannelPolicy.h" +#include "nsIContentSecurityPolicy.h" + +#include "nsXULAppAPI.h" + +#include "nsDOMNavigationTiming.h" +#include "nsITimedChannel.h" + using namespace mozilla; // Number of documents currently loading @@ -921,8 +922,7 @@ NS_IMETHODIMP nsDocShell::GetInterface(const nsIID & aIID, void **aSink) *aSink = mScriptGlobal; } else if ((aIID.Equals(NS_GET_IID(nsPIDOMWindow)) || - aIID.Equals(NS_GET_IID(nsIDOMWindow)) || - aIID.Equals(NS_GET_IID(nsIDOMWindowInternal))) && + aIID.Equals(NS_GET_IID(nsIDOMWindow))) && NS_SUCCEEDED(EnsureScriptEnvironment())) { return mScriptGlobal->QueryInterface(aIID, aSink); } diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index c0e95a79d6a..2fcfb5631d7 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -262,7 +262,6 @@ using mozilla::TimeDuration; nsIDOMStorageList *nsGlobalWindow::sGlobalStorageList = nsnull; nsGlobalWindow::WindowByIdTable *nsGlobalWindow::sWindowsById = nsnull; -bool nsGlobalWindow::sWarnedAboutWindowInternal = false; static nsIEntropyCollector *gEntropyCollector = nsnull; static PRInt32 gRefCnt = 0; @@ -1349,17 +1348,6 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsGlobalWindow) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIScriptGlobalObject) NS_INTERFACE_MAP_ENTRY(nsIDOMWindow) NS_INTERFACE_MAP_ENTRY(nsIDOMJSWindow) - if (aIID.Equals(NS_GET_IID(nsIDOMWindowInternal))) { - foundInterface = static_cast(this); - if (!sWarnedAboutWindowInternal) { - sWarnedAboutWindowInternal = true; - nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES, - "nsIDOMWindowInternalWarning", - nsnull, 0, nsnull, EmptyString(), 0, 0, - nsIScriptError::warningFlag, - "Extensions", mWindowID); - } - } else NS_INTERFACE_MAP_ENTRY(nsIScriptGlobalObject) NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal) NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget) @@ -4938,7 +4926,8 @@ nsGlobalWindow::Focus() return NS_OK; } - nsIDOMWindow *caller = nsContentUtils::GetWindowFromCaller(); + nsIDOMWindow *caller = + static_cast(nsContentUtils::GetWindowFromCaller()); nsCOMPtr opener; GetOpener(getter_AddRefs(opener)); diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h index b1178938941..d9b1d72e41b 100644 --- a/dom/base/nsGlobalWindow.h +++ b/dom/base/nsGlobalWindow.h @@ -967,7 +967,6 @@ protected: static nsIDOMStorageList* sGlobalStorageList; static WindowByIdTable* sWindowsById; - static bool sWarnedAboutWindowInternal; }; /* diff --git a/dom/base/nsPIDOMWindow.h b/dom/base/nsPIDOMWindow.h index 9409f04c2d6..baee60ad607 100644 --- a/dom/base/nsPIDOMWindow.h +++ b/dom/base/nsPIDOMWindow.h @@ -80,10 +80,10 @@ class nsIArray; class nsPIWindowRoot; #define NS_PIDOMWINDOW_IID \ -{ 0xeee816d2, 0x2f08, 0x4b34, \ - { 0x97, 0x47, 0x5e, 0x5a, 0xcd, 0xc3, 0x56, 0xfa } } +{ 0x1bfacc26, 0xad77, 0x42bb, \ + { 0xb9, 0xbb, 0xa0, 0x19, 0xc8, 0x27, 0x5c, 0x0e } } -class nsPIDOMWindow : public nsIDOMWindowInternal +class nsPIDOMWindow : public nsIDOMWindow { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_PIDOMWINDOW_IID) diff --git a/dom/interfaces/base/nsIDOMWindow.idl b/dom/interfaces/base/nsIDOMWindow.idl index a2eaccecc43..bedbcf573c1 100644 --- a/dom/interfaces/base/nsIDOMWindow.idl +++ b/dom/interfaces/base/nsIDOMWindow.idl @@ -444,10 +444,3 @@ interface nsIDOMWindowPerformance : nsISupports */ readonly attribute nsIDOMPerformance performance; }; - -/** - * Empty interface for compatibility with older versions. - * @deprecated Use nsIDOMWindow instead - */ -[scriptable, uuid(8614bdb7-5b07-4d00-a7ba-4d44697a343d)] -interface nsIDOMWindowInternal : nsIDOMWindow {}; diff --git a/dom/locales/en-US/chrome/dom/dom.properties b/dom/locales/en-US/chrome/dom/dom.properties index 550c9326f12..3a63cd3f8ad 100644 --- a/dom/locales/en-US/chrome/dom/dom.properties +++ b/dom/locales/en-US/chrome/dom/dom.properties @@ -108,6 +108,6 @@ IsSupportedWarning=Use of attributes' isSupported() is deprecated. IsEqualNodeWarning=Use of attributes' isEqualNode() is deprecated. TextContentWarning=Use of attributes' textContent attribute is deprecated. Use value instead. EnablePrivilegeWarning=Use of enablePrivilege is deprecated. Please use code that runs with the system principal (e.g. an extension) instead. + nsIJSONDecodeDeprecatedWarning=nsIJSON.decode is deprecated. Please use JSON.parse instead. nsIJSONEncodeDeprecatedWarning=nsIJSON.encode is deprecated. Please use JSON.stringify instead. -nsIDOMWindowInternalWarning=Use of nsIDOMWindowInternal is deprecated. Use nsIDOMWindow instead. diff --git a/xpfe/appshell/src/nsXULWindow.cpp b/xpfe/appshell/src/nsXULWindow.cpp index 65a5589b266..e3decd09efe 100644 --- a/xpfe/appshell/src/nsXULWindow.cpp +++ b/xpfe/appshell/src/nsXULWindow.cpp @@ -89,6 +89,7 @@ #include "nsWebShellWindow.h" // get rid of this one, too... #include "prenv.h" + #include "mozilla/Preferences.h" using namespace mozilla; @@ -201,9 +202,6 @@ NS_IMETHODIMP nsXULWindow::GetInterface(const nsIID& aIID, void** aSink) if (aIID.Equals(NS_GET_IID(nsIDOMWindow))) { return GetWindowDOMWindow(reinterpret_cast(aSink)); } - if (aIID.Equals(NS_GET_IID(nsIDOMWindowInternal))) { - return GetWindowDOMWindow(reinterpret_cast(aSink)); - } if (aIID.Equals(NS_GET_IID(nsIWebBrowserChrome)) && NS_SUCCEEDED(EnsureContentTreeOwner()) && NS_SUCCEEDED(mContentTreeOwner->QueryInterface(aIID, aSink)))