@@ -1652,7 +1652,7 @@ ResolvePrototypeOrConstructor(JSContext* cx, JS::Handle<JSObject*> wrapper,
16521652{
16531653 JS::Rooted<JSObject*> global (cx, JS::GetNonCCWObjectGlobal (obj));
16541654 {
1655- JSAutoRealmAllowCCW ar (cx, global);
1655+ JSAutoRealm ar (cx, global);
16561656 ProtoAndIfaceCache& protoAndIfaceCache = *GetProtoAndIfaceCache (global);
16571657 // This function is called when resolving the "constructor" and "prototype"
16581658 // properties of Xrays for DOM prototypes and constructors respectively.
@@ -2297,7 +2297,7 @@ ReparentWrapper(JSContext* aCx, JS::Handle<JSObject*> aObjArg, ErrorResult& aErr
22972297 domClass->mGetAssociatedGlobal (aCx, aObj));
22982298 MOZ_ASSERT (JS_IsGlobalObject (newParent));
22992299
2300- JSAutoRealmAllowCCW oldAr (aCx, oldParent);
2300+ JSAutoRealm oldAr (aCx, oldParent);
23012301
23022302 JS::Compartment* oldCompartment = js::GetObjectCompartment (oldParent);
23032303 JS::Compartment* newCompartment = js::GetObjectCompartment (newParent);
@@ -2317,7 +2317,7 @@ ReparentWrapper(JSContext* aCx, JS::Handle<JSObject*> aObjArg, ErrorResult& aErr
23172317 expandoObject = DOMProxyHandler::GetAndClearExpandoObject (aObj);
23182318 }
23192319
2320- JSAutoRealmAllowCCW newAr (aCx, newParent);
2320+ JSAutoRealm newAr (aCx, newParent);
23212321
23222322 // First we clone the reflector. We get a copy of its properties and clone its
23232323 // expando chain.
@@ -3564,7 +3564,7 @@ GetMaplikeSetlikeBackingObject(JSContext* aCx, JS::Handle<JSObject*> aObj,
35643564 // Since backing object access can happen in non-originating realms,
35653565 // make sure to create the backing object in reflector realm.
35663566 {
3567- JSAutoRealmAllowCCW ar (aCx, reflector);
3567+ JSAutoRealm ar (aCx, reflector);
35683568 JS::Rooted<JSObject*> newBackingObj (aCx);
35693569 newBackingObj.set (Method (aCx));
35703570 if (NS_WARN_IF(!newBackingObj)) {
@@ -3787,7 +3787,7 @@ HTMLConstructor(JSContext* aCx, unsigned aArgc, JS::Value* aVp,
37873787 // objects as constructors? Of course it's not clear that the spec check
37883788 // makes sense to start with: https://github.com/whatwg/html/issues/3575
37893789 {
3790- JSAutoRealmAllowCCW ar (aCx, newTarget);
3790+ JSAutoRealm ar (aCx, newTarget);
37913791 JS::Handle<JSObject*> constructor =
37923792 GetPerInterfaceObjectHandle (aCx, aConstructorId, aCreator,
37933793 true );
@@ -3822,7 +3822,7 @@ HTMLConstructor(JSContext* aCx, unsigned aArgc, JS::Value* aVp,
38223822 // function should be HTMLElement or XULElement. We want to get the actual
38233823 // functions to compare to from our global's realm, not the caller
38243824 // realm.
3825- JSAutoRealmAllowCCW ar (aCx, global.Get ());
3825+ JSAutoRealm ar (aCx, global.Get ());
38263826
38273827 JS::Rooted<JSObject*> constructor (aCx);
38283828 if (ns == kNameSpaceID_XUL ) {
@@ -3877,7 +3877,7 @@ HTMLConstructor(JSContext* aCx, unsigned aArgc, JS::Value* aVp,
38773877
38783878 // We want to get the constructor from our global's realm, not the
38793879 // caller realm.
3880- JSAutoRealmAllowCCW ar (aCx, global.Get ());
3880+ JSAutoRealm ar (aCx, global.Get ());
38813881 JS::Rooted<JSObject*> constructor (aCx, cb (aCx));
38823882 if (!constructor) {
38833883 return false ;
@@ -3904,7 +3904,7 @@ HTMLConstructor(JSContext* aCx, unsigned aArgc, JS::Value* aVp,
39043904 // whose target is not same-realm with the proxy, or bound functions, etc).
39053905 // https://bugzilla.mozilla.org/show_bug.cgi?id=1317658
39063906 {
3907- JSAutoRealmAllowCCW ar (aCx, newTarget);
3907+ JSAutoRealm ar (aCx, newTarget);
39083908 desiredProto = GetPerInterfaceObjectHandle (aCx, aProtoId, aCreator, true );
39093909 if (!desiredProto) {
39103910 return false ;
@@ -3929,7 +3929,7 @@ HTMLConstructor(JSContext* aCx, unsigned aArgc, JS::Value* aVp,
39293929 // Now we go to construct an element. We want to do this in global's
39303930 // realm, not caller realm (the normal constructor behavior),
39313931 // just in case those elements create JS things.
3932- JSAutoRealmAllowCCW ar (aCx, global.Get ());
3932+ JSAutoRealm ar (aCx, global.Get ());
39333933
39343934 RefPtr<NodeInfo> nodeInfo =
39353935 doc->NodeInfoManager ()->GetNodeInfo (definition->mLocalName ,
@@ -3972,7 +3972,7 @@ HTMLConstructor(JSContext* aCx, unsigned aArgc, JS::Value* aVp,
39723972 JS::Rooted<JSObject*> reflector (aCx, element->GetWrapper ());
39733973 if (reflector) {
39743974 // reflector might be in different realm.
3975- JSAutoRealmAllowCCW ar (aCx, reflector);
3975+ JSAutoRealm ar (aCx, reflector);
39763976 JS::Rooted<JSObject*> givenProto (aCx, desiredProto);
39773977 if (!JS_WrapObject (aCx, &givenProto) ||
39783978 !JS_SetPrototype (aCx, reflector, givenProto)) {
@@ -3987,7 +3987,7 @@ HTMLConstructor(JSContext* aCx, unsigned aArgc, JS::Value* aVp,
39873987 // Tail end of step 8 and step 13: returning the element. We want to do this
39883988 // part in the global's realm, though in practice it won't matter much
39893989 // because Element always knows which realm it should be created in.
3990- JSAutoRealmAllowCCW ar (aCx, global.Get ());
3990+ JSAutoRealm ar (aCx, global.Get ());
39913991 if (!js::IsObjectInContextCompartment (desiredProto, aCx) &&
39923992 !JS_WrapObject (aCx, &desiredProto)) {
39933993 return false ;
@@ -4009,7 +4009,7 @@ AssertReflectorHasGivenProto(JSContext* aCx, JSObject* aReflector,
40094009 }
40104010
40114011 JS::Rooted<JSObject*> reflector (aCx, aReflector);
4012- JSAutoRealmAllowCCW ar (aCx, reflector);
4012+ JSAutoRealm ar (aCx, reflector);
40134013 JS::Rooted<JSObject*> reflectorProto (aCx);
40144014 bool ok = JS_GetPrototype (aCx, reflector, &reflectorProto);
40154015 MOZ_ASSERT (ok);
0 commit comments