mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 842710 - Identify TabChildGlobals in about:memory/compartment, r=jlebar
This commit is contained in:
parent
7eed6db3e0
commit
5f4e3d6b40
@ -1111,7 +1111,8 @@ nsFrameScriptExecutor::TryCacheLoadAndCompileScript(const nsAString& aURL,
|
||||
}
|
||||
|
||||
bool
|
||||
nsFrameScriptExecutor::InitTabChildGlobalInternal(nsISupports* aScope)
|
||||
nsFrameScriptExecutor::InitTabChildGlobalInternal(nsISupports* aScope,
|
||||
const nsACString& aID)
|
||||
{
|
||||
|
||||
nsCOMPtr<nsIJSRuntimeService> runtimeSvc =
|
||||
@ -1151,6 +1152,11 @@ nsFrameScriptExecutor::InitTabChildGlobalInternal(nsISupports* aScope)
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
|
||||
JS_SetGlobalObject(cx, global);
|
||||
|
||||
// Set the location information for the new global, so that tools like
|
||||
// about:memory may use that information.
|
||||
xpc::SetLocationForGlobal(global, aID);
|
||||
|
||||
DidCreateCx();
|
||||
return true;
|
||||
}
|
||||
|
@ -294,7 +294,7 @@ protected:
|
||||
enum CacheFailedBehavior { EXECUTE_IF_CANT_CACHE, DONT_EXECUTE };
|
||||
void TryCacheLoadAndCompileScript(const nsAString& aURL,
|
||||
CacheFailedBehavior aBehavior = DONT_EXECUTE);
|
||||
bool InitTabChildGlobalInternal(nsISupports* aScope);
|
||||
bool InitTabChildGlobalInternal(nsISupports* aScope, const nsACString& aID);
|
||||
static void Traverse(nsFrameScriptExecutor *tmp,
|
||||
nsCycleCollectionTraversalCallback &cb);
|
||||
static void Unlink(nsFrameScriptExecutor* aTmp);
|
||||
|
@ -143,15 +143,6 @@ nsInProcessTabChildGlobal::Init()
|
||||
nullptr,
|
||||
mCx,
|
||||
mozilla::dom::ipc::MM_CHILD);
|
||||
|
||||
// Set the location information for the new global, so that tools like
|
||||
// about:memory may use that information.
|
||||
JSObject *global;
|
||||
nsIURI* docURI = mOwner->OwnerDoc()->GetDocumentURI();
|
||||
if (mGlobal && NS_SUCCEEDED(mGlobal->GetJSObject(&global)) && docURI) {
|
||||
xpc::SetLocationForGlobal(global, docURI);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -307,10 +298,18 @@ nsInProcessTabChildGlobal::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
|
||||
nsresult
|
||||
nsInProcessTabChildGlobal::InitTabChildGlobal()
|
||||
{
|
||||
|
||||
nsAutoCString id;
|
||||
id.AssignLiteral("inProcessTabChildGlobal");
|
||||
nsIURI* uri = mOwner->OwnerDoc()->GetDocumentURI();
|
||||
if (uri) {
|
||||
nsAutoCString u;
|
||||
uri->GetSpec(u);
|
||||
id.AppendLiteral("?ownedBy=");
|
||||
id.Append(u);
|
||||
}
|
||||
nsISupports* scopeSupports =
|
||||
NS_ISUPPORTS_CAST(nsIDOMEventTarget*, this);
|
||||
NS_ENSURE_STATE(InitTabChildGlobalInternal(scopeSupports));
|
||||
NS_ENSURE_STATE(InitTabChildGlobalInternal(scopeSupports, id));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -2060,7 +2060,8 @@ TabChild::InitTabChildGlobal(FrameScriptLoading aScriptLoading)
|
||||
|
||||
nsISupports* scopeSupports = NS_ISUPPORTS_CAST(nsIDOMEventTarget*, scope);
|
||||
|
||||
NS_ENSURE_TRUE(InitTabChildGlobalInternal(scopeSupports), false);
|
||||
NS_NAMED_LITERAL_CSTRING(globalId, "outOfProcessTabChildGlobal");
|
||||
NS_ENSURE_TRUE(InitTabChildGlobalInternal(scopeSupports, globalId), false);
|
||||
|
||||
scope->Init();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user