Skip to content

Commit 80adc67

Browse files
committed
Bug 1478955 part 1 - Rename JSAutoRealm to JSAutoRealmAllowCCW. r=luke
1 parent f4733cb commit 80adc67

File tree

127 files changed

+345
-345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+345
-345
lines changed

devtools/shared/heapsnapshot/tests/gtest/DevTools.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ struct DevTools : public ::testing::Test {
9494
if (!newGlobal)
9595
return nullptr;
9696

97-
JSAutoRealm ar(cx, newGlobal);
97+
JSAutoRealmAllowCCW ar(cx, newGlobal);
9898

9999
/* Populate the global object with the standard globals, like Object and
100100
Array. */

devtools/shared/heapsnapshot/tests/gtest/DoesCrossCompartmentBoundaries.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ DEF_TEST(DoesCrossCompartmentBoundaries, {
1818
ASSERT_TRUE(newGlobal);
1919
JS::Compartment* newCompartment = nullptr;
2020
{
21-
JSAutoRealm ar(cx, newGlobal);
21+
JSAutoRealmAllowCCW ar(cx, newGlobal);
2222
ASSERT_TRUE(JS::InitRealmStandardClasses(cx));
2323
newCompartment = js::GetContextCompartment(cx);
2424
}

devtools/shared/heapsnapshot/tests/gtest/DoesntCrossCompartmentBoundaries.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ DEF_TEST(DoesntCrossCompartmentBoundaries, {
1818
ASSERT_TRUE(newGlobal);
1919
JS::Compartment* newCompartment = nullptr;
2020
{
21-
JSAutoRealm ar(cx, newGlobal);
21+
JSAutoRealmAllowCCW ar(cx, newGlobal);
2222
ASSERT_TRUE(JS::InitRealmStandardClasses(cx));
2323
newCompartment = js::GetContextCompartment(cx);
2424
}

dom/base/ChromeUtils.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ ChromeUtils::ShallowClone(GlobalObject& aGlobal,
217217
return;
218218
}
219219

220-
JSAutoRealm ar(cx, obj);
220+
JSAutoRealmAllowCCW ar(cx, obj);
221221

222222
if (!JS_Enumerate(cx, obj, &ids) ||
223223
!values.reserve(ids.length())) {
@@ -240,7 +240,7 @@ ChromeUtils::ShallowClone(GlobalObject& aGlobal,
240240

241241
JS::RootedObject obj(cx);
242242
{
243-
Maybe<JSAutoRealm> ar;
243+
Maybe<JSAutoRealmAllowCCW> ar;
244244
if (aTarget) {
245245
JS::RootedObject target(cx, js::CheckedUnwrap(aTarget));
246246
if (!target) {
@@ -483,7 +483,7 @@ namespace module_getter {
483483

484484
JS::RootedValue value(aCx);
485485
{
486-
JSAutoRealm ar(aCx, moduleExports);
486+
JSAutoRealmAllowCCW ar(aCx, moduleExports);
487487

488488
if (!JS_GetPropertyById(aCx, moduleExports, id, &value)) {
489489
return false;
@@ -726,7 +726,7 @@ ChromeUtils::CreateError(const GlobalObject& aGlobal, const nsAString& aMessage,
726726
uint32_t line = 0;
727727
uint32_t column = 0;
728728

729-
Maybe<JSAutoRealm> ar;
729+
Maybe<JSAutoRealmAllowCCW> ar;
730730
JS::RootedObject stack(cx);
731731
if (aStack) {
732732
stack = UncheckedUnwrap(aStack);

dom/base/Element.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3747,7 +3747,7 @@ Element::Animate(const Nullable<ElementOrCSSPseudoElement>& aTarget,
37473747

37483748
// Animation constructor follows the standard Xray calling convention and
37493749
// needs to be called in the target element's realm.
3750-
Maybe<JSAutoRealm> ar;
3750+
Maybe<JSAutoRealmAllowCCW> ar;
37513751
if (js::GetContextCompartment(aContext) !=
37523752
js::GetObjectCompartment(ownerGlobal->GetGlobalJSObject())) {
37533753
ar.emplace(aContext, ownerGlobal->GetGlobalJSObject());

dom/base/IntlUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ IntlUtils::GetDisplayNames(const Sequence<nsString>& aLocales,
8888
}
8989

9090
// Return the result as DisplayNameResult.
91-
JSAutoRealm ar(cx, &retVal.toObject());
91+
JSAutoRealmAllowCCW ar(cx, &retVal.toObject());
9292
if (!aResult.Init(cx, retVal)) {
9393
aError.Throw(NS_ERROR_FAILURE);
9494
}
@@ -135,7 +135,7 @@ IntlUtils::GetLocaleInfo(const Sequence<nsString>& aLocales,
135135
}
136136

137137
// Return the result as LocaleInfo.
138-
JSAutoRealm ar(cx, &retVal.toObject());
138+
JSAutoRealmAllowCCW ar(cx, &retVal.toObject());
139139
if (!aResult.Init(cx, retVal)) {
140140
aError.Throw(NS_ERROR_FAILURE);
141141
}

dom/base/PostMessageEvent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ PostMessageEvent::Run()
7777
targetWindow->IsDying())
7878
return NS_OK;
7979

80-
JSAutoRealm ar(cx, targetWindow->GetWrapper());
80+
JSAutoRealmAllowCCW ar(cx, targetWindow->GetWrapper());
8181

8282
// Ensure that any origin which might have been provided is the origin of this
8383
// window's document. Note that we do this *now* instead of when postMessage

dom/base/StructuredCloneBlob.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ StructuredCloneBlob::Constructor(GlobalObject& aGlobal, JS::HandleValue aValue,
3838

3939
RefPtr<StructuredCloneBlob> holder = StructuredCloneBlob::Create();
4040

41-
Maybe<JSAutoRealm> ar;
41+
Maybe<JSAutoRealmAllowCCW> ar;
4242
JS::RootedValue value(cx, aValue);
4343

4444
if (aTargetGlobal) {
@@ -87,7 +87,7 @@ StructuredCloneBlob::Deserialize(JSContext* aCx, JS::HandleObject aTargetScope,
8787
}
8888

8989
{
90-
JSAutoRealm ar(aCx, scope);
90+
JSAutoRealmAllowCCW ar(aCx, scope);
9191

9292
Read(xpc::NativeGlobal(scope), aCx, aResult, aRv);
9393
if (aRv.Failed()) {

dom/base/nsContentPermissionHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ nsContentPermissionRequestProxy::Allow(JS::HandleValue aChoices)
713713

714714
JSContext* cx = jsapi.cx();
715715
JS::Rooted<JSObject*> obj(cx, &aChoices.toObject());
716-
JSAutoRealm ar(cx, obj);
716+
JSAutoRealmAllowCCW ar(cx, obj);
717717

718718
JS::Rooted<JS::Value> val(cx);
719719

dom/base/nsContentUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7028,7 +7028,7 @@ nsContentUtils::IsPatternMatching(nsAString& aValue, nsAString& aPattern,
70287028

70297029
// We can use the junk scope here, because we're just using it for
70307030
// regexp evaluation, not actual script execution.
7031-
JSAutoRealm ar(cx, xpc::UnprivilegedJunkScope());
7031+
JSAutoRealmAllowCCW ar(cx, xpc::UnprivilegedJunkScope());
70327032

70337033
// The pattern has to match the entire value.
70347034
aPattern.InsertLiteral(u"^(?:", 0);

0 commit comments

Comments
 (0)