mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 1279186 - Blob URLs in multi-e10s - part 2 - Contentparent unregistes BlobURLs if the child crashes, r=gabor
This commit is contained in:
parent
0c1a08fce6
commit
e2f70c803b
@ -2060,6 +2060,13 @@ ContentParent::ActorDestroy(ActorDestroyReason why)
|
||||
if (mDriverCrashGuard) {
|
||||
mDriverCrashGuard->NotifyCrashed();
|
||||
}
|
||||
|
||||
// Unregister all the BlobURLs registered by the ContentChild.
|
||||
for (uint32_t i = 0; i < mBlobURLs.Length(); ++i) {
|
||||
nsHostObjectProtocolHandler::RemoveDataEntry(mBlobURLs[i]);
|
||||
}
|
||||
|
||||
mBlobURLs.Clear();
|
||||
}
|
||||
|
||||
void
|
||||
@ -5746,7 +5753,15 @@ ContentParent::RecvStoreAndBroadcastBlobURLRegistration(const nsCString& aURI,
|
||||
return false;
|
||||
}
|
||||
|
||||
nsHostObjectProtocolHandler::AddDataEntry(aURI, blobImpl, aPrincipal);
|
||||
if (NS_SUCCEEDED(nsHostObjectProtocolHandler::AddDataEntry(aURI, blobImpl,
|
||||
aPrincipal))) {
|
||||
BroadcastBlobURLRegistration(aURI, blobImpl, aPrincipal, this);
|
||||
|
||||
// We want to store this blobURL, so we can unregister it if the child
|
||||
// crashes.
|
||||
mBlobURLs.AppendElement(aURI);
|
||||
}
|
||||
|
||||
BroadcastBlobURLRegistration(aURI, blobImpl, aPrincipal, this);
|
||||
return true;
|
||||
}
|
||||
@ -5757,6 +5772,8 @@ ContentParent::RecvUnstoreAndBroadcastBlobURLUnregistration(const nsCString& aUR
|
||||
nsHostObjectProtocolHandler::RemoveDataEntry(aURI,
|
||||
false /* Don't broadcast */);
|
||||
BroadcastBlobURLUnregistration(aURI, this);
|
||||
mBlobURLs.RemoveElement(aURI);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1294,6 +1294,8 @@ private:
|
||||
// This hashtable is used to run GetFilesHelper objects in the parent process.
|
||||
// GetFilesHelper can be aborted by receiving RecvDeleteGetFilesRequest.
|
||||
nsRefPtrHashtable<nsIDHashKey, GetFilesHelper> mGetFilesPendingRequests;
|
||||
|
||||
nsTArray<nsCString> mBlobURLs;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
Loading…
x
Reference in New Issue
Block a user