Backed out changeset f9e641cbce05 (bug 1279186) for Mochitest M(1) leak issue.
authorIris Hsiao <ihsiao@mozilla.com>
Mon, 18 Jul 2016 12:10:39 +0800
changeset 388837 bbaa820b8c7cf244614cffa3b505c6a492bf28ad
parent 388829 fccc189b56d8809b7258da4f7685ea47fc1493a3
child 388838 7bda4f49e0f50b127a6510b6609f6e305c6458eb
push id23247
push userbmo:jgilbert@mozilla.com
push dateMon, 18 Jul 2016 06:13:58 +0000
bugs1279186
milestone50.0a1
backs outf9e641cbce0519105ca330e7862dbf6579f1c70c
Backed out changeset f9e641cbce05 (bug 1279186) for Mochitest M(1) leak issue.
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -2055,23 +2055,16 @@ ContentParent::ActorDestroy(ActorDestroy
                                                       &ContentParent::ShutDownProcess,
                                                       SEND_SHUTDOWN_MESSAGE));
   }
   cpm->RemoveContentProcess(this->ChildID());
 
   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
 ContentParent::NotifyTabDestroying(const TabId& aTabId,
                                    const ContentParentId& aCpId)
 {
   if (XRE_IsParentProcess()) {
     // There can be more than one PBrowser for a given app process
@@ -5751,37 +5744,27 @@ ContentParent::RecvStoreAndBroadcastBlob
                                                         const Principal& aPrincipal)
 {
   RefPtr<BlobImpl> blobImpl =
     static_cast<BlobParent*>(aBlobParent)->GetBlobImpl();
   if (NS_WARN_IF(!blobImpl)) {
     return false;
   }
 
-  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);
-  }
-
+  nsHostObjectProtocolHandler::AddDataEntry(aURI, blobImpl, aPrincipal);
   BroadcastBlobURLRegistration(aURI, blobImpl, aPrincipal, this);
   return true;
 }
 
 bool
 ContentParent::RecvUnstoreAndBroadcastBlobURLUnregistration(const nsCString& aURI)
 {
   nsHostObjectProtocolHandler::RemoveDataEntry(aURI,
                                                false /* Don't broadcast */);
   BroadcastBlobURLUnregistration(aURI, this);
-  mBlobURLs.RemoveElement(aURI);
-
   return true;
 }
 
 } // namespace dom
 } // namespace mozilla
 
 NS_IMPL_ISUPPORTS(ParentIdleListener, nsIObserver)
 
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -1294,18 +1294,16 @@ private:
 
 #ifdef NS_PRINTING
   RefPtr<embedding::PrintingParent> mPrintingParent;
 #endif
 
   // 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
 } // namespace mozilla
 
 class ParentIdleListener : public nsIObserver
 {
   friend class mozilla::dom::ContentParent;