diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index 68ed58de00c4..f365dfed52e1 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -3305,11 +3305,8 @@ ContentChild::RecvFileCreationResponse(const nsID& aUUID, } else { MOZ_ASSERT(aResult.type() == FileCreationResult::TFileCreationSuccessResult); - PBlobChild* blobChild = - aResult.get_FileCreationSuccessResult().blobChild(); - MOZ_ASSERT(blobChild); - - RefPtr impl = static_cast(blobChild)->GetBlobImpl(); + RefPtr impl = + IPCBlobUtils::Deserialize(aResult.get_FileCreationSuccessResult().blob()); helper->ResponseReceived(impl, NS_OK); } diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index f1ece924c846..54778b936521 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -46,6 +46,7 @@ #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" @@ -5317,13 +5318,17 @@ ContentParent::RecvFileCreationRequest(const nsID& aID, MOZ_ASSERT(blobImpl); - BlobParent* blobParent = BlobParent::GetOrCreate(this, blobImpl); - if (NS_WARN_IF(!blobParent)) { - return IPC_FAIL_NO_REASON(this); + 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(blobParent, nullptr))) { + if (!SendFileCreationResponse(aID, FileCreationSuccessResult(ipcBlob))) { return IPC_FAIL_NO_REASON(this); } diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index ac3d2dfb1c20..113e52e3e5c5 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -212,7 +212,7 @@ union GetFilesResponseResult struct FileCreationSuccessResult { - PBlob blob; + IPCBlob blob; }; struct FileCreationErrorResult