зеркало из https://github.com/mozilla/gecko-dev.git
Bug 855130 - Traverse nsHostObjectProtocolHandler from nsDocument. r=khuey
This commit is contained in:
Родитель
74bfae38c4
Коммит
5db61d9da6
|
@ -39,6 +39,7 @@ public:
|
|||
nsACString& aUri);
|
||||
static void RemoveDataEntry(const nsACString& aUri);
|
||||
static nsIPrincipal* GetDataEntryPrincipal(const nsACString& aUri);
|
||||
static void Traverse(const nsACString& aUri, nsCycleCollectionTraversalCallback& aCallback);
|
||||
};
|
||||
|
||||
class nsBlobProtocolHandler : public nsHostObjectProtocolHandler
|
||||
|
|
|
@ -1774,6 +1774,10 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument)
|
|||
if (tmp->mCSSLoader) {
|
||||
tmp->mCSSLoader->TraverseCachedSheets(cb);
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < tmp->mHostObjectURIs.Length(); ++i) {
|
||||
nsHostObjectProtocolHandler::Traverse(tmp->mHostObjectURIs[i], cb);
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
|
||||
|
@ -1878,6 +1882,10 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
|
|||
tmp->mCSSLoader->UnlinkCachedSheets();
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < tmp->mHostObjectURIs.Length(); ++i) {
|
||||
nsHostObjectProtocolHandler::RemoveDataEntry(tmp->mHostObjectURIs[i]);
|
||||
}
|
||||
|
||||
tmp->mInUnlinkOrDeletion = false;
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
|
|
|
@ -86,6 +86,24 @@ nsHostObjectProtocolHandler::GetDataEntryPrincipal(const nsACString& aUri)
|
|||
return res->mPrincipal;
|
||||
}
|
||||
|
||||
void
|
||||
nsHostObjectProtocolHandler::Traverse(const nsACString& aUri,
|
||||
nsCycleCollectionTraversalCallback& aCallback)
|
||||
{
|
||||
if (!gDataTable) {
|
||||
return;
|
||||
}
|
||||
|
||||
DataInfo* res;
|
||||
gDataTable->Get(aUri, &res);
|
||||
if (!res) {
|
||||
return;
|
||||
}
|
||||
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(aCallback, "HostObjectProtocolHandler DataInfo.mObject");
|
||||
aCallback.NoteXPCOMChild(res->mObject);
|
||||
}
|
||||
|
||||
static DataInfo*
|
||||
GetDataInfo(const nsACString& aUri)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче