mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1161748 - Rehydrate ActivityOptions in a system scope. r=fabrice,gabor
This commit is contained in:
parent
53b7e8ff5d
commit
80c484de20
@ -68,10 +68,18 @@ Activity::Initialize(nsPIDOMWindow* aWindow,
|
||||
mProxy = do_CreateInstance("@mozilla.org/dom/activities/proxy;1", &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// We're about the pass the dictionary to a JS-implemented component, so
|
||||
// rehydrate it in a system scode so that security wrappers don't get in the
|
||||
// way. See bug 1161748 comment 16.
|
||||
bool ok;
|
||||
JS::Rooted<JS::Value> optionsValue(aCx);
|
||||
if (!ToJSValue(aCx, aOptions, &optionsValue)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
{
|
||||
JSAutoCompartment ac(aCx, xpc::PrivilegedJunkScope());
|
||||
ok = ToJSValue(aCx, aOptions, &optionsValue);
|
||||
NS_ENSURE_TRUE(ok, NS_ERROR_FAILURE);
|
||||
}
|
||||
ok = JS_WrapValue(aCx, &optionsValue);
|
||||
NS_ENSURE_TRUE(ok, NS_ERROR_FAILURE);
|
||||
|
||||
mProxy->StartActivity(static_cast<nsIDOMDOMRequest*>(this), optionsValue, aWindow);
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user