From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- dom/ipc/jsactor/JSActorManager.cpp | 14 ++++++++------ dom/ipc/jsactor/JSActorService.cpp | 8 ++++---- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'dom/ipc/jsactor') diff --git a/dom/ipc/jsactor/JSActorManager.cpp b/dom/ipc/jsactor/JSActorManager.cpp index b8791570d6..c6be8488b5 100644 --- a/dom/ipc/jsactor/JSActorManager.cpp +++ b/dom/ipc/jsactor/JSActorManager.cpp @@ -63,19 +63,21 @@ already_AddRefed JSActorManager::GetActor(JSContext* aCx, // If the JSActor uses `loadInDevToolsLoader`, force loading in the DevTools // specific's loader. RefPtr loader = protocol->mLoadInDevToolsLoader - ? mozJSModuleLoader::GetOrCreateDevToolsLoader() + ? mozJSModuleLoader::GetOrCreateDevToolsLoader(aCx) : mozJSModuleLoader::Get(); MOZ_ASSERT(loader); // We're about to construct the actor, so make sure we're in the loader realm // while importing etc. - JSAutoRealm ar(aCx, loader->GetSharedGlobal(aCx)); + JSAutoRealm ar(aCx, loader->GetSharedGlobal()); // If a module URI was provided, use it to construct an instance of the actor. JS::Rooted actorObj(aCx); if (side.mModuleURI || side.mESModuleURI) { JS::Rooted exports(aCx); if (side.mModuleURI) { + // TODO: Remove this once m-c, c-c, and out-of-tree code migrations finish + // (bug 1866732). JS::Rooted global(aCx); aRv = loader->Import(aCx, side.mModuleURI.ref(), &global, &exports); if (aRv.Failed()) { @@ -143,9 +145,9 @@ void JSActorManager::ReceiveRawMessage( Maybe&& aStack) { MOZ_ASSERT(nsContentUtils::IsSafeToRunScript()); - CrashReporter::AutoAnnotateCrashReport autoActorName( + CrashReporter::AutoRecordAnnotation autoActorName( CrashReporter::Annotation::JSActorName, aMetadata.actorName()); - CrashReporter::AutoAnnotateCrashReport autoMessageName( + CrashReporter::AutoRecordAnnotation autoMessageName( CrashReporter::Annotation::JSActorMessage, NS_LossyConvertUTF16toASCII(aMetadata.messageName())); @@ -237,7 +239,7 @@ void JSActorManager::JSActorWillDestroy() { void JSActorManager::JSActorDidDestroy() { MOZ_ASSERT(nsContentUtils::IsSafeToRunScript()); - CrashReporter::AutoAnnotateCrashReport autoMessageName( + CrashReporter::AutoRecordAnnotation autoMessageName( CrashReporter::Annotation::JSActorMessage, ""_ns); // Swap the table with `mJSActors` so that we don't invalidate it while @@ -245,7 +247,7 @@ void JSActorManager::JSActorDidDestroy() { const nsRefPtrHashtable actors = std::move(mJSActors); for (const auto& entry : actors.Values()) { - CrashReporter::AutoAnnotateCrashReport autoActorName( + CrashReporter::AutoRecordAnnotation autoActorName( CrashReporter::Annotation::JSActorName, entry->Name()); // Do not risk to run script very late in shutdown if (!AppShutdown::IsInOrBeyond(ShutdownPhase::XPCOMShutdownFinal)) { diff --git a/dom/ipc/jsactor/JSActorService.cpp b/dom/ipc/jsactor/JSActorService.cpp index 3fde76a206..5b6c63d2a4 100644 --- a/dom/ipc/jsactor/JSActorService.cpp +++ b/dom/ipc/jsactor/JSActorService.cpp @@ -106,9 +106,9 @@ void JSActorService::RegisterWindowActor(const nsACString& aName, void JSActorService::UnregisterWindowActor(const nsACString& aName) { MOZ_ASSERT(nsContentUtils::IsSafeToRunScript()); - CrashReporter::AutoAnnotateCrashReport autoActorName( + CrashReporter::AutoRecordAnnotation autoActorName( CrashReporter::Annotation::JSActorName, aName); - CrashReporter::AutoAnnotateCrashReport autoMessageName( + CrashReporter::AutoRecordAnnotation autoMessageName( CrashReporter::Annotation::JSActorMessage, ""_ns); nsAutoCString name(aName); @@ -268,9 +268,9 @@ void JSActorService::RegisterProcessActor(const nsACString& aName, void JSActorService::UnregisterProcessActor(const nsACString& aName) { MOZ_ASSERT(nsContentUtils::IsSafeToRunScript()); - CrashReporter::AutoAnnotateCrashReport autoActorName( + CrashReporter::AutoRecordAnnotation autoActorName( CrashReporter::Annotation::JSActorName, aName); - CrashReporter::AutoAnnotateCrashReport autoMessageName( + CrashReporter::AutoRecordAnnotation autoMessageName( CrashReporter::Annotation::JSActorMessage, ""_ns); nsAutoCString name(aName); -- cgit v1.2.3