mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 22:37:50 +00:00
Bug 1480678 part 6 - Use CheckedUnwrap in nsContentPermissionRequestProxy::Allow. r=mrbkap
This commit is contained in:
parent
e4ef338836
commit
88a1a3951c
@ -708,12 +708,17 @@ nsContentPermissionRequestProxy::Allow(JS::HandleValue aChoices)
|
||||
for (uint32_t i = 0; i < mPermissionRequests.Length(); ++i) {
|
||||
nsCString type = mPermissionRequests[i].type();
|
||||
|
||||
JS::Rooted<JSObject*> obj(RootingCx(), &aChoices.toObject());
|
||||
obj = CheckedUnwrap(obj);
|
||||
if (!obj) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
jsapi.Init();
|
||||
|
||||
JSContext* cx = jsapi.cx();
|
||||
JS::Rooted<JSObject*> obj(cx, &aChoices.toObject());
|
||||
JSAutoRealmAllowCCW ar(cx, obj);
|
||||
JSAutoRealm ar(cx, obj);
|
||||
|
||||
JS::Rooted<JS::Value> val(cx);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user