зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1473865 part 4 - Use xpc::WindowOrNull instead of xpc::WindowGlobalOrNull in a few places. r=bz
This commit is contained in:
Родитель
1fb564174b
Коммит
7967870e29
|
@ -9655,7 +9655,8 @@ nsContentUtils::IsSpecificAboutPage(JSObject* aGlobal, const char* aUri)
|
|||
MOZ_ASSERT(strncmp(aUri, "about:", 6) == 0);
|
||||
|
||||
// Make sure the global is a window
|
||||
nsGlobalWindowInner* win = xpc::WindowGlobalOrNull(aGlobal);
|
||||
MOZ_DIAGNOSTIC_ASSERT(JS_IsGlobalObject(aGlobal));
|
||||
nsGlobalWindowInner* win = xpc::WindowOrNull(aGlobal);
|
||||
if (!win) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -2599,9 +2599,10 @@ nsIDocument::IsSynthesized() {
|
|||
}
|
||||
|
||||
bool
|
||||
nsDocument::IsShadowDOMEnabled(JSContext* aCx, JSObject* aObject)
|
||||
nsDocument::IsShadowDOMEnabled(JSContext* aCx, JSObject* aGlobal)
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindowInner> window = xpc::WindowGlobalOrNull(aObject);
|
||||
MOZ_DIAGNOSTIC_ASSERT(JS_IsGlobalObject(aGlobal));
|
||||
nsCOMPtr<nsPIDOMWindowInner> window = xpc::WindowOrNull(aGlobal);
|
||||
|
||||
nsIDocument* doc = window ? window->GetExtantDoc() : nullptr;
|
||||
if (!doc) {
|
||||
|
|
|
@ -194,8 +194,8 @@ public:
|
|||
nsRadioGroupStruct* GetRadioGroup(const nsAString& aName) const;
|
||||
nsRadioGroupStruct* GetOrCreateRadioGroup(const nsAString& aName);
|
||||
|
||||
// Check whether shadow DOM is enabled for the global of aObject.
|
||||
static bool IsShadowDOMEnabled(JSContext* aCx, JSObject* aObject);
|
||||
// Check whether shadow DOM is enabled for aGlobal.
|
||||
static bool IsShadowDOMEnabled(JSContext* aCx, JSObject* aGlobal);
|
||||
// Check whether shadow DOM is enabled for the document this node belongs to.
|
||||
static bool IsShadowDOMEnabled(const nsINode* aNode);
|
||||
|
||||
|
|
|
@ -568,6 +568,7 @@ AutoJSAPI::ReportException()
|
|||
errorGlobal = GetCurrentThreadWorkerGlobal();
|
||||
}
|
||||
}
|
||||
MOZ_ASSERT(JS_IsGlobalObject(errorGlobal));
|
||||
JSAutoRealm ar(cx(), errorGlobal);
|
||||
JS::Rooted<JS::Value> exn(cx());
|
||||
js::ErrorReport jsReport(cx());
|
||||
|
@ -576,7 +577,7 @@ AutoJSAPI::ReportException()
|
|||
if (mIsMainThread) {
|
||||
RefPtr<xpc::ErrorReport> xpcReport = new xpc::ErrorReport();
|
||||
|
||||
RefPtr<nsGlobalWindowInner> win = xpc::WindowGlobalOrNull(errorGlobal);
|
||||
RefPtr<nsGlobalWindowInner> win = xpc::WindowOrNull(errorGlobal);
|
||||
nsPIDOMWindowInner* inner = win ? win->AsInner() : nullptr;
|
||||
bool isChrome = nsContentUtils::IsSystemPrincipal(
|
||||
nsContentUtils::ObjectPrincipal(errorGlobal));
|
||||
|
|
|
@ -233,8 +233,7 @@ ReportWrapperDenial(JSContext* cx, HandleId id, WrapperDenialType type, const ch
|
|||
|
||||
// Compute the current window id if any.
|
||||
uint64_t windowId = 0;
|
||||
nsGlobalWindowInner* win = WindowGlobalOrNull(CurrentGlobalOrNull(cx));
|
||||
if (win)
|
||||
if (nsGlobalWindowInner* win = CurrentWindowOrNull(cx))
|
||||
windowId = win->WindowID();
|
||||
|
||||
|
||||
|
|
|
@ -92,9 +92,10 @@ AddonManagerWebAPI::IsValidSite(nsIURI* uri)
|
|||
}
|
||||
|
||||
bool
|
||||
AddonManagerWebAPI::IsAPIEnabled(JSContext* cx, JSObject* obj)
|
||||
AddonManagerWebAPI::IsAPIEnabled(JSContext* aCx, JSObject* aGlobal)
|
||||
{
|
||||
nsGlobalWindowInner* global = xpc::WindowGlobalOrNull(obj);
|
||||
MOZ_DIAGNOSTIC_ASSERT(JS_IsGlobalObject(aGlobal));
|
||||
nsGlobalWindowInner* global = xpc::WindowOrNull(aGlobal);
|
||||
if (!global) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace mozilla {
|
|||
|
||||
class AddonManagerWebAPI {
|
||||
public:
|
||||
static bool IsAPIEnabled(JSContext* cx, JSObject* obj);
|
||||
static bool IsAPIEnabled(JSContext* aCx, JSObject* aGlobal);
|
||||
|
||||
static bool IsValidSite(nsIURI* uri);
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче