Bug 1365086, part 2 - Add unlink method for nsMessageManagerScriptExecutor. r=smaug

MozReview-Commit-ID: 66qpza5yEZT

--HG--
extra : rebase_source : 290a4102a1e44e6c1a6cf63c48e931130970bd93
This commit is contained in:
Andrew McCreight 2017-05-15 13:05:18 -07:00
Родитель 7a82b9da0e
Коммит ffae1f697d
5 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -63,7 +63,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ProcessGlobal)
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_UNLINK(mMessageManager)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mGlobal)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mAnonymousGlobalScopes)
tmp->nsMessageManagerScriptExecutor::Unlink();
tmp->UnlinkHostObjectURIs();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END

Просмотреть файл

@ -1679,6 +1679,12 @@ nsMessageManagerScriptExecutor::Trace(const TraceCallbacks& aCallbacks, void* aC
}
}
void
nsMessageManagerScriptExecutor::Unlink()
{
ImplCycleCollectionUnlink(mAnonymousGlobalScopes);
}
bool
nsMessageManagerScriptExecutor::InitChildGlobalInternal(
nsISupports* aScope,

Просмотреть файл

@ -386,6 +386,7 @@ protected:
bool aRunInGlobalScope);
bool InitChildGlobalInternal(nsISupports* aScope, const nsACString& aID);
void Trace(const TraceCallbacks& aCallbacks, void* aClosure);
void Unlink();
nsCOMPtr<nsIXPConnectJSObjectHolder> mGlobal;
nsCOMPtr<nsIPrincipal> mPrincipal;
AutoTArray<JS::Heap<JSObject*>, 2> mAnonymousGlobalScopes;

Просмотреть файл

@ -156,8 +156,8 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsInProcessTabChildGlobal,
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mMessageManager)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mGlobal)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mAnonymousGlobalScopes)
tmp->UnlinkHostObjectURIs();
tmp->nsMessageManagerScriptExecutor::Unlink();
tmp->UnlinkHostObjectURIs();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsInProcessTabChildGlobal)

Просмотреть файл

@ -183,7 +183,7 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(TabChildBase)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(TabChildBase)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mTabChildGlobal)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mGlobal)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mAnonymousGlobalScopes)
tmp->nsMessageManagerScriptExecutor::Unlink();
NS_IMPL_CYCLE_COLLECTION_UNLINK(mWebBrowserChrome)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END