mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 1489301 - Part 2: Fix broken [Func] condition assuming Window object, r=bzbarsky
This condition unwraps the global to a window, and doesn't check before dereferencing. This is no longer valid now that the corresponding interfaces are exposed on BackstagePass. Differential Revision: https://phabricator.services.mozilla.com/D9402
This commit is contained in:
parent
91ec325721
commit
91cec0e775
@ -3095,7 +3095,8 @@ nsGlobalWindowInner::GetOwnPropertyNames(JSContext* aCx, JS::AutoIdVector& aName
|
||||
nsGlobalWindowInner::IsPrivilegedChromeWindow(JSContext* aCx, JSObject* aObj)
|
||||
{
|
||||
// For now, have to deal with XPConnect objects here.
|
||||
return xpc::WindowOrNull(aObj)->IsChromeWindow() &&
|
||||
nsGlobalWindowInner* win = xpc::WindowOrNull(aObj);
|
||||
return win && win->IsChromeWindow() &&
|
||||
nsContentUtils::ObjectPrincipal(aObj) == nsContentUtils::GetSystemPrincipal();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user