Bug 675075 - Reinstate nsIDOMWindowInternal; r=smaug

* * *
Bug 675075 - Followup: remove nsIDOMWindowInternal.h includes; r=bustage
This commit is contained in:
Ms2ger 2011-08-14 19:22:29 +02:00
Родитель 352b5b2d9d
Коммит fe7e298f75
7 изменённых файлов: 44 добавлений и 18 удалений

Просмотреть файл

@ -215,6 +215,14 @@
#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);
@ -225,15 +233,6 @@ 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
@ -922,7 +921,8 @@ 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(nsIDOMWindow)) ||
aIID.Equals(NS_GET_IID(nsIDOMWindowInternal))) &&
NS_SUCCEEDED(EnsureScriptEnvironment())) {
return mScriptGlobal->QueryInterface(aIID, aSink);
}

Просмотреть файл

@ -262,6 +262,7 @@ using mozilla::TimeDuration;
nsIDOMStorageList *nsGlobalWindow::sGlobalStorageList = nsnull;
nsGlobalWindow::WindowByIdTable *nsGlobalWindow::sWindowsById = nsnull;
bool nsGlobalWindow::sWarnedAboutWindowInternal = false;
static nsIEntropyCollector *gEntropyCollector = nsnull;
static PRInt32 gRefCnt = 0;
@ -1348,6 +1349,17 @@ 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<nsIDOMWindowInternal*>(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)
@ -4926,8 +4938,7 @@ nsGlobalWindow::Focus()
return NS_OK;
}
nsIDOMWindow *caller =
static_cast<nsIDOMWindow*>(nsContentUtils::GetWindowFromCaller());
nsIDOMWindow *caller = nsContentUtils::GetWindowFromCaller();
nsCOMPtr<nsIDOMWindow> opener;
GetOpener(getter_AddRefs(opener));

Просмотреть файл

@ -967,6 +967,7 @@ protected:
static nsIDOMStorageList* sGlobalStorageList;
static WindowByIdTable* sWindowsById;
static bool sWarnedAboutWindowInternal;
};
/*

Просмотреть файл

@ -80,10 +80,10 @@ class nsIArray;
class nsPIWindowRoot;
#define NS_PIDOMWINDOW_IID \
{ 0x1bfacc26, 0xad77, 0x42bb, \
{ 0xb9, 0xbb, 0xa0, 0x19, 0xc8, 0x27, 0x5c, 0x0e } }
{ 0xeee816d2, 0x2f08, 0x4b34, \
{ 0x97, 0x47, 0x5e, 0x5a, 0xcd, 0xc3, 0x56, 0xfa } }
class nsPIDOMWindow : public nsIDOMWindow
class nsPIDOMWindow : public nsIDOMWindowInternal
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_PIDOMWINDOW_IID)

Просмотреть файл

@ -444,3 +444,10 @@ 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 {};

Просмотреть файл

@ -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.

Просмотреть файл

@ -89,7 +89,6 @@
#include "nsWebShellWindow.h" // get rid of this one, too...
#include "prenv.h"
#include "mozilla/Preferences.h"
using namespace mozilla;
@ -201,7 +200,15 @@ NS_IMETHODIMP nsXULWindow::GetInterface(const nsIID& aIID, void** aSink)
}
if (aIID.Equals(NS_GET_IID(nsIDOMWindow))) {
return GetWindowDOMWindow(reinterpret_cast<nsIDOMWindow**>(aSink));
}
}
if (aIID.Equals(NS_GET_IID(nsIDOMWindowInternal))) {
nsIDOMWindow* domWindow = nsnull;
rv = GetWindowDOMWindow(&domWindow);
nsIDOMWindowInternal* domWindowInternal =
static_cast<nsIDOMWindowInternal*>(domWindow);
*aSink = domWindowInternal;
return rv;
}
if (aIID.Equals(NS_GET_IID(nsIWebBrowserChrome)) &&
NS_SUCCEEDED(EnsureContentTreeOwner()) &&
NS_SUCCEEDED(mContentTreeOwner->QueryInterface(aIID, aSink)))