Backed out changeset 2577afd226ff (bug 1358113)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 24 Apr 2017 15:43:00 +0200
changeset 354567 3876d6661539ca114ee4e704efa3dc5f47a45487
parent 354566 b57e9a48a8bbb3af1977d130ff304ce36a668319
child 354568 6e7b7e621dc3ce728090a7e6fbe74be1e229db69
push id89494
push userarchaeopteryx@coole-files.de
push dateMon, 24 Apr 2017 13:44:28 +0000
treeherdermozilla-inbound@d8868683036b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1358113
milestone55.0a1
backs out2577afd226ff64101e4ed3767d0abff83c34c9bd
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 2577afd226ff (bug 1358113)
dom/ipc/ContentChild.cpp
dom/ipc/ContentParent.cpp
dom/ipc/PContent.ipdl
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -3300,18 +3300,21 @@ ContentChild::RecvFileCreationResponse(c
   }
 
   if (aResult.type() == FileCreationResult::TFileCreationErrorResult) {
     helper->ResponseReceived(nullptr,
                              aResult.get_FileCreationErrorResult().errorCode());
   } else {
     MOZ_ASSERT(aResult.type() == FileCreationResult::TFileCreationSuccessResult);
 
-    RefPtr<BlobImpl> impl =
-      IPCBlobUtils::Deserialize(aResult.get_FileCreationSuccessResult().blob());
+    PBlobChild* blobChild =
+      aResult.get_FileCreationSuccessResult().blobChild();
+    MOZ_ASSERT(blobChild);
+
+    RefPtr<BlobImpl> impl = static_cast<BlobChild*>(blobChild)->GetBlobImpl();
     helper->ResponseReceived(impl, NS_OK);
   }
 
   mFileCreationPending.Remove(aUUID);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -41,17 +41,16 @@
 #include "mozilla/DataStorage.h"
 #include "mozilla/devtools/HeapSnapshotTempFileHelperParent.h"
 #include "mozilla/docshell/OfflineCacheUpdateParent.h"
 #include "mozilla/dom/DataTransfer.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/FileCreatorHelper.h"
 #include "mozilla/dom/FileSystemSecurity.h"
-#include "mozilla/dom/IPCBlobUtils.h"
 #include "mozilla/dom/ExternalHelperAppParent.h"
 #include "mozilla/dom/GetFilesHelper.h"
 #include "mozilla/dom/GeolocationBinding.h"
 #include "mozilla/dom/MemoryReportRequest.h"
 #include "mozilla/dom/Notification.h"
 #include "mozilla/dom/PContentBridgeParent.h"
 #include "mozilla/dom/PContentPermissionRequestParent.h"
 #include "mozilla/dom/PCycleCollectWithLogsParent.h"
@@ -5295,24 +5294,20 @@ ContentParent::RecvFileCreationRequest(c
       return IPC_FAIL_NO_REASON(this);
     }
 
     return IPC_OK();
   }
 
   MOZ_ASSERT(blobImpl);
 
-  IPCBlob ipcBlob;
-  rv = IPCBlobUtils::Serialize(blobImpl, this, ipcBlob);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    if (!SendFileCreationResponse(aID, FileCreationErrorResult(rv))) {
-      return IPC_FAIL_NO_REASON(this);
-    }
-
-    return IPC_OK();
-  }
-
-  if (!SendFileCreationResponse(aID, FileCreationSuccessResult(ipcBlob))) {
+  BlobParent* blobParent = BlobParent::GetOrCreate(this, blobImpl);
+  if (NS_WARN_IF(!blobParent)) {
+    return IPC_FAIL_NO_REASON(this);
+  }
+
+  if (!SendFileCreationResponse(aID,
+                                FileCreationSuccessResult(blobParent, nullptr))) {
     return IPC_FAIL_NO_REASON(this);
   }
 
   return IPC_OK();
 }
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -207,17 +207,17 @@ struct GetFilesResponseFailure
 union GetFilesResponseResult
 {
   GetFilesResponseSuccess;
   GetFilesResponseFailure;
 };
 
 struct FileCreationSuccessResult
 {
-  IPCBlob blob;
+  PBlob blob;
 };
 
 struct FileCreationErrorResult
 {
   nsresult errorCode;
 };
 
 union FileCreationResult