Bug 1359718 - Get rid of PBlob - part 2 - PBlob, r=smaug, r=kanru
☠☠ backed out by 5ca20971f1e0 ☠ ☠
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 23 May 2017 18:05:19 +0200
changeset 360223 537abc431472a8b16d9b6b0e932bc237c023cc71
parent 360222 3b7d055b42073da6e9165ed9828b7a33deb48586
child 360224 5ded99aa9c745557e295ba6571d0c5fced6951c8
push id31872
push userryanvm@gmail.com
push dateTue, 23 May 2017 22:11:58 +0000
treeherdermozilla-central@96e18bec9fc8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, kanru
bugs1359718
milestone55.0a1
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
Bug 1359718 - Get rid of PBlob - part 2 - PBlob, r=smaug, r=kanru
dom/base/StructuredCloneHolder.cpp
dom/base/nsFrameMessageManager.cpp
dom/broadcastchannel/BroadcastChannelChild.cpp
dom/file/ipc/Blob.cpp
dom/file/ipc/BlobChild.h
dom/file/ipc/BlobParent.h
dom/file/ipc/IPCBlobUtils.cpp
dom/file/ipc/IPCBlobUtils.h
dom/file/ipc/PBlob.ipdl
dom/file/ipc/PendingIPCBlobParent.cpp
dom/file/ipc/moz.build
dom/file/ipc/nsIRemoteBlob.h
dom/indexedDB/IDBObjectStore.cpp
dom/ipc/ContentBridgeChild.cpp
dom/ipc/ContentBridgeChild.h
dom/ipc/ContentBridgeParent.cpp
dom/ipc/ContentBridgeParent.h
dom/ipc/ContentChild.cpp
dom/ipc/ContentChild.h
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
dom/ipc/DOMTypes.ipdlh
dom/ipc/PBrowser.ipdl
dom/ipc/PContent.ipdl
dom/ipc/PContentBridge.ipdl
dom/ipc/nsIContentChild.cpp
dom/ipc/nsIContentChild.h
dom/ipc/nsIContentParent.cpp
dom/ipc/nsIContentParent.h
dom/messagechannel/SharedMessagePortMessage.cpp
ipc/glue/BackgroundChild.h
ipc/glue/BackgroundChildImpl.cpp
ipc/glue/BackgroundChildImpl.h
ipc/glue/BackgroundImpl.cpp
ipc/glue/BackgroundParent.h
ipc/glue/BackgroundParentImpl.cpp
ipc/glue/BackgroundParentImpl.h
ipc/glue/InputStreamUtils.cpp
ipc/glue/PBackground.ipdl
ipc/ipdl/sync-messages.ini
--- a/dom/base/StructuredCloneHolder.cpp
+++ b/dom/base/StructuredCloneHolder.cpp
@@ -15,17 +15,16 @@
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/FileList.h"
 #include "mozilla/dom/FileListBinding.h"
 #include "mozilla/dom/FormData.h"
 #include "mozilla/dom/ImageBitmap.h"
 #include "mozilla/dom/ImageBitmapBinding.h"
 #include "mozilla/dom/ImageData.h"
 #include "mozilla/dom/ImageDataBinding.h"
-#include "mozilla/dom/ipc/BlobChild.h"
 #include "mozilla/dom/StructuredClone.h"
 #include "mozilla/dom/MessagePort.h"
 #include "mozilla/dom/MessagePortBinding.h"
 #include "mozilla/dom/OffscreenCanvas.h"
 #include "mozilla/dom/OffscreenCanvasBinding.h"
 #include "mozilla/dom/PMessagePort.h"
 #include "mozilla/dom/StructuredCloneTags.h"
 #include "mozilla/dom/SubtleCryptoBinding.h"
--- a/dom/base/nsFrameMessageManager.cpp
+++ b/dom/base/nsFrameMessageManager.cpp
@@ -37,18 +37,16 @@
 #include "mozilla/Telemetry.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/MessagePort.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/PermissionMessageUtils.h"
 #include "mozilla/dom/ProcessGlobal.h"
 #include "mozilla/dom/SameProcessMessageQueue.h"
 #include "mozilla/dom/ScriptSettings.h"
-#include "mozilla/dom/ipc/BlobChild.h"
-#include "mozilla/dom/ipc/BlobParent.h"
 #include "mozilla/dom/ipc/StructuredCloneData.h"
 #include "mozilla/dom/DOMStringList.h"
 #include "mozilla/jsipc/CrossProcessObjectWrappers.h"
 #include "nsPrintfCString.h"
 #include "nsXULAppAPI.h"
 #include "nsQueryObject.h"
 #include <algorithm>
 #include "chrome/common/ipc_channel.h" // for IPC::Channel::kMaximumMessageSize
--- a/dom/broadcastchannel/BroadcastChannelChild.cpp
+++ b/dom/broadcastchannel/BroadcastChannelChild.cpp
@@ -2,17 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "BroadcastChannelChild.h"
 #include "BroadcastChannel.h"
 #include "jsapi.h"
-#include "mozilla/dom/ipc/BlobChild.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/MessageEvent.h"
 #include "mozilla/dom/MessageEventBinding.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "mozilla/dom/WorkerScope.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/ipc/PBackgroundChild.h"
 #include "mozilla/dom/ipc/StructuredCloneData.h"
deleted file mode 100644
--- a/dom/file/ipc/Blob.cpp
+++ /dev/null
@@ -1,4024 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "BlobChild.h"
-#include "BlobParent.h"
-
-#include "BackgroundParent.h"
-#include "ContentChild.h"
-#include "ContentParent.h"
-#include "EmptyBlobImpl.h"
-#include "FileDescriptorSetChild.h"
-#include "jsapi.h"
-#include "mozilla/Assertions.h"
-#include "mozilla/ClearOnShutdown.h"
-#include "mozilla/DebugOnly.h"
-#include "mozilla/Monitor.h"
-#include "mozilla/Mutex.h"
-#include "mozilla/Unused.h"
-#include "mozilla/dom/BaseBlobImpl.h"
-#include "mozilla/dom/nsIContentParent.h"
-#include "mozilla/dom/nsIContentChild.h"
-#include "mozilla/dom/indexedDB/FileSnapshot.h"
-#include "mozilla/dom/IndexedDatabaseManager.h"
-#include "mozilla/ipc/InputStreamUtils.h"
-#include "mozilla/ipc/IPCStreamUtils.h"
-#include "mozilla/ipc/BackgroundChild.h"
-#include "mozilla/ipc/PBackgroundChild.h"
-#include "mozilla/ipc/PBackgroundParent.h"
-#include "mozilla/ipc/PFileDescriptorSetParent.h"
-#include "MultipartBlobImpl.h"
-#include "nsDataHashtable.h"
-#include "nsHashKeys.h"
-#include "nsID.h"
-#include "nsIFileStreams.h"
-#include "nsIInputStream.h"
-#include "nsIIPCSerializableInputStream.h"
-#include "nsIMultiplexInputStream.h"
-#include "nsIRemoteBlob.h"
-#include "nsISeekableStream.h"
-#include "nsIUUIDGenerator.h"
-#include "nsNetCID.h"
-#include "nsServiceManagerUtils.h"
-#include "nsStringStream.h"
-#include "nsThreadUtils.h"
-#include "nsXULAppAPI.h"
-#include "SlicedInputStream.h"
-#include "StreamBlobImpl.h"
-#include "WorkerPrivate.h"
-#include "WorkerRunnable.h"
-
-#ifdef OS_POSIX
-#include "chrome/common/file_descriptor_set_posix.h"
-#endif
-
-#define DISABLE_ASSERTS_FOR_FUZZING 0
-
-#if DISABLE_ASSERTS_FOR_FUZZING
-#define ASSERT_UNLESS_FUZZING(...) do { } while (0)
-#else
-#define ASSERT_UNLESS_FUZZING(...) MOZ_ASSERT(false, __VA_ARGS__)
-#endif
-
-#define PRIVATE_REMOTE_INPUT_STREAM_IID \
-  {0x30c7699f, 0x51d2, 0x48c8, {0xad, 0x56, 0xc0, 0x16, 0xd7, 0x6f, 0x71, 0x27}}
-
-namespace mozilla {
-namespace dom {
-
-using namespace mozilla::ipc;
-using namespace mozilla::dom::indexedDB;
-using namespace mozilla::dom::workers;
-
-namespace {
-
-const char kUUIDGeneratorContractId[] = "@mozilla.org/uuid-generator;1";
-
-const uint32_t kMaxFileDescriptorsPerMessage = 250;
-
-#ifdef OS_POSIX
-// Keep this in sync with other platforms.
-static_assert(FileDescriptorSet::MAX_DESCRIPTORS_PER_MESSAGE == 250,
-              "MAX_DESCRIPTORS_PER_MESSAGE mismatch!");
-#endif
-
-StaticRefPtr<nsIUUIDGenerator> gUUIDGenerator;
-
-GeckoProcessType gProcessType = GeckoProcessType_Invalid;
-
-void
-CommonStartup()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-
-  gProcessType = XRE_GetProcessType();
-  MOZ_ASSERT(gProcessType != GeckoProcessType_Invalid);
-
-  nsCOMPtr<nsIUUIDGenerator> uuidGen = do_GetService(kUUIDGeneratorContractId);
-  MOZ_RELEASE_ASSERT(uuidGen);
-
-  gUUIDGenerator = uuidGen;
-  ClearOnShutdown(&gUUIDGenerator);
-}
-
-template <class ManagerType>
-struct ConcreteManagerTypeTraits;
-
-template <>
-struct ConcreteManagerTypeTraits<nsIContentChild>
-{
-  typedef ContentChild Type;
-};
-
-template <>
-struct ConcreteManagerTypeTraits<PBackgroundChild>
-{
-  typedef PBackgroundChild Type;
-};
-
-template <>
-struct ConcreteManagerTypeTraits<nsIContentParent>
-{
-  typedef ContentParent Type;
-};
-
-template <>
-struct ConcreteManagerTypeTraits<PBackgroundParent>
-{
-  typedef PBackgroundParent Type;
-};
-
-void
-AssertCorrectThreadForManager(nsIContentChild* aManager)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-}
-
-void
-AssertCorrectThreadForManager(nsIContentParent* aManager)
-{
-  MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
-  MOZ_ASSERT(NS_IsMainThread());
-}
-
-void
-AssertCorrectThreadForManager(PBackgroundChild* aManager)
-{
-#ifdef DEBUG
-  if (aManager) {
-    PBackgroundChild* backgroundChild = BackgroundChild::GetForCurrentThread();
-    MOZ_ASSERT(backgroundChild);
-    MOZ_ASSERT(backgroundChild == aManager);
-  }
-#endif
-}
-
-void
-AssertCorrectThreadForManager(PBackgroundParent* aManager)
-{
-  MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
-  AssertIsOnBackgroundThread();
-}
-
-intptr_t
-ActorManagerProcessID(nsIContentParent* aManager)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  return reinterpret_cast<intptr_t>(aManager);
-}
-
-intptr_t
-ActorManagerProcessID(PBackgroundParent* aManager)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  return BackgroundParent::GetRawContentParentForComparison(aManager);
-}
-
-bool
-ActorManagerIsSameProcess(nsIContentParent* aManager)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  return false;
-}
-
-bool
-ActorManagerIsSameProcess(PBackgroundParent* aManager)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  return !BackgroundParent::IsOtherProcessActor(aManager);
-}
-
-bool
-EventTargetIsOnCurrentThread(nsIEventTarget* aEventTarget)
-{
-  if (!aEventTarget) {
-    return NS_IsMainThread();
-  }
-
-  bool current;
-
-  // If this fails, we are probably shutting down.
-  if (NS_WARN_IF(NS_FAILED(aEventTarget->IsOnCurrentThread(&current)))) {
-    return true;
-  }
-
-  return current;
-}
-
-class CancelableRunnableWrapper final
-  : public CancelableRunnable
-{
-  nsCOMPtr<nsIRunnable> mRunnable;
-#ifdef DEBUG
-  nsCOMPtr<nsIEventTarget> mDEBUGEventTarget;
-#endif
-
-public:
-  CancelableRunnableWrapper(nsIRunnable* aRunnable,
-                            nsIEventTarget* aEventTarget)
-    : mRunnable(aRunnable)
-#ifdef DEBUG
-    , mDEBUGEventTarget(aEventTarget)
-#endif
-  {
-    MOZ_ASSERT(aRunnable);
-    MOZ_ASSERT(aEventTarget);
-  }
-
-  NS_DECL_ISUPPORTS_INHERITED
-
-private:
-  ~CancelableRunnableWrapper() override = default;
-
-  NS_DECL_NSIRUNNABLE
-  nsresult Cancel() override;
-};
-
-NS_IMPL_ISUPPORTS_INHERITED0(CancelableRunnableWrapper, CancelableRunnable)
-
-NS_IMETHODIMP
-CancelableRunnableWrapper::Run()
-{
-  DebugOnly<bool> onTarget;
-  MOZ_ASSERT(mDEBUGEventTarget);
-  MOZ_ASSERT(NS_SUCCEEDED(mDEBUGEventTarget->IsOnCurrentThread(&onTarget)));
-  MOZ_ASSERT(onTarget);
-
-  nsCOMPtr<nsIRunnable> runnable;
-  mRunnable.swap(runnable);
-
-  if (runnable) {
-    return runnable->Run();
-  }
-
-  return NS_OK;
-}
-
-nsresult
-CancelableRunnableWrapper::Cancel()
-{
-  DebugOnly<bool> onTarget;
-  MOZ_ASSERT(mDEBUGEventTarget);
-  MOZ_ASSERT(NS_SUCCEEDED(mDEBUGEventTarget->IsOnCurrentThread(&onTarget)));
-  MOZ_ASSERT(onTarget);
-
-  if (NS_WARN_IF(!mRunnable)) {
-    return NS_ERROR_UNEXPECTED;
-  }
-
-  Unused << Run();
-  MOZ_ASSERT(!mRunnable);
-
-  return NS_OK;
-}
-
-// Ensure that a nsCOMPtr/nsRefPtr is released on the target thread.
-template <template <class> class SmartPtr, class T>
-void
-ReleaseOnTarget(SmartPtr<T>& aDoomed, nsIEventTarget* aTarget)
-{
-  MOZ_ASSERT(aDoomed);
-  MOZ_ASSERT(!EventTargetIsOnCurrentThread(aTarget));
-
-  T* doomedRaw;
-  aDoomed.forget(&doomedRaw);
-
-  auto* doomedSupports = static_cast<nsISupports*>(doomedRaw);
-
-  nsCOMPtr<nsIRunnable> releaseRunnable =
-    NewNonOwningRunnableMethod(doomedSupports, &nsISupports::Release);
-  MOZ_ASSERT(releaseRunnable);
-
-  if (aTarget) {
-    // If we're targeting a non-main thread then make sure the runnable is
-    // cancelable.
-    releaseRunnable = new CancelableRunnableWrapper(releaseRunnable, aTarget);
-
-    MOZ_ALWAYS_SUCCEEDS(aTarget->Dispatch(releaseRunnable,
-                                          NS_DISPATCH_NORMAL));
-  } else {
-    MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(releaseRunnable));
-  }
-}
-
-template <class ManagerType>
-void
-ConstructFileDescriptorSet(ManagerType* aManager,
-                           nsTArray<FileDescriptor>& aFDs,
-                           OptionalFileDescriptorSet& aOptionalFDSet)
-{
-  typedef typename ConcreteManagerTypeTraits<ManagerType>::Type
-          ConcreteManagerType;
-
-  MOZ_ASSERT(aManager);
-
-  if (aFDs.IsEmpty()) {
-    aOptionalFDSet = void_t();
-    return;
-  }
-
-  if (aFDs.Length() <= kMaxFileDescriptorsPerMessage) {
-    aOptionalFDSet = nsTArray<FileDescriptor>();
-    aOptionalFDSet.get_ArrayOfFileDescriptor().SwapElements(aFDs);
-    return;
-  }
-
-  auto* concreteManager = static_cast<ConcreteManagerType*>(aManager);
-
-  PFileDescriptorSetParent* fdSet =
-    concreteManager->SendPFileDescriptorSetConstructor(aFDs[0]);
-  if (!fdSet) {
-    aOptionalFDSet = void_t();
-    return;
-  }
-
-  for (uint32_t index = 1; index < aFDs.Length(); index++) {
-    if (!fdSet->SendAddFileDescriptor(aFDs[index])) {
-      aOptionalFDSet = void_t();
-      return;
-    }
-  }
-
-  aOptionalFDSet = fdSet;
-}
-
-void
-OptionalFileDescriptorSetToFDs(OptionalFileDescriptorSet& aOptionalSet,
-                               nsTArray<FileDescriptor>& aFDs)
-{
-  MOZ_ASSERT(aFDs.IsEmpty());
-
-  switch (aOptionalSet.type()) {
-    case OptionalFileDescriptorSet::Tvoid_t:
-      return;
-
-    case OptionalFileDescriptorSet::TArrayOfFileDescriptor:
-      aOptionalSet.get_ArrayOfFileDescriptor().SwapElements(aFDs);
-      return;
-
-    case OptionalFileDescriptorSet::TPFileDescriptorSetChild: {
-      FileDescriptorSetChild* fdSetActor =
-        static_cast<FileDescriptorSetChild*>(
-          aOptionalSet.get_PFileDescriptorSetChild());
-      MOZ_ASSERT(fdSetActor);
-
-      fdSetActor->ForgetFileDescriptors(aFDs);
-      MOZ_ASSERT(!aFDs.IsEmpty());
-
-      PFileDescriptorSetChild::Send__delete__(fdSetActor);
-      return;
-    }
-
-    default:
-      MOZ_CRASH("Unknown type!");
-  }
-
-  MOZ_CRASH("Should never get here!");
-}
-
-// This class exists to keep a blob alive at least as long as its internal
-// stream.
-class BlobInputStreamTether final
-  : public nsIMultiplexInputStream
-  , public nsISeekableStream
-  , public nsIIPCSerializableInputStream
-  , public nsIFileMetadata
-{
-  nsCOMPtr<nsIInputStream> mStream;
-  RefPtr<BlobImpl> mBlobImpl;
-
-  nsIMultiplexInputStream* mWeakMultiplexStream;
-  nsISeekableStream* mWeakSeekableStream;
-  nsIIPCSerializableInputStream* mWeakSerializableStream;
-  nsIFileMetadata* mWeakFileMetadata;
-
-public:
-  NS_DECL_THREADSAFE_ISUPPORTS
-  NS_FORWARD_NSIINPUTSTREAM(mStream->)
-  NS_FORWARD_SAFE_NSIMULTIPLEXINPUTSTREAM(mWeakMultiplexStream)
-  NS_FORWARD_SAFE_NSISEEKABLESTREAM(mWeakSeekableStream)
-  NS_FORWARD_SAFE_NSIIPCSERIALIZABLEINPUTSTREAM(mWeakSerializableStream)
-  NS_FORWARD_SAFE_NSIFILEMETADATA(mWeakFileMetadata)
-
-  BlobInputStreamTether(nsIInputStream* aStream, BlobImpl* aBlobImpl)
-    : mStream(aStream)
-    , mBlobImpl(aBlobImpl)
-    , mWeakMultiplexStream(nullptr)
-    , mWeakSeekableStream(nullptr)
-    , mWeakSerializableStream(nullptr)
-    , mWeakFileMetadata(nullptr)
-  {
-    MOZ_ASSERT(aStream);
-    MOZ_ASSERT(aBlobImpl);
-
-    nsCOMPtr<nsIMultiplexInputStream> multiplexStream =
-      do_QueryInterface(aStream);
-    if (multiplexStream) {
-      MOZ_ASSERT(SameCOMIdentity(aStream, multiplexStream));
-      mWeakMultiplexStream = multiplexStream;
-    }
-
-    nsCOMPtr<nsISeekableStream> seekableStream = do_QueryInterface(aStream);
-    if (seekableStream) {
-      MOZ_ASSERT(SameCOMIdentity(aStream, seekableStream));
-      mWeakSeekableStream = seekableStream;
-    }
-
-    nsCOMPtr<nsIIPCSerializableInputStream> serializableStream =
-      do_QueryInterface(aStream);
-    if (serializableStream) {
-      MOZ_ASSERT(SameCOMIdentity(aStream, serializableStream));
-      mWeakSerializableStream = serializableStream;
-    }
-
-    nsCOMPtr<nsIFileMetadata> fileMetadata = do_QueryInterface(aStream);
-    if (fileMetadata) {
-      MOZ_ASSERT(SameCOMIdentity(aStream, fileMetadata));
-      mWeakFileMetadata = fileMetadata;
-    }
-  }
-
-private:
-  ~BlobInputStreamTether() = default;
-};
-
-NS_IMPL_ADDREF(BlobInputStreamTether)
-NS_IMPL_RELEASE(BlobInputStreamTether)
-
-NS_INTERFACE_MAP_BEGIN(BlobInputStreamTether)
-  NS_INTERFACE_MAP_ENTRY(nsIInputStream)
-  NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIMultiplexInputStream,
-                                     mWeakMultiplexStream)
-  NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsISeekableStream, mWeakSeekableStream)
-  NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIIPCSerializableInputStream,
-                                     mWeakSerializableStream)
-  NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIFileMetadata,
-                                     mWeakFileMetadata)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIInputStream)
-NS_INTERFACE_MAP_END
-
-} // namespace
-
-class NS_NO_VTABLE IPrivateRemoteInputStream
-  : public nsISupports
-{
-public:
-  NS_DECLARE_STATIC_IID_ACCESSOR(PRIVATE_REMOTE_INPUT_STREAM_IID)
-
-  // This will return the underlying stream.
-  virtual nsIInputStream*
-  BlockAndGetInternalStream() = 0;
-};
-
-NS_DEFINE_STATIC_IID_ACCESSOR(IPrivateRemoteInputStream,
-                              PRIVATE_REMOTE_INPUT_STREAM_IID)
-
-class RemoteInputStream final
-  : public nsIInputStream
-  , public nsISeekableStream
-  , public nsIIPCSerializableInputStream
-  , public nsIFileMetadata
-  , public IPrivateRemoteInputStream
-{
-  Monitor mMonitor;
-  BlobChild* mActor;
-  nsCOMPtr<nsIInputStream> mStream;
-  RefPtr<BlobImpl> mBlobImpl;
-  nsCOMPtr<nsIEventTarget> mEventTarget;
-  nsISeekableStream* mWeakSeekableStream;
-  nsIFileMetadata* mWeakFileMetadata;
-  uint64_t mStart;
-  uint64_t mLength;
-
-public:
-  RemoteInputStream(BlobImpl* aBlobImpl,
-                    uint64_t aStart,
-                    uint64_t aLength);
-
-  RemoteInputStream(BlobChild* aActor,
-                    BlobImpl* aBlobImpl,
-                    uint64_t aStart,
-                    uint64_t aLength);
-
-  bool
-  IsOnOwningThread() const
-  {
-    return EventTargetIsOnCurrentThread(mEventTarget);
-  }
-
-  void
-  AssertIsOnOwningThread() const
-  {
-    MOZ_ASSERT(IsOnOwningThread());
-  }
-
-  bool
-  IsWorkerStream() const
-  {
-    return !!mActor;
-  }
-
-  void
-  SetStream(nsIInputStream* aStream);
-
-  NS_DECL_THREADSAFE_ISUPPORTS
-
-private:
-  ~RemoteInputStream();
-
-  nsresult
-  BlockAndWaitForStream();
-
-  void
-  ReallyBlockAndWaitForStream();
-
-  bool
-  IsSeekableStream();
-
-  bool
-  IsFileMetadata();
-
-  NS_DECL_NSIINPUTSTREAM
-  NS_DECL_NSISEEKABLESTREAM
-  NS_DECL_NSIIPCSERIALIZABLEINPUTSTREAM
-  NS_DECL_NSIFILEMETADATA
-
-  nsIInputStream*
-  BlockAndGetInternalStream() override;
-};
-
-namespace {
-
-struct MOZ_STACK_CLASS CreateBlobImplMetadata final
-{
-  nsString mContentType;
-  nsString mName;
-  uint64_t mLength;
-  int64_t mLastModifiedDate;
-  bool mHasRecursed;
-
-  CreateBlobImplMetadata()
-    : mLength(0)
-    , mLastModifiedDate(0)
-    , mHasRecursed(false)
-  {
-    MOZ_COUNT_CTOR(CreateBlobImplMetadata);
-
-    mName.SetIsVoid(true);
-  }
-
-  ~CreateBlobImplMetadata()
-  {
-    MOZ_COUNT_DTOR(CreateBlobImplMetadata);
-  }
-
-  bool
-  IsFile() const
-  {
-    return !mName.IsVoid();
-  }
-};
-
-} // namespace
-
-already_AddRefed<BlobImpl>
-CreateBlobImpl(const nsID& aKnownBlobIDData,
-               const CreateBlobImplMetadata& aMetadata)
-{
-  MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
-  MOZ_ASSERT(aMetadata.mHasRecursed);
-
-  RefPtr<BlobImpl> blobImpl = BlobParent::GetBlobImplForID(aKnownBlobIDData);
-  if (NS_WARN_IF(!blobImpl)) {
-    ASSERT_UNLESS_FUZZING();
-    return nullptr;
-  }
-
-  DebugOnly<bool> isMutable;
-  MOZ_ASSERT(NS_SUCCEEDED(blobImpl->GetMutable(&isMutable)));
-  MOZ_ASSERT(!isMutable);
-
-  return blobImpl.forget();
-}
-
-already_AddRefed<BlobImpl>
-CreateBlobImpl(const BlobDataStream& aStream,
-               const CreateBlobImplMetadata& aMetadata)
-{
-  MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
-
-  nsCOMPtr<nsIInputStream> inputStream;
-  uint64_t length;
-
-  MOZ_ASSERT(aStream.type() == BlobDataStream::TIPCStream);
-  inputStream = DeserializeIPCStream(aStream.get_IPCStream());
-  if (!inputStream) {
-    ASSERT_UNLESS_FUZZING();
-    return nullptr;
-  }
-
-  nsresult rv = inputStream->Available(&length);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return nullptr;
-  }
-
-  RefPtr<BlobImpl> blobImpl;
-  if (!aMetadata.mHasRecursed && aMetadata.IsFile()) {
-    if (length) {
-      blobImpl =
-        StreamBlobImpl::Create(inputStream,
-                               aMetadata.mName,
-                               aMetadata.mContentType,
-                               aMetadata.mLastModifiedDate,
-                               length);
-    } else {
-      blobImpl =
-        new EmptyBlobImpl(aMetadata.mName,
-                          aMetadata.mContentType,
-                          aMetadata.mLastModifiedDate);
-    }
-  } else if (length) {
-    blobImpl =
-      StreamBlobImpl::Create(inputStream, aMetadata.mContentType,
-                             length);
-  } else {
-    blobImpl = new EmptyBlobImpl(aMetadata.mContentType);
-  }
-
-  MOZ_ALWAYS_SUCCEEDS(blobImpl->SetMutable(false));
-
-  return blobImpl.forget();
-}
-
-already_AddRefed<BlobImpl>
-CreateBlobImpl(const nsTArray<BlobData>& aBlobData,
-               CreateBlobImplMetadata& aMetadata);
-
-already_AddRefed<BlobImpl>
-CreateBlobImplFromBlobData(const BlobData& aBlobData,
-                           CreateBlobImplMetadata& aMetadata)
-{
-  MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
-
-  RefPtr<BlobImpl> blobImpl;
-
-  switch (aBlobData.type()) {
-    case BlobData::TnsID: {
-      blobImpl = CreateBlobImpl(aBlobData.get_nsID(), aMetadata);
-      break;
-    }
-
-    case BlobData::TBlobDataStream: {
-      blobImpl = CreateBlobImpl(aBlobData.get_BlobDataStream(), aMetadata);
-      break;
-    }
-
-    case BlobData::TArrayOfBlobData: {
-      blobImpl = CreateBlobImpl(aBlobData.get_ArrayOfBlobData(), aMetadata);
-      break;
-    }
-
-    default:
-      MOZ_CRASH("Unknown params!");
-  }
-
-  return blobImpl.forget();
-}
-
-already_AddRefed<BlobImpl>
-CreateBlobImpl(const nsTArray<BlobData>& aBlobDatas,
-               CreateBlobImplMetadata& aMetadata)
-{
-  MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
-
-  // Special case for a multipart blob with only one part.
-  if (aBlobDatas.Length() == 1) {
-    const BlobData& blobData = aBlobDatas[0];
-
-    RefPtr<BlobImpl> blobImpl =
-      CreateBlobImplFromBlobData(blobData, aMetadata);
-    if (NS_WARN_IF(!blobImpl)) {
-      return nullptr;
-    }
-
-    DebugOnly<bool> isMutable;
-    MOZ_ASSERT(NS_SUCCEEDED(blobImpl->GetMutable(&isMutable)));
-    MOZ_ASSERT(!isMutable);
-
-    return blobImpl.forget();
-  }
-
-  nsTArray<RefPtr<BlobImpl>> blobImpls;
-  if (NS_WARN_IF(!blobImpls.SetLength(aBlobDatas.Length(), fallible))) {
-    return nullptr;
-  }
-
-  const bool hasRecursed = aMetadata.mHasRecursed;
-  aMetadata.mHasRecursed = true;
-
-  for (uint32_t count = aBlobDatas.Length(), index = 0;
-       index < count;
-       index++) {
-    const BlobData& blobData = aBlobDatas[index];
-    RefPtr<BlobImpl>& blobImpl = blobImpls[index];
-
-    blobImpl = CreateBlobImplFromBlobData(blobData, aMetadata);
-    if (NS_WARN_IF(!blobImpl)) {
-      return nullptr;
-    }
-
-    DebugOnly<bool> isMutable;
-    MOZ_ASSERT(NS_SUCCEEDED(blobImpl->GetMutable(&isMutable)));
-    MOZ_ASSERT(!isMutable);
-  }
-
-  ErrorResult rv;
-  RefPtr<BlobImpl> blobImpl;
-  if (!hasRecursed && aMetadata.IsFile()) {
-    blobImpl = MultipartBlobImpl::Create(Move(blobImpls), aMetadata.mName,
-                                         aMetadata.mContentType, rv);
-  } else {
-    blobImpl = MultipartBlobImpl::Create(Move(blobImpls), aMetadata.mContentType, rv);
-  }
-
-  if (NS_WARN_IF(rv.Failed())) {
-    rv.SuppressException();
-    return nullptr;
-  }
-
-  MOZ_ALWAYS_SUCCEEDS(blobImpl->SetMutable(false));
-
-  return blobImpl.forget();
-}
-
-already_AddRefed<BlobImpl>
-CreateBlobImpl(const ParentBlobConstructorParams& aParams,
-               const BlobData& aBlobData)
-{
-  MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
-  MOZ_ASSERT(aParams.blobParams().type() ==
-               AnyBlobConstructorParams::TNormalBlobConstructorParams ||
-             aParams.blobParams().type() ==
-               AnyBlobConstructorParams::TFileBlobConstructorParams);
-
-  CreateBlobImplMetadata metadata;
-
-  if (aParams.blobParams().type() ==
-        AnyBlobConstructorParams::TNormalBlobConstructorParams) {
-    const NormalBlobConstructorParams& params =
-      aParams.blobParams().get_NormalBlobConstructorParams();
-
-    if (NS_WARN_IF(params.length() == UINT64_MAX)) {
-      ASSERT_UNLESS_FUZZING();
-      return nullptr;
-    }
-
-    metadata.mContentType = params.contentType();
-    metadata.mLength = params.length();
-  } else {
-    const FileBlobConstructorParams& params =
-      aParams.blobParams().get_FileBlobConstructorParams();
-
-    if (NS_WARN_IF(params.length() == UINT64_MAX)) {
-      ASSERT_UNLESS_FUZZING();
-      return nullptr;
-    }
-
-    if (NS_WARN_IF(params.modDate() == INT64_MAX)) {
-      ASSERT_UNLESS_FUZZING();
-      return nullptr;
-    }
-
-    if (NS_WARN_IF(!params.path().IsEmpty())) {
-      ASSERT_UNLESS_FUZZING();
-      return nullptr;
-    }
-
-    metadata.mContentType = params.contentType();
-    metadata.mName = params.name();
-    metadata.mLength = params.length();
-    metadata.mLastModifiedDate = params.modDate();
-  }
-
-  RefPtr<BlobImpl> blobImpl =
-    CreateBlobImplFromBlobData(aBlobData, metadata);
-  return blobImpl.forget();
-}
-
-template <class ChildManagerType>
-bool
-BlobDataFromBlobImpl(ChildManagerType* aManager, BlobImpl* aBlobImpl,
-                     BlobData& aBlobData,
-                     nsTArray<UniquePtr<AutoIPCStream>>& aIPCStreams)
-{
-  MOZ_ASSERT(gProcessType != GeckoProcessType_Default);
-  MOZ_ASSERT(aBlobImpl);
-
-  const nsTArray<RefPtr<BlobImpl>>* subBlobs = aBlobImpl->GetSubBlobImpls();
-
-  if (subBlobs) {
-    MOZ_ASSERT(subBlobs->Length());
-
-    aBlobData = nsTArray<BlobData>();
-
-    nsTArray<BlobData>& subBlobDatas = aBlobData.get_ArrayOfBlobData();
-    subBlobDatas.SetLength(subBlobs->Length());
-
-    for (uint32_t count = subBlobs->Length(), index = 0;
-         index < count;
-         index++) {
-      if (!BlobDataFromBlobImpl(aManager, subBlobs->ElementAt(index),
-                                subBlobDatas[index], aIPCStreams)) {
-        return false;
-      }
-    }
-
-    return true;
-  }
-
-  nsCOMPtr<nsIRemoteBlob> remoteBlob = do_QueryInterface(aBlobImpl);
-  if (remoteBlob) {
-    BlobChild* actor = remoteBlob->GetBlobChild();
-    MOZ_ASSERT(actor);
-
-    aBlobData = actor->ParentID();
-    return true;
-  }
-
-  ErrorResult rv;
-  uint64_t length = aBlobImpl->GetSize(rv);
-  MOZ_ALWAYS_TRUE(!rv.Failed());
-
-  nsCOMPtr<nsIInputStream> inputStream;
-  aBlobImpl->GetInternalStream(getter_AddRefs(inputStream), rv);
-  MOZ_ALWAYS_TRUE(!rv.Failed());
-
-  nsCOMPtr<nsIIPCSerializableInputStream> serializable =
-    do_QueryInterface(inputStream);
-
-  // ExpectedSerializedLength() returns the length of the stream if serialized.
-  // This is useful to decide if we want to continue using the serialization
-  // directly, or if it's better to use IPCStream.
-  uint64_t expectedLength =
-    serializable ? serializable->ExpectedSerializedLength().valueOr(0) : 0;
-
-  // If a stream is known to be larger than 1MB, prefer sending it in chunks.
-  const uint64_t kTooLargeStream = 1024 * 1024;
-  if (serializable && expectedLength < kTooLargeStream) {
-    UniquePtr<AutoIPCStream> autoStream(new AutoIPCStream());
-    autoStream->Serialize(inputStream, aManager);
-    aBlobData = autoStream->TakeValue();
-
-    aIPCStreams.AppendElement(Move(autoStream));
-    return true;
-  }
-
-  return false;
-}
-
-RemoteInputStream::RemoteInputStream(BlobImpl* aBlobImpl,
-                                     uint64_t aStart,
-                                     uint64_t aLength)
-  : mMonitor("RemoteInputStream.mMonitor")
-  , mActor(nullptr)
-  , mBlobImpl(aBlobImpl)
-  , mWeakSeekableStream(nullptr)
-  , mWeakFileMetadata(nullptr)
-  , mStart(aStart)
-  , mLength(aLength)
-{
-  MOZ_ASSERT(aBlobImpl);
-
-  if (!NS_IsMainThread()) {
-    mEventTarget = do_GetCurrentThread();
-    MOZ_ASSERT(mEventTarget);
-  }
-
-  MOZ_ASSERT(IsOnOwningThread());
-}
-
-RemoteInputStream::RemoteInputStream(BlobChild* aActor,
-                                     BlobImpl* aBlobImpl,
-                                     uint64_t aStart,
-                                     uint64_t aLength)
-  : mMonitor("RemoteInputStream.mMonitor")
-  , mActor(aActor)
-  , mBlobImpl(aBlobImpl)
-  , mEventTarget(NS_GetCurrentThread())
-  , mWeakSeekableStream(nullptr)
-  , mWeakFileMetadata(nullptr)
-  , mStart(aStart)
-  , mLength(aLength)
-{
-  MOZ_ASSERT(!NS_IsMainThread());
-  MOZ_ASSERT(aActor);
-  MOZ_ASSERT(aBlobImpl);
-
-  MOZ_ASSERT(IsOnOwningThread());
-}
-
-RemoteInputStream::~RemoteInputStream()
-{
-  if (!IsOnOwningThread()) {
-    mStream = nullptr;
-    mWeakSeekableStream = nullptr;
-    mWeakFileMetadata = nullptr;
-
-    if (mBlobImpl) {
-      ReleaseOnTarget(mBlobImpl, mEventTarget);
-    }
-  }
-}
-
-void
-RemoteInputStream::SetStream(nsIInputStream* aStream)
-{
-  AssertIsOnOwningThread();
-  MOZ_ASSERT(aStream);
-
-  nsCOMPtr<nsIInputStream> stream = aStream;
-  nsCOMPtr<nsISeekableStream> seekableStream = do_QueryInterface(aStream);
-  nsCOMPtr<nsIFileMetadata> fileMetadata = do_QueryInterface(aStream);
-
-  MOZ_ASSERT_IF(seekableStream, SameCOMIdentity(aStream, seekableStream));
-  MOZ_ASSERT_IF(fileMetadata, SameCOMIdentity(aStream, fileMetadata));
-
-  {
-    MonitorAutoLock lock(mMonitor);
-
-    MOZ_ASSERT_IF(mStream, IsWorkerStream());
-
-    if (!mStream) {
-      MOZ_ASSERT(!mWeakSeekableStream);
-      MOZ_ASSERT(!mWeakFileMetadata);
-
-      mStream.swap(stream);
-      mWeakSeekableStream = seekableStream;
-      mWeakFileMetadata = fileMetadata;
-
-      mMonitor.Notify();
-    }
-  }
-}
-
-nsresult
-RemoteInputStream::BlockAndWaitForStream()
-{
-  if (mStream) {
-    return NS_OK;
-  }
-
-  if (IsOnOwningThread()) {
-    if (NS_IsMainThread()) {
-      NS_WARNING("Blocking the main thread is not supported!");
-      return NS_ERROR_FAILURE;
-    }
-
-    MOZ_ASSERT(IsWorkerStream());
-
-    InputStreamParams params;
-    OptionalFileDescriptorSet optionalFDs;
-
-    // This method is broken now...
-
-    nsTArray<FileDescriptor> fds;
-    OptionalFileDescriptorSetToFDs(optionalFDs, fds);
-
-    nsCOMPtr<nsIInputStream> stream =
-      InputStreamHelper::DeserializeInputStream(params, fds);
-    MOZ_ASSERT(stream);
-
-    SetStream(stream);
-    return NS_OK;
-  }
-
-  ReallyBlockAndWaitForStream();
-
-  return NS_OK;
-}
-
-void
-RemoteInputStream::ReallyBlockAndWaitForStream()
-{
-  MOZ_ASSERT(!IsOnOwningThread());
-
-  DebugOnly<bool> waited;
-
-  {
-    MonitorAutoLock lock(mMonitor);
-
-    waited = !mStream;
-
-    while (!mStream) {
-      mMonitor.Wait();
-    }
-  }
-
-  MOZ_ASSERT(mStream);
-
-#ifdef DEBUG
-  if (waited && mWeakSeekableStream) {
-    int64_t position;
-    if (NS_SUCCEEDED(mWeakSeekableStream->Tell(&position))) {
-      MOZ_ASSERT(!position, "Stream not starting at 0!");
-    }
-  }
-#endif
-}
-
-bool
-RemoteInputStream::IsSeekableStream()
-{
-  if (IsOnOwningThread()) {
-    if (!mStream) {
-      NS_WARNING("Don't know if this stream is seekable yet!");
-      return true;
-    }
-  } else {
-    ReallyBlockAndWaitForStream();
-  }
-
-  return !!mWeakSeekableStream;
-}
-
-bool
-RemoteInputStream::IsFileMetadata()
-{
-  if (IsOnOwningThread()) {
-    if (!mStream) {
-      NS_WARNING("Don't know if this stream supports file metadata yet!");
-      return true;
-    }
-  } else {
-    ReallyBlockAndWaitForStream();
-  }
-
-  return !!mWeakFileMetadata;
-}
-
-NS_IMPL_ADDREF(RemoteInputStream)
-NS_IMPL_RELEASE(RemoteInputStream)
-
-NS_INTERFACE_MAP_BEGIN(RemoteInputStream)
-  NS_INTERFACE_MAP_ENTRY(nsIInputStream)
-  NS_INTERFACE_MAP_ENTRY(nsIIPCSerializableInputStream)
-  NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsISeekableStream, IsSeekableStream())
-  NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIFileMetadata, IsFileMetadata())
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIInputStream)
-  NS_INTERFACE_MAP_ENTRY(IPrivateRemoteInputStream)
-NS_INTERFACE_MAP_END
-
-NS_IMETHODIMP
-RemoteInputStream::Close()
-{
-  nsresult rv = BlockAndWaitForStream();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  RefPtr<BlobImpl> blobImpl;
-  mBlobImpl.swap(blobImpl);
-
-  rv = mStream->Close();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-RemoteInputStream::Available(uint64_t* aAvailable)
-{
-  if (!IsOnOwningThread()) {
-    nsresult rv = BlockAndWaitForStream();
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    rv = mStream->Available(aAvailable);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    return NS_OK;
-  }
-
-#ifdef DEBUG
-  if (NS_IsMainThread()) {
-    NS_WARNING("Someone is trying to do main-thread I/O...");
-  }
-#endif
-
-  nsresult rv;
-
-  // See if we already have our real stream.
-  nsCOMPtr<nsIInputStream> inputStream;
-  {
-    MonitorAutoLock lock(mMonitor);
-
-    inputStream = mStream;
-  }
-
-  // If we do then just call through.
-  if (inputStream) {
-    rv = inputStream->Available(aAvailable);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    return NS_OK;
-  }
-
-  // If the stream is already closed then we can't do anything.
-  if (!mBlobImpl) {
-    return NS_BASE_STREAM_CLOSED;
-  }
-
-  // Otherwise fake it...
-  NS_WARNING("Available() called before real stream has been delivered, "
-              "guessing the amount of data available!");
-
-  ErrorResult error;
-  *aAvailable = mBlobImpl->GetSize(error);
-  if (NS_WARN_IF(error.Failed())) {
-    return error.StealNSResult();
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-RemoteInputStream::Read(char* aBuffer, uint32_t aCount, uint32_t* aResult)
-{
-  nsresult rv = BlockAndWaitForStream();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = mStream->Read(aBuffer, aCount, aResult);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-RemoteInputStream::ReadSegments(nsWriteSegmentFun aWriter,
-                                void* aClosure,
-                                uint32_t aCount,
-                                uint32_t* aResult)
-{
-  nsresult rv = BlockAndWaitForStream();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = mStream->ReadSegments(aWriter, aClosure, aCount, aResult);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-RemoteInputStream::IsNonBlocking(bool* aNonBlocking)
-{
-  NS_ENSURE_ARG_POINTER(aNonBlocking);
-
-  *aNonBlocking = false;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-RemoteInputStream::Seek(int32_t aWhence, int64_t aOffset)
-{
-  nsresult rv = BlockAndWaitForStream();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!mWeakSeekableStream) {
-    NS_WARNING("Underlying blob stream is not seekable!");
-    return NS_ERROR_NO_INTERFACE;
-  }
-
-  rv = mWeakSeekableStream->Seek(aWhence, aOffset);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-RemoteInputStream::Tell(int64_t* aResult)
-{
-  // We can cheat here and assume that we're going to start at 0 if we don't yet
-  // have our stream. Though, really, this should abort since most input streams
-  // could block here.
-  if (IsOnOwningThread() && !mStream) {
-    *aResult = 0;
-    return NS_OK;
-  }
-
-  nsresult rv = BlockAndWaitForStream();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!mWeakSeekableStream) {
-    NS_WARNING("Underlying blob stream is not seekable!");
-    return NS_ERROR_NO_INTERFACE;
-  }
-
-  rv = mWeakSeekableStream->Tell(aResult);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-RemoteInputStream::SetEOF()
-{
-  nsresult rv = BlockAndWaitForStream();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!mWeakSeekableStream) {
-    NS_WARNING("Underlying blob stream is not seekable!");
-    return NS_ERROR_NO_INTERFACE;
-  }
-
-  rv = mWeakSeekableStream->SetEOF();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return NS_OK;
-}
-
-void
-RemoteInputStream::Serialize(InputStreamParams& aParams,
-                             FileDescriptorArray& /* aFDs */)
-{
-  MOZ_RELEASE_ASSERT(mBlobImpl);
-
-  nsCOMPtr<nsIRemoteBlob> remote = do_QueryInterface(mBlobImpl);
-  MOZ_ASSERT(remote);
-
-  BlobChild* actor = remote->GetBlobChild();
-  MOZ_ASSERT(actor);
-
-  aParams = RemoteInputStreamParams(actor->ParentID());
-}
-
-bool
-RemoteInputStream::Deserialize(const InputStreamParams& /* aParams */,
-                               const FileDescriptorArray& /* aFDs */)
-{
-  // See InputStreamUtils.cpp to see how deserialization of a
-  // RemoteInputStream is special-cased.
-  MOZ_CRASH("RemoteInputStream should never be deserialized");
-}
-
-NS_IMETHODIMP
-RemoteInputStream::GetSize(int64_t* aSize)
-{
-  nsresult rv = BlockAndWaitForStream();
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  if (!mWeakFileMetadata) {
-    NS_WARNING("Underlying blob stream doesn't support file metadata!");
-    return NS_ERROR_NO_INTERFACE;
-  }
-
-  rv = mWeakFileMetadata->GetSize(aSize);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-RemoteInputStream::GetLastModified(int64_t* aLastModified)
-{
-  nsresult rv = BlockAndWaitForStream();
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  if (!mWeakFileMetadata) {
-    NS_WARNING("Underlying blob stream doesn't support file metadata!");
-    return NS_ERROR_NO_INTERFACE;
-  }
-
-  rv = mWeakFileMetadata->GetLastModified(aLastModified);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-RemoteInputStream::GetFileDescriptor(PRFileDesc** aFileDescriptor)
-{
-  nsresult rv = BlockAndWaitForStream();
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  if (!mWeakFileMetadata) {
-    NS_WARNING("Underlying blob stream doesn't support file metadata!");
-    return NS_ERROR_NO_INTERFACE;
-  }
-
-  rv = mWeakFileMetadata->GetFileDescriptor(aFileDescriptor);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  return NS_OK;
-}
-
-Maybe<uint64_t>
-RemoteInputStream::ExpectedSerializedLength()
-{
-  return Nothing();
-}
-
-nsIInputStream*
-RemoteInputStream::BlockAndGetInternalStream()
-{
-  MOZ_ASSERT(!IsOnOwningThread());
-
-  nsresult rv = BlockAndWaitForStream();
-  NS_ENSURE_SUCCESS(rv, nullptr);
-
-  return mStream;
-}
-
-StaticAutoPtr<BlobParent::IDTable> BlobParent::sIDTable;
-StaticAutoPtr<Mutex> BlobParent::sIDTableMutex;
-
-/*******************************************************************************
- * BlobParent::IDTableEntry Declaration
- ******************************************************************************/
-
-class BlobParent::IDTableEntry final
-{
-  const nsID mID;
-  const intptr_t mProcessID;
-  const RefPtr<BlobImpl> mBlobImpl;
-
-public:
-  static already_AddRefed<IDTableEntry>
-  Create(const nsID& aID, intptr_t aProcessID, BlobImpl* aBlobImpl)
-  {
-    MOZ_ASSERT(aBlobImpl);
-
-    DebugOnly<bool> isMutable;
-    MOZ_ASSERT(NS_SUCCEEDED(aBlobImpl->GetMutable(&isMutable)));
-    MOZ_ASSERT(!isMutable);
-
-    return GetOrCreateInternal(aID,
-                               aProcessID,
-                               aBlobImpl,
-                               /* aMayCreate */ true,
-                               /* aMayGet */ false,
-                               /* aIgnoreProcessID */ false);
-  }
-
-  static already_AddRefed<IDTableEntry>
-  Get(const nsID& aID, intptr_t aProcessID)
-  {
-    return GetOrCreateInternal(aID,
-                               aProcessID,
-                               nullptr,
-                               /* aMayCreate */ false,
-                               /* aMayGet */ true,
-                               /* aIgnoreProcessID */ false);
-  }
-
-  static already_AddRefed<IDTableEntry>
-  Get(const nsID& aID)
-  {
-    return GetOrCreateInternal(aID,
-                               0,
-                               nullptr,
-                               /* aMayCreate */ false,
-                               /* aMayGet */ true,
-                               /* aIgnoreProcessID */ true);
-  }
-
-  static already_AddRefed<IDTableEntry>
-  GetOrCreate(const nsID& aID, intptr_t aProcessID, BlobImpl* aBlobImpl)
-  {
-    MOZ_ASSERT(aBlobImpl);
-
-    DebugOnly<bool> isMutable;
-    MOZ_ASSERT(NS_SUCCEEDED(aBlobImpl->GetMutable(&isMutable)));
-    MOZ_ASSERT(!isMutable);
-
-    return GetOrCreateInternal(aID,
-                               aProcessID,
-                               aBlobImpl,
-                               /* aMayCreate */ true,
-                               /* aMayGet */ true,
-                               /* aIgnoreProcessID */ false);
-  }
-
-  const nsID&
-  ID() const
-  {
-    return mID;
-  }
-
-  intptr_t
-  ProcessID() const
-  {
-    return mProcessID;
-  }
-
-  BlobImpl*
-  GetBlobImpl() const
-  {
-    return mBlobImpl;
-  }
-
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(IDTableEntry)
-
-private:
-  IDTableEntry(const nsID& aID, intptr_t aProcessID, BlobImpl* aBlobImpl);
-  ~IDTableEntry();
-
-  static already_AddRefed<IDTableEntry>
-  GetOrCreateInternal(const nsID& aID,
-                      intptr_t aProcessID,
-                      BlobImpl* aBlobImpl,
-                      bool aMayCreate,
-                      bool aMayGet,
-                      bool aIgnoreProcessID);
-};
-
-/*******************************************************************************
- * BlobChild::RemoteBlobImpl Declaration
- ******************************************************************************/
-
-class BlobChild::RemoteBlobImpl
-  : public BaseBlobImpl
-  , public nsIRemoteBlob
-{
-protected:
-  class WorkerHolder;
-
-  BlobChild* mActor;
-  nsCOMPtr<nsIEventTarget> mActorTarget;
-
-  // These member variables are protected by mutex and it's set to null when the
-  // worker goes away.
-  WorkerPrivate* mWorkerPrivate;
-  nsAutoPtr<WorkerHolder> mWorkerHolder;
-  Mutex mMutex;
-
-  // We use this pointer to keep a live a blobImpl coming from a different
-  // process until this one is fully created. We set it to null when
-  // SendCreatedFromKnownBlob() is received. This is used only with KnownBlob
-  // params in the CTOR of a IPC BlobImpl.
-  RefPtr<BlobImpl> mDifferentProcessBlobImpl;
-
-  RefPtr<BlobImpl> mSameProcessBlobImpl;
-
-  const bool mIsSlice;
-
-  const bool mIsDirectory;
-
-public:
-
-  enum BlobImplIsDirectory
-  {
-    eNotDirectory,
-    eDirectory
-  };
-
-  // For File.
-  RemoteBlobImpl(BlobChild* aActor,
-                 BlobImpl* aRemoteBlobImpl,
-                 const nsAString& aName,
-                 const nsAString& aContentType,
-                 const nsAString& aPath,
-                 uint64_t aLength,
-                 int64_t aModDate,
-                 BlobImplIsDirectory aIsDirectory,
-                 bool aIsSameProcessBlob);
-
-  // For Blob.
-  RemoteBlobImpl(BlobChild* aActor,
-                 BlobImpl* aRemoteBlobImpl,
-                 const nsAString& aContentType,
-                 uint64_t aLength,
-                 bool aIsSameProcessBlob);
-
-  // For mystery blobs.
-  explicit
-  RemoteBlobImpl(BlobChild* aActor);
-
-  void
-  NoteDyingActor();
-
-  BlobChild*
-  GetActor() const
-  {
-    MOZ_ASSERT(ActorEventTargetIsOnCurrentThread());
-
-    return mActor;
-  }
-
-  nsIEventTarget*
-  GetActorEventTarget() const
-  {
-    return mActorTarget;
-  }
-
-  bool
-  ActorEventTargetIsOnCurrentThread() const
-  {
-    return EventTargetIsOnCurrentThread(BaseRemoteBlobImpl()->mActorTarget);
-  }
-
-  bool
-  IsSlice() const
-  {
-    return mIsSlice;
-  }
-
-  RemoteBlobSliceImpl*
-  AsSlice() const;
-
-  RemoteBlobImpl*
-  BaseRemoteBlobImpl() const;
-
-  NS_DECL_ISUPPORTS_INHERITED
-
-  void
-  GetMozFullPathInternal(nsAString& aFileName, ErrorResult& aRv) const override;
-
-  bool
-  IsDirectory() const override;
-
-  already_AddRefed<BlobImpl>
-  CreateSlice(uint64_t aStart,
-              uint64_t aLength,
-              const nsAString& aContentType,
-              ErrorResult& aRv) override;
-
-  void
-  GetInternalStream(nsIInputStream** aStream, ErrorResult& aRv) override;
-
-  int64_t
-  GetFileId() override;
-
-  int64_t
-  GetLastModified(ErrorResult& aRv) override;
-
-  void
-  SetLastModified(int64_t aLastModified) override;
-
-  nsresult
-  SetMutable(bool aMutable) override;
-
-  BlobChild*
-  GetBlobChild() override;
-
-  BlobParent*
-  GetBlobParent() override;
-
-  void
-  NullifyDifferentProcessBlobImpl()
-  {
-    MOZ_ASSERT(mDifferentProcessBlobImpl);
-    mDifferentProcessBlobImpl = nullptr;
-  }
-
-  void
-  WorkerHasNotified();
-
-protected:
-  // For SliceImpl.
-  RemoteBlobImpl(const nsAString& aContentType, uint64_t aLength);
-
-  ~RemoteBlobImpl() override
-  {
-    MOZ_ASSERT_IF(mActorTarget,
-                  EventTargetIsOnCurrentThread(mActorTarget));
-  }
-
-  void
-  CommonInit(BlobChild* aActor);
-
-  void
-  Destroy();
-};
-
-class BlobChild::RemoteBlobImpl::WorkerHolder final
-  : public workers::WorkerHolder
-{
-  // Raw pointer because this class is kept alive by the mRemoteBlobImpl.
-  RemoteBlobImpl* mRemoteBlobImpl;
-
-public:
-  explicit WorkerHolder(RemoteBlobImpl* aRemoteBlobImpl)
-    : mRemoteBlobImpl(aRemoteBlobImpl)
-  {
-    MOZ_ASSERT(aRemoteBlobImpl);
-  }
-
-  bool Notify(Status aStatus) override
-  {
-    mRemoteBlobImpl->WorkerHasNotified();
-    return true;
-  }
-};
-
-class BlobChild::RemoteBlobSliceImpl final
-  : public RemoteBlobImpl
-{
-  RefPtr<RemoteBlobImpl> mParent;
-  bool mActorWasCreated;
-
-public:
-  RemoteBlobSliceImpl(RemoteBlobImpl* aParent,
-                      uint64_t aStart,
-                      uint64_t aLength,
-                      const nsAString& aContentType);
-
-  RemoteBlobImpl*
-  Parent() const
-  {
-    MOZ_ASSERT(mParent);
-
-    return const_cast<RemoteBlobImpl*>(mParent.get());
-  }
-
-  uint64_t
-  Start() const
-  {
-    return mStart;
-  }
-
-  void
-  EnsureActorWasCreated()
-  {
-    MOZ_ASSERT_IF(!ActorEventTargetIsOnCurrentThread(),
-                  mActorWasCreated);
-
-    if (!mActorWasCreated) {
-      EnsureActorWasCreatedInternal();
-    }
-  }
-
-  NS_DECL_ISUPPORTS_INHERITED
-
-  BlobChild*
-  GetBlobChild() override;
-
-private:
-  ~RemoteBlobSliceImpl() override = default;
-
-  void
-  EnsureActorWasCreatedInternal();
-};
-
-/*******************************************************************************
- * BlobParent::RemoteBlobImpl Declaration
- ******************************************************************************/
-
-class BlobParent::RemoteBlobImpl final
-  : public BlobImpl
-  , public nsIRemoteBlob
-{
-  BlobParent* mActor;
-  nsCOMPtr<nsIEventTarget> mActorTarget;
-  RefPtr<BlobImpl> mBlobImpl;
-
-public:
-  RemoteBlobImpl(BlobParent* aActor, BlobImpl* aBlobImpl);
-
-  void
-  NoteDyingActor();
-
-  NS_DECL_ISUPPORTS_INHERITED
-
-  void
-  GetName(nsAString& aName) const override;
-
-  void
-  GetDOMPath(nsAString& aPath) const override;
-
-  void
-  SetDOMPath(const nsAString& aPath) override;
-
-  int64_t
-  GetLastModified(ErrorResult& aRv) override;
-
-  void
-  SetLastModified(int64_t aLastModified) override;
-
-  void
-  GetMozFullPath(nsAString& aName, SystemCallerGuarantee aGuarantee,
-                 ErrorResult& aRv) const override;
-
-  void
-  GetMozFullPathInternal(nsAString& aFileName, ErrorResult& aRv) const override;
-
-  bool
-  IsDirectory() const override;
-
-  uint64_t
-  GetSize(ErrorResult& aRv) override;
-
-  void
-  GetType(nsAString& aType) override;
-
-  uint64_t
-  GetSerialNumber() const override;
-
-  already_AddRefed<BlobImpl>
-  CreateSlice(uint64_t aStart,
-              uint64_t aLength,
-              const nsAString& aContentType,
-              ErrorResult& aRv) override;
-
-  const nsTArray<RefPtr<BlobImpl>>*
-  GetSubBlobImpls() const override;
-
-  void
-  GetInternalStream(nsIInputStream** aStream, ErrorResult& aRv) override;
-
-  int64_t
-  GetFileId() override;
-
-  nsresult
-  GetSendInfo(nsIInputStream** aBody,
-              uint64_t* aContentLength,
-              nsACString& aContentType,
-              nsACString& aCharset) override;
-
-  nsresult
-  GetMutable(bool* aMutable) const override;
-
-  nsresult
-  SetMutable(bool aMutable) override;
-
-  void
-  SetLazyData(const nsAString& aName,
-              const nsAString& aContentType,
-              uint64_t aLength,
-              int64_t aLastModifiedDate) override;
-
-  bool
-  IsMemoryFile() const override;
-
-  bool
-  IsSizeUnknown() const override;
-
-  bool
-  IsDateUnknown() const override;
-
-  bool
-  IsFile() const override;
-
-  bool
-  MayBeClonedToOtherThreads() const override;
-
-  BlobChild*
-  GetBlobChild() override;
-
-  BlobParent*
-  GetBlobParent() override;
-
-private:
-  ~RemoteBlobImpl() override
-  {
-    MOZ_ASSERT_IF(mActorTarget,
-                  EventTargetIsOnCurrentThread(mActorTarget));
-  }
-
-  void
-  Destroy();
-};
-
-/*******************************************************************************
- * BlobChild::RemoteBlobImpl
- ******************************************************************************/
-
-BlobChild::
-RemoteBlobImpl::RemoteBlobImpl(BlobChild* aActor,
-                               BlobImpl* aRemoteBlobImpl,
-                               const nsAString& aName,
-                               const nsAString& aContentType,
-                               const nsAString& aDOMPath,
-                               uint64_t aLength,
-                               int64_t aModDate,
-                               BlobImplIsDirectory aIsDirectory,
-                               bool aIsSameProcessBlob)
-  : BaseBlobImpl(aName, aContentType, aLength, aModDate)
-  , mWorkerPrivate(nullptr)
-  , mMutex("BlobChild::RemoteBlobImpl::mMutex")
-  , mIsSlice(false), mIsDirectory(aIsDirectory == eDirectory)
-{
-  SetDOMPath(aDOMPath);
-
-  if (aIsSameProcessBlob) {
-    MOZ_ASSERT(aRemoteBlobImpl);
-    mSameProcessBlobImpl = aRemoteBlobImpl;
-    MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
-  } else {
-    mDifferentProcessBlobImpl = aRemoteBlobImpl;
-  }
-
-  CommonInit(aActor);
-}
-
-BlobChild::
-RemoteBlobImpl::RemoteBlobImpl(BlobChild* aActor,
-                               BlobImpl* aRemoteBlobImpl,
-                               const nsAString& aContentType,
-                               uint64_t aLength,
-                               bool aIsSameProcessBlob)
-  : BaseBlobImpl(aContentType, aLength)
-  , mWorkerPrivate(nullptr)
-  , mMutex("BlobChild::RemoteBlobImpl::mMutex")
-  , mIsSlice(false), mIsDirectory(false)
-{
-  if (aIsSameProcessBlob) {
-    MOZ_ASSERT(aRemoteBlobImpl);
-    mSameProcessBlobImpl = aRemoteBlobImpl;
-    MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
-  } else {
-    mDifferentProcessBlobImpl = aRemoteBlobImpl;
-  }
-
-  CommonInit(aActor);
-}
-
-BlobChild::
-RemoteBlobImpl::RemoteBlobImpl(BlobChild* aActor)
-  : BaseBlobImpl(EmptyString(), EmptyString(), UINT64_MAX, INT64_MAX)
-  , mWorkerPrivate(nullptr)
-  , mMutex("BlobChild::RemoteBlobImpl::mMutex")
-  , mIsSlice(false), mIsDirectory(false)
-{
-  CommonInit(aActor);
-}
-
-BlobChild::
-RemoteBlobImpl::RemoteBlobImpl(const nsAString& aContentType, uint64_t aLength)
-  : BaseBlobImpl(aContentType, aLength)
-  , mActor(nullptr)
-  , mWorkerPrivate(nullptr)
-  , mMutex("BlobChild::RemoteBlobImpl::mMutex")
-  , mIsSlice(true)
-  , mIsDirectory(false)
-{
-  mImmutable = true;
-}
-
-void
-BlobChild::
-RemoteBlobImpl::CommonInit(BlobChild* aActor)
-{
-  MOZ_ASSERT(aActor);
-  aActor->AssertIsOnOwningThread();
-
-  mActor = aActor;
-  mActorTarget = aActor->EventTarget();
-
-  if (!NS_IsMainThread()) {
-    mWorkerPrivate = GetCurrentThreadWorkerPrivate();
-    // We must comunicate via IPC in the owning thread, so, if this BlobImpl has
-    // been created on a Workerr and then it's sent to a different thread (for
-    // instance the main-thread), we still need to keep alive that Worker.
-    if (mWorkerPrivate) {
-      mWorkerHolder = new RemoteBlobImpl::WorkerHolder(this);
-      if (NS_WARN_IF(!mWorkerHolder->HoldWorker(mWorkerPrivate, Closing))) {
-        // We don't care too much if the worker is already going away because no
-        // sync-event-loop can be created at this point.
-        mWorkerPrivate = nullptr;
-        mWorkerHolder = nullptr;
-      }
-    }
-  }
-
-  mImmutable = true;
-}
-
-void
-BlobChild::
-RemoteBlobImpl::NoteDyingActor()
-{
-  MOZ_ASSERT(mActor);
-  mActor->AssertIsOnOwningThread();
-
-  mActor = nullptr;
-}
-
-BlobChild::RemoteBlobSliceImpl*
-BlobChild::
-RemoteBlobImpl::AsSlice() const
-{
-  MOZ_ASSERT(IsSlice());
-
-  return static_cast<RemoteBlobSliceImpl*>(const_cast<RemoteBlobImpl*>(this));
-}
-
-BlobChild::RemoteBlobImpl*
-BlobChild::
-RemoteBlobImpl::BaseRemoteBlobImpl() const
-{
-  if (IsSlice()) {
-    return AsSlice()->Parent()->BaseRemoteBlobImpl();
-  }
-
-  return const_cast<RemoteBlobImpl*>(this);
-}
-
-void
-BlobChild::
-RemoteBlobImpl::Destroy()
-{
-  if (EventTargetIsOnCurrentThread(mActorTarget)) {
-    if (mActor) {
-      mActor->AssertIsOnOwningThread();
-      mActor->NoteDyingRemoteBlobImpl();
-    }
-
-    if (mWorkerHolder) {
-      // We are in the worker thread.
-      MutexAutoLock lock(mMutex);
-      mWorkerPrivate = nullptr;
-      mWorkerHolder = nullptr;
-    }
-
-    delete this;
-    return;
-  }
-
-  nsCOMPtr<nsIRunnable> destroyRunnable =
-    NewNonOwningRunnableMethod(this, &RemoteBlobImpl::Destroy);
-
-  if (mActorTarget) {
-    destroyRunnable =
-      new CancelableRunnableWrapper(destroyRunnable, mActorTarget);
-
-    MOZ_ALWAYS_SUCCEEDS(mActorTarget->Dispatch(destroyRunnable,
-                                               NS_DISPATCH_NORMAL));
-  } else {
-    MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(destroyRunnable));
-  }
-}
-
-NS_IMPL_ADDREF(BlobChild::RemoteBlobImpl)
-NS_IMPL_RELEASE_WITH_DESTROY(BlobChild::RemoteBlobImpl, Destroy())
-NS_IMPL_QUERY_INTERFACE_INHERITED(BlobChild::RemoteBlobImpl,
-                                  BlobImpl,
-                                  nsIRemoteBlob)
-
-void
-BlobChild::
-RemoteBlobImpl::GetMozFullPathInternal(nsAString& aFilePath,
-                                       ErrorResult& aRv) const
-{
-  if (!EventTargetIsOnCurrentThread(mActorTarget)) {
-    MOZ_CRASH("Not implemented!");
-  }
-
-  if (mSameProcessBlobImpl) {
-    MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
-
-    mSameProcessBlobImpl->GetMozFullPathInternal(aFilePath, aRv);
-    return;
-  }
-
-  if (!mActor) {
-    aRv.Throw(NS_ERROR_UNEXPECTED);
-    return;
-  }
-
-  nsString filePath;
-  if (!mActor->SendGetFilePath(&filePath)) {
-    aRv.Throw(NS_ERROR_FAILURE);
-    return;
-  }
-
-  aFilePath = filePath;
-}
-
-bool
-BlobChild::
-RemoteBlobImpl::IsDirectory() const
-{
-  return mIsDirectory;
-}
-
-already_AddRefed<BlobImpl>
-BlobChild::
-RemoteBlobImpl::CreateSlice(uint64_t aStart,
-                            uint64_t aLength,
-                            const nsAString& aContentType,
-                            ErrorResult& aRv)
-{
-  // May be called on any thread.
-  if (mSameProcessBlobImpl) {
-    MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
-
-    return mSameProcessBlobImpl->CreateSlice(aStart,
-                                             aLength,
-                                             aContentType,
-                                             aRv);
-  }
-
-  RefPtr<RemoteBlobSliceImpl> slice =
-    new RemoteBlobSliceImpl(this, aStart, aLength, aContentType);
-  return slice.forget();
-}
-
-void
-BlobChild::
-RemoteBlobImpl::GetInternalStream(nsIInputStream** aStream, ErrorResult& aRv)
-{
-  // May be called on any thread.
-  if (mSameProcessBlobImpl) {
-    MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
-
-    nsCOMPtr<nsIInputStream> realStream;
-    mSameProcessBlobImpl->GetInternalStream(getter_AddRefs(realStream), aRv);
-    if (NS_WARN_IF(aRv.Failed())) {
-      return;
-    }
-
-    RefPtr<BlobInputStreamTether> tether =
-      new BlobInputStreamTether(realStream, mSameProcessBlobImpl);
-    tether.forget(aStream);
-    return;
-  }
-
-  // Broken method...
-}
-
-int64_t
-BlobChild::
-RemoteBlobImpl::GetFileId()
-{
-  if (!EventTargetIsOnCurrentThread(mActorTarget)) {
-    MOZ_CRASH("Not implemented!");
-  }
-
-  if (mSameProcessBlobImpl) {
-    MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
-
-    return mSameProcessBlobImpl->GetFileId();
-  }
-
-  int64_t fileId;
-  if (mActor && mActor->SendGetFileId(&fileId)) {
-    return fileId;
-  }
-
-  return -1;
-}
-
-int64_t
-BlobChild::
-RemoteBlobImpl::GetLastModified(ErrorResult& aRv)
-{
-  if (IsDateUnknown()) {
-    return 0;
-  }
-
-  return mLastModificationDate;
-}
-
-void
-BlobChild::
-RemoteBlobImpl::SetLastModified(int64_t aLastModified)
-{
-  MOZ_CRASH("SetLastModified of a remote blob is not allowed!");
-}
-
-nsresult
-BlobChild::
-RemoteBlobImpl::SetMutable(bool aMutable)
-{
-  if (!aMutable && IsSlice()) {
-    // Make sure that slices are backed by a real actor now while we are still
-    // on the correct thread.
-    AsSlice()->EnsureActorWasCreated();
-  }
-
-  nsresult rv = BaseBlobImpl::SetMutable(aMutable);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  MOZ_ASSERT_IF(!aMutable, mImmutable);
-
-  return NS_OK;
-}
-
-BlobChild*
-BlobChild::
-RemoteBlobImpl::GetBlobChild()
-{
-  return mActor;
-}
-
-BlobParent*
-BlobChild::
-RemoteBlobImpl::GetBlobParent()
-{
-  return nullptr;
-}
-
-class RemoteBlobControlRunnable : public WorkerControlRunnable
-{
-  nsCOMPtr<nsIRunnable> mRunnable;
-
-public:
-  RemoteBlobControlRunnable(WorkerPrivate* aWorkerPrivate,
-                            nsIRunnable* aRunnable)
-    : WorkerControlRunnable(aWorkerPrivate, WorkerThreadUnchangedBusyCount)
-    , mRunnable(aRunnable)
-  {
-    MOZ_ASSERT(aRunnable);
-  }
-
-  bool
-  WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override
-  {
-    mRunnable->Run();
-    return true;
-  }
-};
-
-void
-BlobChild::
-RemoteBlobImpl::WorkerHasNotified()
-{
-  MutexAutoLock lock(mMutex);
-
-  mWorkerHolder->ReleaseWorker();
-
-  mWorkerHolder = nullptr;
-  mWorkerPrivate = nullptr;
-}
-
-/*******************************************************************************
- * BlobChild::RemoteBlobSliceImpl
- ******************************************************************************/
-
-BlobChild::
-RemoteBlobSliceImpl::RemoteBlobSliceImpl(RemoteBlobImpl* aParent,
-                                         uint64_t aStart,
-                                         uint64_t aLength,
-                                         const nsAString& aContentType)
-  : RemoteBlobImpl(aContentType, aLength)
-  , mParent(aParent->BaseRemoteBlobImpl())
-  , mActorWasCreated(false)
-{
-  MOZ_ASSERT(mParent);
-  MOZ_ASSERT(mParent->BaseRemoteBlobImpl() == mParent);
-
-  DebugOnly<bool> isMutable;
-  MOZ_ASSERT(NS_SUCCEEDED(aParent->GetMutable(&isMutable)));
-  MOZ_ASSERT(!isMutable);
-
-#ifdef DEBUG
-  {
-    ErrorResult rv;
-    uint64_t parentSize = aParent->GetSize(rv);
-    MOZ_ASSERT(!rv.Failed());
-    MOZ_ASSERT(parentSize >= aStart + aLength);
-  }
-#endif
-
-  // Account for the offset of the parent slice, if any.
-  mStart = aParent->IsSlice() ? aParent->AsSlice()->mStart + aStart : aStart;
-}
-
-void
-BlobChild::
-RemoteBlobSliceImpl::EnsureActorWasCreatedInternal()
-{
-  MOZ_ASSERT(ActorEventTargetIsOnCurrentThread());
-  MOZ_ASSERT(!mActorWasCreated);
-
-  mActorWasCreated = true;
-
-  BlobChild* baseActor = mParent->GetActor();
-  MOZ_ASSERT(baseActor);
-  MOZ_ASSERT(baseActor->HasManager());
-
-  nsID id;
-  MOZ_ALWAYS_SUCCEEDS(gUUIDGenerator->GenerateUUIDInPlace(&id));
-
-  ParentBlobConstructorParams params(
-    SlicedBlobConstructorParams(nullptr /* sourceParent */,
-                                baseActor /* sourceChild */,
-                                id /* id */,
-                                mStart /* begin */,
-                                mStart + mLength /* end */,
-                                mContentType /* contentType */));
-
-  BlobChild* actor;
-
-  if (nsIContentChild* contentManager = baseActor->GetContentManager()) {
-    actor = SendSliceConstructor(contentManager, this, params);
-  } else {
-    actor =
-      SendSliceConstructor(baseActor->GetBackgroundManager(), this, params);
-  }
-
-  CommonInit(actor);
-}
-
-NS_IMPL_ISUPPORTS_INHERITED0(BlobChild::RemoteBlobSliceImpl,
-                             BlobChild::RemoteBlobImpl)
-
-BlobChild*
-BlobChild::
-RemoteBlobSliceImpl::GetBlobChild()
-{
-  EnsureActorWasCreated();
-
-  return RemoteBlobImpl::GetBlobChild();
-}
-
-/*******************************************************************************
- * BlobParent::RemoteBlobImpl
- ******************************************************************************/
-
-BlobParent::
-RemoteBlobImpl::RemoteBlobImpl(BlobParent* aActor, BlobImpl* aBlobImpl)
-  : mActor(aActor)
-  , mActorTarget(aActor->EventTarget())
-  , mBlobImpl(aBlobImpl)
-{
-  MOZ_ASSERT(aActor);
-  aActor->AssertIsOnOwningThread();
-  MOZ_ASSERT(aBlobImpl);
-
-  DebugOnly<bool> isMutable;
-  MOZ_ASSERT(NS_SUCCEEDED(aBlobImpl->GetMutable(&isMutable)));
-  MOZ_ASSERT(!isMutable);
-}
-
-void
-BlobParent::
-RemoteBlobImpl::NoteDyingActor()
-{
-  MOZ_ASSERT(mActor);
-  mActor->AssertIsOnOwningThread();
-
-  mActor = nullptr;
-}
-
-void
-BlobParent::
-RemoteBlobImpl::Destroy()
-{
-  if (EventTargetIsOnCurrentThread(mActorTarget)) {
-    if (mActor) {
-      mActor->AssertIsOnOwningThread();
-      mActor->NoteDyingRemoteBlobImpl();
-    }
-
-    delete this;
-    return;
-  }
-
-  nsCOMPtr<nsIRunnable> destroyRunnable =
-    NewNonOwningRunnableMethod(this, &RemoteBlobImpl::Destroy);
-
-  if (mActorTarget) {
-    destroyRunnable =
-      new CancelableRunnableWrapper(destroyRunnable, mActorTarget);
-
-    MOZ_ALWAYS_SUCCEEDS(mActorTarget->Dispatch(destroyRunnable,
-                                               NS_DISPATCH_NORMAL));
-  } else {
-    MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(destroyRunnable));
-  }
-}
-
-NS_IMPL_ADDREF(BlobParent::RemoteBlobImpl)
-NS_IMPL_RELEASE_WITH_DESTROY(BlobParent::RemoteBlobImpl, Destroy())
-NS_IMPL_QUERY_INTERFACE_INHERITED(BlobParent::RemoteBlobImpl,
-                                  BlobImpl,
-                                  nsIRemoteBlob)
-
-void
-BlobParent::
-RemoteBlobImpl::GetName(nsAString& aName) const
-{
-  mBlobImpl->GetName(aName);
-}
-
-void
-BlobParent::
-RemoteBlobImpl::GetDOMPath(nsAString& aPath) const
-{
-  mBlobImpl->GetDOMPath(aPath);
-}
-
-void
-BlobParent::
-RemoteBlobImpl::SetDOMPath(const nsAString& aPath)
-{
-  mBlobImpl->SetDOMPath(aPath);
-}
-
-int64_t
-BlobParent::
-RemoteBlobImpl::GetLastModified(ErrorResult& aRv)
-{
-  return mBlobImpl->GetLastModified(aRv);
-}
-
-void
-BlobParent::
-RemoteBlobImpl::SetLastModified(int64_t aLastModified)
-{
-  MOZ_CRASH("SetLastModified of a remote blob is not allowed!");
-}
-
-void
-BlobParent::
-RemoteBlobImpl::GetMozFullPath(nsAString& aName,
-                               SystemCallerGuarantee aGuarantee,
-                               ErrorResult& aRv) const
-{
-  mBlobImpl->GetMozFullPath(aName, aGuarantee, aRv);
-}
-
-void
-BlobParent::
-RemoteBlobImpl::GetMozFullPathInternal(nsAString& aFileName, ErrorResult& aRv) const
-{
-  mBlobImpl->GetMozFullPathInternal(aFileName, aRv);
-}
-
-bool
-BlobParent::
-RemoteBlobImpl::IsDirectory() const
-{
-  return mBlobImpl->IsDirectory();
-}
-
-uint64_t
-BlobParent::
-RemoteBlobImpl::GetSize(ErrorResult& aRv)
-{
-  return mBlobImpl->GetSize(aRv);
-}
-
-void
-BlobParent::
-RemoteBlobImpl::GetType(nsAString& aType)
-{
-  mBlobImpl->GetType(aType);
-}
-
-uint64_t
-BlobParent::
-RemoteBlobImpl::GetSerialNumber() const
-{
-  return mBlobImpl->GetSerialNumber();
-}
-
-already_AddRefed<BlobImpl>
-BlobParent::
-RemoteBlobImpl::CreateSlice(uint64_t aStart,
-                            uint64_t aLength,
-                            const nsAString& aContentType,
-                            ErrorResult& aRv)
-{
-  return mBlobImpl->CreateSlice(aStart, aLength, aContentType, aRv);
-}
-
-const nsTArray<RefPtr<BlobImpl>>*
-BlobParent::
-RemoteBlobImpl::GetSubBlobImpls() const
-{
-  return mBlobImpl->GetSubBlobImpls();
-}
-
-void
-BlobParent::
-RemoteBlobImpl::GetInternalStream(nsIInputStream** aStream, ErrorResult& aRv)
-{
-  mBlobImpl->GetInternalStream(aStream, aRv);
-}
-
-int64_t
-BlobParent::
-RemoteBlobImpl::GetFileId()
-{
-  return mBlobImpl->GetFileId();
-}
-
-nsresult
-BlobParent::
-RemoteBlobImpl::GetSendInfo(nsIInputStream** aBody,
-                            uint64_t* aContentLength,
-                            nsACString& aContentType,
-                            nsACString& aCharset)
-{
-  return mBlobImpl->GetSendInfo(aBody,
-                                aContentLength,
-                                aContentType,
-                                aCharset);
-}
-
-nsresult
-BlobParent::
-RemoteBlobImpl::GetMutable(bool* aMutable) const
-{
-  return mBlobImpl->GetMutable(aMutable);
-}
-
-nsresult
-BlobParent::
-RemoteBlobImpl::SetMutable(bool aMutable)
-{
-  return mBlobImpl->SetMutable(aMutable);
-}
-
-void
-BlobParent::
-RemoteBlobImpl::SetLazyData(const nsAString& aName,
-                            const nsAString& aContentType,
-                            uint64_t aLength,
-                            int64_t aLastModifiedDate)
-{
-  MOZ_CRASH("This should never be called!");
-}
-
-bool
-BlobParent::
-RemoteBlobImpl::IsMemoryFile() const
-{
-  return mBlobImpl->IsMemoryFile();
-}
-
-bool
-BlobParent::
-RemoteBlobImpl::IsSizeUnknown() const
-{
-  return mBlobImpl->IsSizeUnknown();
-}
-
-bool
-BlobParent::
-RemoteBlobImpl::IsDateUnknown() const
-{
-  return mBlobImpl->IsDateUnknown();
-}
-
-bool
-BlobParent::
-RemoteBlobImpl::IsFile() const
-{
-  return mBlobImpl->IsFile();
-}
-
-bool
-BlobParent::
-RemoteBlobImpl::MayBeClonedToOtherThreads() const
-{
-  return mBlobImpl->MayBeClonedToOtherThreads();
-}
-
-BlobChild*
-BlobParent::
-RemoteBlobImpl::GetBlobChild()
-{
-  return nullptr;
-}
-
-BlobParent*
-BlobParent::
-RemoteBlobImpl::GetBlobParent()
-{
-  return mActor;
-}
-
-/*******************************************************************************
- * BlobChild
- ******************************************************************************/
-
-BlobChild::BlobChild(nsIContentChild* aManager, BlobImpl* aBlobImpl)
-  : mBackgroundManager(nullptr)
-  , mContentManager(aManager)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  CommonInit(aBlobImpl);
-}
-
-BlobChild::BlobChild(PBackgroundChild* aManager, BlobImpl* aBlobImpl)
-  : mBackgroundManager(aManager)
-  , mContentManager(nullptr)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  if (!NS_IsMainThread()) {
-    mEventTarget = do_GetCurrentThread();
-    MOZ_ASSERT(mEventTarget);
-  }
-
-  CommonInit(aBlobImpl);
-}
-
-BlobChild::BlobChild(nsIContentChild* aManager, BlobChild* aOther)
-  : mBackgroundManager(nullptr)
-  , mContentManager(aManager)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  CommonInit(aOther, /* aBlobImpl */ nullptr);
-}
-
-BlobChild::BlobChild(PBackgroundChild* aManager,
-                     BlobChild* aOther,
-                     BlobImpl* aBlobImpl)
-  : mBackgroundManager(aManager)
-  , mContentManager(nullptr)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-  MOZ_ASSERT(aBlobImpl);
-
-  if (!NS_IsMainThread()) {
-    mEventTarget = do_GetCurrentThread();
-    MOZ_ASSERT(mEventTarget);
-  }
-
-  CommonInit(aOther, aBlobImpl);
-}
-
-BlobChild::BlobChild(nsIContentChild* aManager,
-                     const ChildBlobConstructorParams& aParams)
-  : mBackgroundManager(nullptr)
-  , mContentManager(aManager)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  CommonInit(aParams);
-}
-
-BlobChild::BlobChild(PBackgroundChild* aManager,
-                     const ChildBlobConstructorParams& aParams)
-  : mBackgroundManager(aManager)
-  , mContentManager(nullptr)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  if (!NS_IsMainThread()) {
-    mEventTarget = do_GetCurrentThread();
-    MOZ_ASSERT(mEventTarget);
-  }
-
-  CommonInit(aParams);
-}
-
-BlobChild::BlobChild(nsIContentChild* aManager,
-                     const nsID& aParentID,
-                     RemoteBlobSliceImpl* aRemoteBlobSliceImpl)
-  : mBackgroundManager(nullptr)
-  , mContentManager(aManager)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  CommonInit(aParentID, aRemoteBlobSliceImpl);
-}
-
-BlobChild::BlobChild(PBackgroundChild* aManager,
-                     const nsID& aParentID,
-                     RemoteBlobSliceImpl* aRemoteBlobSliceImpl)
-  : mBackgroundManager(aManager)
-  , mContentManager(nullptr)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  if (!NS_IsMainThread()) {
-    mEventTarget = do_GetCurrentThread();
-    MOZ_ASSERT(mEventTarget);
-  }
-
-  CommonInit(aParentID, aRemoteBlobSliceImpl);
-}
-
-BlobChild::~BlobChild()
-{
-  AssertIsOnOwningThread();
-
-  MOZ_COUNT_DTOR(BlobChild);
-}
-
-void
-BlobChild::CommonInit(BlobImpl* aBlobImpl)
-{
-  AssertIsOnOwningThread();
-  MOZ_ASSERT(aBlobImpl);
-
-  MOZ_COUNT_CTOR(BlobChild);
-
-  mBlobImpl = aBlobImpl;
-  mRemoteBlobImpl = nullptr;
-
-  mBlobImpl->AddRef();
-  mOwnsBlobImpl = true;
-
-  memset(&mParentID, 0, sizeof(mParentID));
-}
-
-void
-BlobChild::CommonInit(BlobChild* aOther, BlobImpl* aBlobImpl)
-{
-  AssertIsOnOwningThread();
-  MOZ_ASSERT(aOther);
-  MOZ_ASSERT_IF(mContentManager, aOther->GetBackgroundManager());
-  MOZ_ASSERT_IF(mContentManager, !aBlobImpl);
-  MOZ_ASSERT_IF(mBackgroundManager, aBlobImpl);
-
-  RefPtr<BlobImpl> otherImpl;
-  if (mBackgroundManager && aOther->GetBackgroundManager()) {
-    otherImpl = aBlobImpl;
-  } else {
-    otherImpl = aOther->GetBlobImpl();
-  }
-  MOZ_ASSERT(otherImpl);
-
-  nsString contentType;
-  otherImpl->GetType(contentType);
-
-  ErrorResult rv;
-  uint64_t length = otherImpl->GetSize(rv);
-  MOZ_ASSERT(!rv.Failed());
-
-  RemoteBlobImpl* remoteBlob = nullptr;
-  if (otherImpl->IsFile()) {
-    nsAutoString name;
-    otherImpl->GetName(name);
-
-    nsAutoString domPath;
-    otherImpl->GetDOMPath(domPath);
-
-    int64_t modDate = otherImpl->GetLastModified(rv);
-    MOZ_ASSERT(!rv.Failed());
-
-    RemoteBlobImpl::BlobImplIsDirectory directory = otherImpl->IsDirectory() ?
-      RemoteBlobImpl::BlobImplIsDirectory::eDirectory :
-      RemoteBlobImpl::BlobImplIsDirectory::eNotDirectory;
-
-    remoteBlob =
-      new RemoteBlobImpl(this, otherImpl, name, contentType, domPath,
-                         length, modDate, directory,
-                         false /* SameProcessBlobImpl */);
-  } else {
-    remoteBlob = new RemoteBlobImpl(this, otherImpl, contentType, length,
-                                    false /* SameProcessBlobImpl */);
-  }
-
-  // This RemoteBlob must be kept alive untill RecvCreatedFromKnownBlob is
-  // called because the parent will send this notification and we must be able
-  // to manage it.
-  MOZ_ASSERT(remoteBlob);
-  remoteBlob->AddRef();
-
-  CommonInit(aOther->ParentID(), remoteBlob);
-}
-
-void
-BlobChild::CommonInit(const ChildBlobConstructorParams& aParams)
-{
-  AssertIsOnOwningThread();
-
-  MOZ_COUNT_CTOR(BlobChild);
-
-  const AnyBlobConstructorParams& blobParams = aParams.blobParams();
-
-  AnyBlobConstructorParams::Type paramsType = blobParams.type();
-  MOZ_ASSERT(paramsType != AnyBlobConstructorParams::T__None &&
-             paramsType !=
-               AnyBlobConstructorParams::TSlicedBlobConstructorParams &&
-             paramsType !=
-               AnyBlobConstructorParams::TKnownBlobConstructorParams);
-
-  RefPtr<RemoteBlobImpl> remoteBlob;
-
-  switch (paramsType) {
-    case AnyBlobConstructorParams::TNormalBlobConstructorParams: {
-      const NormalBlobConstructorParams& params =
-        blobParams.get_NormalBlobConstructorParams();
-      remoteBlob =
-        new RemoteBlobImpl(this, nullptr, params.contentType(), params.length(),
-                           false /* SameProcessBlobImpl */);
-      break;
-    }
-
-    case AnyBlobConstructorParams::TFileBlobConstructorParams: {
-      const FileBlobConstructorParams& params =
-        blobParams.get_FileBlobConstructorParams();
-      RemoteBlobImpl::BlobImplIsDirectory directory = params.isDirectory() ?
-        RemoteBlobImpl::BlobImplIsDirectory::eDirectory :
-        RemoteBlobImpl::BlobImplIsDirectory::eNotDirectory;
-      remoteBlob = new RemoteBlobImpl(this,
-                                      nullptr,
-                                      params.name(),
-                                      params.contentType(),
-                                      params.path(),
-                                      params.length(),
-                                      params.modDate(),
-                                      directory,
-                                      false /* SameProcessBlobImpl */);
-      break;
-    }
-
-    case AnyBlobConstructorParams::TSameProcessBlobConstructorParams: {
-      MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
-
-      const SameProcessBlobConstructorParams& params =
-        blobParams.get_SameProcessBlobConstructorParams();
-      MOZ_ASSERT(params.addRefedBlobImpl());
-
-      RefPtr<BlobImpl> blobImpl =
-        dont_AddRef(reinterpret_cast<BlobImpl*>(params.addRefedBlobImpl()));
-
-      ErrorResult rv;
-      uint64_t size = blobImpl->GetSize(rv);
-      MOZ_ASSERT(!rv.Failed());
-
-      nsString contentType;
-      blobImpl->GetType(contentType);
-
-      if (blobImpl->IsFile()) {
-        nsAutoString name;
-        blobImpl->GetName(name);
-
-        nsAutoString domPath;
-        blobImpl->GetDOMPath(domPath);
-
-        int64_t lastModifiedDate = blobImpl->GetLastModified(rv);
-        MOZ_ASSERT(!rv.Failed());
-
-        RemoteBlobImpl::BlobImplIsDirectory directory =
-          blobImpl->IsDirectory() ?
-            RemoteBlobImpl::BlobImplIsDirectory::eDirectory :
-            RemoteBlobImpl::BlobImplIsDirectory::eNotDirectory;
-
-        remoteBlob =
-          new RemoteBlobImpl(this,
-                             blobImpl,
-                             name,
-                             contentType,
-                             domPath,
-                             size,
-                             lastModifiedDate,
-                             directory,
-                             true /* SameProcessBlobImpl */);
-      } else {
-        remoteBlob = new RemoteBlobImpl(this, blobImpl, contentType, size,
-                                        true /* SameProcessBlobImpl */);
-      }
-
-      break;
-    }
-
-    case AnyBlobConstructorParams::TMysteryBlobConstructorParams: {
-      remoteBlob = new RemoteBlobImpl(this);
-      break;
-    }
-
-    default:
-      MOZ_CRASH("Unknown params!");
-  }
-
-  MOZ_ASSERT(remoteBlob);
-
-  DebugOnly<bool> isMutable;
-  MOZ_ASSERT(NS_SUCCEEDED(remoteBlob->GetMutable(&isMutable)));
-  MOZ_ASSERT(!isMutable);
-
-  mRemoteBlobImpl = remoteBlob;
-
-  remoteBlob.forget(&mBlobImpl);
-  mOwnsBlobImpl = true;
-
-  mParentID = aParams.id();
-}
-
-void
-BlobChild::CommonInit(const nsID& aParentID, RemoteBlobImpl* aRemoteBlobImpl)
-{
-  AssertIsOnOwningThread();
-  MOZ_ASSERT(aRemoteBlobImpl);
-
-  DebugOnly<bool> isMutable;
-  MOZ_ASSERT(NS_SUCCEEDED(aRemoteBlobImpl->GetMutable(&isMutable)));
-  MOZ_ASSERT(!isMutable);
-
-  MOZ_COUNT_CTOR(BlobChild);
-
-  RefPtr<RemoteBlobImpl> remoteBlob = aRemoteBlobImpl;
-
-  mRemoteBlobImpl = remoteBlob;
-
-  remoteBlob.forget(&mBlobImpl);
-  mOwnsBlobImpl = true;
-
-  mParentID = aParentID;
-}
-
-#ifdef DEBUG
-
-void
-BlobChild::AssertIsOnOwningThread() const
-{
-  MOZ_ASSERT(IsOnOwningThread());
-}
-
-#endif // DEBUG
-
-// static
-void
-BlobChild::Startup(const FriendKey& /* aKey */)
-{
-  MOZ_ASSERT(!XRE_IsParentProcess());
-
-  CommonStartup();
-}
-
-// static
-BlobChild*
-BlobChild::GetOrCreate(nsIContentChild* aManager, BlobImpl* aBlobImpl)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  return GetOrCreateFromImpl(aManager, aBlobImpl);
-}
-
-// static
-BlobChild*
-BlobChild::GetOrCreate(PBackgroundChild* aManager, BlobImpl* aBlobImpl)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  return GetOrCreateFromImpl(aManager, aBlobImpl);
-}
-
-// static
-BlobChild*
-BlobChild::Create(nsIContentChild* aManager,
-                  const ChildBlobConstructorParams& aParams)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  return CreateFromParams(aManager, aParams);
-}
-
-// static
-BlobChild*
-BlobChild::Create(PBackgroundChild* aManager,
-                  const ChildBlobConstructorParams& aParams)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  return CreateFromParams(aManager, aParams);
-}
-
-// static
-template <class ChildManagerType>
-BlobChild*
-BlobChild::GetOrCreateFromImpl(ChildManagerType* aManager,
-                               BlobImpl* aBlobImpl)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-  MOZ_ASSERT(aBlobImpl);
-
-  // If the blob represents a wrapper around real blob implementation (so called
-  // snapshot) then we need to get the real one.
-  if (nsCOMPtr<PIBlobImplSnapshot> snapshot = do_QueryInterface(aBlobImpl)) {
-    aBlobImpl = snapshot->GetBlobImpl();
-    if (!aBlobImpl) {
-      // The snapshot is not valid anymore.
-      return nullptr;
-    }
-  }
-
-  // If the blob represents a remote blob then we can simply pass its actor back
-  // here.
-  if (nsCOMPtr<nsIRemoteBlob> remoteBlob = do_QueryInterface(aBlobImpl)) {
-    BlobChild* actor =
-      MaybeGetActorFromRemoteBlob(remoteBlob, aManager, aBlobImpl);
-    if (actor) {
-      return actor;
-    }
-  }
-
-  // All blobs shared between threads or processes must be immutable.
-  if (NS_WARN_IF(NS_FAILED(aBlobImpl->SetMutable(false)))) {
-    return nullptr;
-  }
-
-  MOZ_ASSERT(!aBlobImpl->IsSizeUnknown());
-  MOZ_ASSERT(!aBlobImpl->IsDateUnknown());
-
-  AnyBlobConstructorParams blobParams;
-  nsTArray<UniquePtr<AutoIPCStream>> autoIPCStreams;
-
-  if (gProcessType == GeckoProcessType_Default) {
-    RefPtr<BlobImpl> sameProcessImpl = aBlobImpl;
-    auto addRefedBlobImpl =
-      reinterpret_cast<intptr_t>(sameProcessImpl.forget().take());
-
-    blobParams = SameProcessBlobConstructorParams(addRefedBlobImpl);
-  } else {
-    // BlobData is going to be populate here and it _must_ be send via IPC in
-    // order to avoid leaks.
-    BlobData blobData;
-    if (NS_WARN_IF(!BlobDataFromBlobImpl(aManager, aBlobImpl, blobData,
-                                         autoIPCStreams))) {
-      return nullptr;
-    }
-
-    nsString contentType;
-    aBlobImpl->GetType(contentType);
-
-    ErrorResult rv;
-    uint64_t length = aBlobImpl->GetSize(rv);
-    MOZ_ASSERT(!rv.Failed());
-
-    if (aBlobImpl->IsFile()) {
-      nsAutoString name;
-      aBlobImpl->GetName(name);
-
-      nsAutoString domPath;
-      aBlobImpl->GetDOMPath(domPath);
-
-      int64_t modDate = aBlobImpl->GetLastModified(rv);
-      MOZ_ASSERT(!rv.Failed());
-
-      blobParams =
-        FileBlobConstructorParams(name, contentType, domPath, length, modDate,
-                                  aBlobImpl->IsDirectory(), blobData);
-    } else {
-      blobParams = NormalBlobConstructorParams(contentType, length, blobData);
-    }
-  }
-
-  auto* actor = new BlobChild(aManager, aBlobImpl);
-
-  ParentBlobConstructorParams params(blobParams);
-
-  if (NS_WARN_IF(!aManager->SendPBlobConstructor(actor, params))) {
-    return nullptr;
-  }
-
-  autoIPCStreams.Clear();
-  return actor;
-}
-
-// static
-template <class ChildManagerType>
-BlobChild*
-BlobChild::CreateFromParams(ChildManagerType* aManager,
-                            const ChildBlobConstructorParams& aParams)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  const AnyBlobConstructorParams& blobParams = aParams.blobParams();
-
-  switch (blobParams.type()) {
-    case AnyBlobConstructorParams::TNormalBlobConstructorParams:
-    case AnyBlobConstructorParams::TFileBlobConstructorParams:
-    case AnyBlobConstructorParams::TSameProcessBlobConstructorParams:
-    case AnyBlobConstructorParams::TMysteryBlobConstructorParams: {
-      return new BlobChild(aManager, aParams);
-    }
-
-    case AnyBlobConstructorParams::TSlicedBlobConstructorParams: {
-      MOZ_CRASH("Parent should never send SlicedBlobConstructorParams!");
-    }
-
-    case AnyBlobConstructorParams::TKnownBlobConstructorParams: {
-      MOZ_CRASH("Parent should never send KnownBlobConstructorParams!");
-    }
-
-    default:
-      MOZ_CRASH("Unknown params!");
-  }
-
-  MOZ_CRASH("Should never get here!");
-}
-
-// static
-template <class ChildManagerType>
-BlobChild*
-BlobChild::SendSliceConstructor(ChildManagerType* aManager,
-                                RemoteBlobSliceImpl* aRemoteBlobSliceImpl,
-                                const ParentBlobConstructorParams& aParams)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-  MOZ_ASSERT(aRemoteBlobSliceImpl);
-  MOZ_ASSERT(aParams.blobParams().type() ==
-               AnyBlobConstructorParams::TSlicedBlobConstructorParams);
-
-  const nsID& id = aParams.blobParams().get_SlicedBlobConstructorParams().id();
-
-  auto* newActor = new BlobChild(aManager, id, aRemoteBlobSliceImpl);
-
-  if (aManager->SendPBlobConstructor(newActor, aParams)) {
-    if (gProcessType != GeckoProcessType_Default || !NS_IsMainThread()) {
-      newActor->SendWaitForSliceCreation();
-    }
-    return newActor;
-  }
-
-  return nullptr;
-}
-
-// static
-BlobChild*
-BlobChild::MaybeGetActorFromRemoteBlob(nsIRemoteBlob* aRemoteBlob,
-                                       nsIContentChild* aManager,
-                                       BlobImpl* aBlobImpl)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aRemoteBlob);
-  MOZ_ASSERT(aManager);
-  MOZ_ASSERT(aBlobImpl);
-
-  if (BlobChild* actor = aRemoteBlob->GetBlobChild()) {
-    if (actor->GetContentManager() == aManager) {
-      return actor;
-    }
-
-    MOZ_ASSERT(actor->GetBackgroundManager());
-
-    actor = new BlobChild(aManager, actor);
-
-    ParentBlobConstructorParams params(
-      KnownBlobConstructorParams(actor->ParentID()));
-
-    aManager->SendPBlobConstructor(actor, params);
-
-    return actor;
-  }
-
-  return nullptr;
-}
-
-// static
-BlobChild*
-BlobChild::MaybeGetActorFromRemoteBlob(nsIRemoteBlob* aRemoteBlob,
-                                       PBackgroundChild* aManager,
-                                       BlobImpl* aBlobImpl)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aRemoteBlob);
-  MOZ_ASSERT(aManager);
-  MOZ_ASSERT(aBlobImpl);
-
-  if (BlobChild* actor = aRemoteBlob->GetBlobChild()) {
-    if (actor->GetBackgroundManager() == aManager) {
-      return actor;
-    }
-
-    actor = new BlobChild(aManager, actor, aBlobImpl);
-
-    ParentBlobConstructorParams params(
-      KnownBlobConstructorParams(actor->ParentID()));
-
-    aManager->SendPBlobConstructor(actor, params);
-
-    return actor;
-  }
-
-  return nullptr;
-}
-
-const nsID&
-BlobChild::ParentID() const
-{
-  MOZ_ASSERT(mRemoteBlobImpl);
-
-  return mParentID;
-}
-
-already_AddRefed<BlobImpl>
-BlobChild::GetBlobImpl()
-{
-  AssertIsOnOwningThread();
-  MOZ_ASSERT(mBlobImpl);
-
-  RefPtr<BlobImpl> blobImpl;
-
-  // Remote blobs are held alive until the first call to GetBlobImpl. Thereafter
-  // we only hold a weak reference. Normal blobs are held alive until the actor
-  // is destroyed.
-  if (mRemoteBlobImpl && mOwnsBlobImpl) {
-    blobImpl = dont_AddRef(mBlobImpl);
-    mOwnsBlobImpl = false;
-  } else {
-    blobImpl = mBlobImpl;
-  }
-
-  MOZ_ASSERT(blobImpl);
-
-  return blobImpl.forget();
-}
-
-bool
-BlobChild::SetMysteryBlobInfo(const nsString& aName,
-                              const nsString& aContentType,
-                              uint64_t aLength,
-                              int64_t aLastModifiedDate)
-{
-  AssertIsOnOwningThread();
-  MOZ_ASSERT(mBlobImpl);
-  MOZ_ASSERT(!mBlobImpl->IsDirectory());
-  MOZ_ASSERT(mRemoteBlobImpl);
-  MOZ_ASSERT(!mRemoteBlobImpl->IsDirectory());
-  MOZ_ASSERT(aLastModifiedDate != INT64_MAX);
-
-  mBlobImpl->SetLazyData(aName, aContentType, aLength, aLastModifiedDate);
-
-  FileBlobConstructorParams params(aName,
-                                   aContentType,
-                                   EmptyString(),
-                                   aLength,
-                                   aLastModifiedDate,
-                                   mBlobImpl->IsDirectory(),
-                                   void_t() /* optionalBlobData */);
-  return SendResolveMystery(params);
-}
-
-bool
-BlobChild::SetMysteryBlobInfo(const nsString& aContentType, uint64_t aLength)
-{
-  AssertIsOnOwningThread();
-  MOZ_ASSERT(mBlobImpl);
-  MOZ_ASSERT(mRemoteBlobImpl);
-
-  mBlobImpl->SetLazyData(NullString(), aContentType, aLength, INT64_MAX);
-
-  NormalBlobConstructorParams params(aContentType,
-                                     aLength,
-                                     void_t() /* optionalBlobData */);
-  return SendResolveMystery(params);
-}
-
-void
-BlobChild::NoteDyingRemoteBlobImpl()
-{
-  MOZ_ASSERT(mBlobImpl);
-  MOZ_ASSERT(mRemoteBlobImpl);
-  MOZ_ASSERT(!mOwnsBlobImpl);
-
-  // This may be called on any thread due to the fact that RemoteBlobImpl is
-  // designed to be passed between threads. We must start the shutdown process
-  // on the owning thread, so we proxy here if necessary.
-  if (!IsOnOwningThread()) {
-    nsCOMPtr<nsIRunnable> runnable =
-      NewNonOwningRunnableMethod(this, &BlobChild::NoteDyingRemoteBlobImpl);
-
-    if (mEventTarget) {
-      runnable = new CancelableRunnableWrapper(runnable, mEventTarget);
-
-      MOZ_ALWAYS_SUCCEEDS(mEventTarget->Dispatch(runnable,
-                                                 NS_DISPATCH_NORMAL));
-    } else {
-      MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(runnable));
-    }
-
-    return;
-  }
-
-  // Must do this before calling Send__delete__ or we'll crash there trying to
-  // access a dangling pointer.
-  mBlobImpl = nullptr;
-  mRemoteBlobImpl = nullptr;
-
-  PBlobChild::Send__delete__(this);
-}
-
-bool
-BlobChild::IsOnOwningThread() const
-{
-  return EventTargetIsOnCurrentThread(mEventTarget);
-}
-
-void
-BlobChild::ActorDestroy(ActorDestroyReason aWhy)
-{
-  AssertIsOnOwningThread();
-
-  if (mRemoteBlobImpl) {
-    mRemoteBlobImpl->NoteDyingActor();
-  }
-
-  if (mBlobImpl && mOwnsBlobImpl) {
-    mBlobImpl->Release();
-  }
-
-#ifdef DEBUG
-  mBlobImpl = nullptr;
-  mRemoteBlobImpl = nullptr;
-  mBackgroundManager = nullptr;
-  mContentManager = nullptr;
-  mOwnsBlobImpl = false;
-#endif
-}
-
-mozilla::ipc::IPCResult
-BlobChild::RecvCreatedFromKnownBlob()
-{
-  MOZ_ASSERT(mRemoteBlobImpl);
-
-  // Releasing the other blob now that this blob is fully created.
-  mRemoteBlobImpl->NullifyDifferentProcessBlobImpl();
-
-  // Release the additional reference to ourself that was added in order to
-  // receive this RecvCreatedFromKnownBlob.
-  mRemoteBlobImpl->Release();
-  return IPC_OK();
-}
-
-/*******************************************************************************
- * BlobParent
- ******************************************************************************/
-
-BlobParent::BlobParent(nsIContentParent* aManager, IDTableEntry* aIDTableEntry)
-  : mBackgroundManager(nullptr)
-  , mContentManager(aManager)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  CommonInit(aIDTableEntry);
-}
-
-BlobParent::BlobParent(PBackgroundParent* aManager, IDTableEntry* aIDTableEntry)
-  : mBackgroundManager(aManager)
-  , mContentManager(nullptr)
-  , mEventTarget(do_GetCurrentThread())
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-  MOZ_ASSERT(mEventTarget);
-
-  CommonInit(aIDTableEntry);
-}
-
-BlobParent::BlobParent(nsIContentParent* aManager,
-                       BlobImpl* aBlobImpl,
-                       IDTableEntry* aIDTableEntry)
-  : mBackgroundManager(nullptr)
-  , mContentManager(aManager)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  CommonInit(aBlobImpl, aIDTableEntry);
-}
-
-BlobParent::BlobParent(PBackgroundParent* aManager,
-                       BlobImpl* aBlobImpl,
-                       IDTableEntry* aIDTableEntry)
-  : mBackgroundManager(aManager)
-  , mContentManager(nullptr)
-  , mEventTarget(do_GetCurrentThread())
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-  MOZ_ASSERT(mEventTarget);
-
-  CommonInit(aBlobImpl, aIDTableEntry);
-}
-
-BlobParent::~BlobParent()
-{
-  AssertIsOnOwningThread();
-
-  MOZ_COUNT_DTOR(BlobParent);
-}
-
-void
-BlobParent::CommonInit(IDTableEntry* aIDTableEntry)
-{
-  AssertIsOnOwningThread();
-  MOZ_ASSERT(aIDTableEntry);
-  MOZ_ASSERT(aIDTableEntry->GetBlobImpl());
-
-  MOZ_COUNT_CTOR(BlobParent);
-
-  mBlobImpl = aIDTableEntry->GetBlobImpl();
-  mRemoteBlobImpl = nullptr;
-
-  mBlobImpl->AddRef();
-  mOwnsBlobImpl = true;
-
-  mIDTableEntry = aIDTableEntry;
-}
-
-void
-BlobParent::CommonInit(BlobImpl* aBlobImpl, IDTableEntry* aIDTableEntry)
-{
-  AssertIsOnOwningThread();
-  MOZ_ASSERT(aBlobImpl);
-  MOZ_ASSERT(aIDTableEntry);
-
-  MOZ_COUNT_CTOR(BlobParent);
-
-  DebugOnly<bool> isMutable;
-  MOZ_ASSERT(NS_SUCCEEDED(aBlobImpl->GetMutable(&isMutable)));
-  MOZ_ASSERT(!isMutable);
-
-  RefPtr<RemoteBlobImpl> remoteBlobImpl = new RemoteBlobImpl(this, aBlobImpl);
-
-  MOZ_ASSERT(NS_SUCCEEDED(remoteBlobImpl->GetMutable(&isMutable)));
-  MOZ_ASSERT(!isMutable);
-
-  mRemoteBlobImpl = remoteBlobImpl;
-
-  remoteBlobImpl.forget(&mBlobImpl);
-  mOwnsBlobImpl = true;
-
-  mIDTableEntry = aIDTableEntry;
-}
-
-#ifdef DEBUG
-
-void
-BlobParent::AssertIsOnOwningThread() const
-{
-  MOZ_ASSERT(IsOnOwningThread());
-}
-
-#endif // DEBUG
-
-// static
-void
-BlobParent::Startup(const FriendKey& /* aKey */)
-{
-  MOZ_ASSERT(XRE_IsParentProcess());
-
-  CommonStartup();
-
-  ClearOnShutdown(&sIDTable);
-
-  sIDTableMutex = new Mutex("BlobParent::sIDTableMutex");
-  ClearOnShutdown(&sIDTableMutex);
-}
-
-// static
-BlobParent*
-BlobParent::GetOrCreate(nsIContentParent* aManager, BlobImpl* aBlobImpl)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  return GetOrCreateFromImpl(aManager, aBlobImpl);
-}
-
-// static
-BlobParent*
-BlobParent::GetOrCreate(PBackgroundParent* aManager, BlobImpl* aBlobImpl)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  return GetOrCreateFromImpl(aManager, aBlobImpl);
-}
-
-// static
-BlobParent*
-BlobParent::Create(nsIContentParent* aManager,
-                   const ParentBlobConstructorParams& aParams)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  return CreateFromParams(aManager, aParams);
-}
-
-// static
-BlobParent*
-BlobParent::Create(PBackgroundParent* aManager,
-                   const ParentBlobConstructorParams& aParams)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  return CreateFromParams(aManager, aParams);
-}
-
-// static
-already_AddRefed<BlobImpl>
-BlobParent::GetBlobImplForID(const nsID& aID)
-{
-  if (NS_WARN_IF(gProcessType != GeckoProcessType_Default)) {
-    ASSERT_UNLESS_FUZZING();
-    return nullptr;
-  }
-
-  RefPtr<IDTableEntry> idTableEntry = IDTableEntry::Get(aID);
-  if (NS_WARN_IF(!idTableEntry)) {
-    return nullptr;
-  }
-
-  RefPtr<BlobImpl> blobImpl = idTableEntry->GetBlobImpl();
-  MOZ_ASSERT(blobImpl);
-
-  return blobImpl.forget();
-}
-
-// static
-template <class ParentManagerType>
-BlobParent*
-BlobParent::GetOrCreateFromImpl(ParentManagerType* aManager,
-                                BlobImpl* aBlobImpl)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-  MOZ_ASSERT(aBlobImpl);
-
-  MOZ_ASSERT(!nsCOMPtr<PIBlobImplSnapshot>(do_QueryInterface(aBlobImpl)));
-
-  // If the blob represents a remote blob for this manager then we can simply
-  // pass its actor back here.
-  if (nsCOMPtr<nsIRemoteBlob> remoteBlob = do_QueryInterface(aBlobImpl)) {
-    BlobParent* actor = MaybeGetActorFromRemoteBlob(remoteBlob, aManager);
-    if (actor) {
-      return actor;
-    }
-  }
-
-  // All blobs shared between threads or processes must be immutable.
-  if (NS_WARN_IF(NS_FAILED(aBlobImpl->SetMutable(false)))) {
-    return nullptr;
-  }
-
-  AnyBlobConstructorParams blobParams;
-
-  if (ActorManagerIsSameProcess(aManager)) {
-    RefPtr<BlobImpl> sameProcessImpl = aBlobImpl;
-    auto addRefedBlobImpl =
-      reinterpret_cast<intptr_t>(sameProcessImpl.forget().take());
-
-    blobParams = SameProcessBlobConstructorParams(addRefedBlobImpl);
-  } else {
-    if (aBlobImpl->IsSizeUnknown() || aBlobImpl->IsDateUnknown()) {
-      // We don't want to call GetSize or GetLastModifiedDate yet since that may
-      // stat a file on the this thread. Instead we'll learn the size lazily
-      // from the other side.
-      blobParams = MysteryBlobConstructorParams();
-    } else {
-      nsString contentType;
-      aBlobImpl->GetType(contentType);
-
-      ErrorResult rv;
-      uint64_t length = aBlobImpl->GetSize(rv);
-      MOZ_ASSERT(!rv.Failed());
-
-      if (aBlobImpl->IsFile()) {
-        nsAutoString name;
-        aBlobImpl->GetName(name);
-
-        nsAutoString domPath;
-        aBlobImpl->GetDOMPath(domPath);
-
-        int64_t modDate = aBlobImpl->GetLastModified(rv);
-        MOZ_ASSERT(!rv.Failed());
-
-        blobParams =
-          FileBlobConstructorParams(name, contentType, domPath, length, modDate,
-                                    aBlobImpl->IsDirectory(), void_t());
-      } else {
-        blobParams = NormalBlobConstructorParams(contentType, length, void_t());
-      }
-    }
-  }
-
-  nsID id;
-  MOZ_ALWAYS_SUCCEEDS(gUUIDGenerator->GenerateUUIDInPlace(&id));
-
-  RefPtr<IDTableEntry> idTableEntry =
-    IDTableEntry::GetOrCreate(id, ActorManagerProcessID(aManager), aBlobImpl);
-  MOZ_ASSERT(idTableEntry);
-
-  auto* actor = new BlobParent(aManager, idTableEntry);
-
-  ChildBlobConstructorParams params(id, blobParams);
-  if (NS_WARN_IF(!aManager->SendPBlobConstructor(actor, params))) {
-    return nullptr;
-  }
-
-  return actor;
-}
-
-// static
-template <class ParentManagerType>
-BlobParent*
-BlobParent::CreateFromParams(ParentManagerType* aManager,
-                             const ParentBlobConstructorParams& aParams)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  const AnyBlobConstructorParams& blobParams = aParams.blobParams();
-
-  switch (blobParams.type()) {
-    case AnyBlobConstructorParams::TMysteryBlobConstructorParams: {
-      ASSERT_UNLESS_FUZZING();
-      return nullptr;
-    }
-
-    case AnyBlobConstructorParams::TNormalBlobConstructorParams:
-    case AnyBlobConstructorParams::TFileBlobConstructorParams: {
-      const OptionalBlobData& optionalBlobData =
-        blobParams.type() ==
-          AnyBlobConstructorParams::TNormalBlobConstructorParams ?
-        blobParams.get_NormalBlobConstructorParams().optionalBlobData() :
-        blobParams.get_FileBlobConstructorParams().optionalBlobData();
-
-      if (NS_WARN_IF(optionalBlobData.type() != OptionalBlobData::TBlobData)) {
-        ASSERT_UNLESS_FUZZING();
-        return nullptr;
-      }
-
-      RefPtr<BlobImpl> blobImpl =
-        CreateBlobImpl(aParams, optionalBlobData.get_BlobData());
-      if (NS_WARN_IF(!blobImpl)) {
-        ASSERT_UNLESS_FUZZING();
-        return nullptr;
-      }
-
-      nsID id;
-      MOZ_ALWAYS_SUCCEEDS(gUUIDGenerator->GenerateUUIDInPlace(&id));
-
-      RefPtr<IDTableEntry> idTableEntry =
-        IDTableEntry::Create(id, ActorManagerProcessID(aManager), blobImpl);
-      if (NS_WARN_IF(!idTableEntry)) {
-        ASSERT_UNLESS_FUZZING();
-        return nullptr;
-      }
-
-      return new BlobParent(aManager, blobImpl, idTableEntry);
-    }
-
-    case AnyBlobConstructorParams::TSlicedBlobConstructorParams: {
-      const SlicedBlobConstructorParams& params =
-        blobParams.get_SlicedBlobConstructorParams();
-
-      if (NS_WARN_IF(params.end() < params.begin())) {
-        ASSERT_UNLESS_FUZZING();
-        return nullptr;
-      }
-
-      auto* actor =
-        const_cast<BlobParent*>(
-          static_cast<const BlobParent*>(params.sourceParent()));
-      MOZ_ASSERT(actor);
-
-      RefPtr<BlobImpl> source = actor->GetBlobImpl();
-      MOZ_ASSERT(source);
-
-      ErrorResult rv;
-      RefPtr<BlobImpl> slice =
-        source->CreateSlice(params.begin(),
-                            params.end() - params.begin(),
-                            params.contentType(),
-                            rv);
-      if (NS_WARN_IF(rv.Failed())) {
-        ASSERT_UNLESS_FUZZING();
-        return nullptr;
-      }
-
-      MOZ_ALWAYS_SUCCEEDS(slice->SetMutable(false));
-
-      RefPtr<IDTableEntry> idTableEntry =
-        IDTableEntry::Create(params.id(),
-                             ActorManagerProcessID(aManager),
-                             slice);
-      if (NS_WARN_IF(!idTableEntry)) {
-        ASSERT_UNLESS_FUZZING();
-        return nullptr;
-      }
-
-      return new BlobParent(aManager, slice, idTableEntry);
-    }
-
-    case AnyBlobConstructorParams::TKnownBlobConstructorParams: {
-      const KnownBlobConstructorParams& params =
-        blobParams.get_KnownBlobConstructorParams();
-
-      RefPtr<IDTableEntry> idTableEntry =
-        IDTableEntry::Get(params.id(), ActorManagerProcessID(aManager));
-      if (NS_WARN_IF(!idTableEntry)) {
-        ASSERT_UNLESS_FUZZING();
-        return nullptr;
-      }
-
-      return new BlobParent(aManager, idTableEntry);
-    }
-
-    case AnyBlobConstructorParams::TSameProcessBlobConstructorParams: {
-      if (NS_WARN_IF(!ActorManagerIsSameProcess(aManager))) {
-        ASSERT_UNLESS_FUZZING();
-        return nullptr;
-      }
-
-      const SameProcessBlobConstructorParams& params =
-        blobParams.get_SameProcessBlobConstructorParams();
-
-      RefPtr<BlobImpl> blobImpl =
-        dont_AddRef(reinterpret_cast<BlobImpl*>(params.addRefedBlobImpl()));
-      MOZ_ASSERT(blobImpl);
-
-      nsID id;
-      MOZ_ALWAYS_SUCCEEDS(gUUIDGenerator->GenerateUUIDInPlace(&id));
-
-      RefPtr<IDTableEntry> idTableEntry =
-        IDTableEntry::Create(id, ActorManagerProcessID(aManager), blobImpl);
-      MOZ_ASSERT(idTableEntry);
-
-      return new BlobParent(aManager, blobImpl, idTableEntry);
-    }
-
-    default:
-      MOZ_CRASH("Unknown params!");
-  }
-
-  MOZ_CRASH("Should never get here!");
-}
-
-// static
-template <class ParentManagerType>
-BlobParent*
-BlobParent::SendSliceConstructor(
-                             ParentManagerType* aManager,
-                             const ParentBlobConstructorParams& aParams,
-                             const ChildBlobConstructorParams& aOtherSideParams)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aManager);
-
-  BlobParent* newActor = BlobParent::Create(aManager, aParams);
-  MOZ_ASSERT(newActor);
-
-  if (aManager->SendPBlobConstructor(newActor, aOtherSideParams)) {
-    return newActor;
-  }
-
-  return nullptr;
-}
-
-// static
-BlobParent*
-BlobParent::MaybeGetActorFromRemoteBlob(nsIRemoteBlob* aRemoteBlob,
-                                        nsIContentParent* aManager)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aRemoteBlob);
-  MOZ_ASSERT(aManager);
-
-  BlobParent* actor = aRemoteBlob->GetBlobParent();
-  if (actor && actor->GetContentManager() == aManager) {
-    return actor;
-  }
-
-  return nullptr;
-}
-
-// static
-BlobParent*
-BlobParent::MaybeGetActorFromRemoteBlob(nsIRemoteBlob* aRemoteBlob,
-                                        PBackgroundParent* aManager)
-{
-  AssertCorrectThreadForManager(aManager);
-  MOZ_ASSERT(aRemoteBlob);
-  MOZ_ASSERT(aManager);
-
-  BlobParent* actor = aRemoteBlob->GetBlobParent();
-  if (actor && actor->GetBackgroundManager() == aManager) {
-    return actor;
-  }
-
-  return nullptr;
-}
-
-already_AddRefed<BlobImpl>
-BlobParent::GetBlobImpl()
-{
-  AssertIsOnOwningThread();
-  MOZ_ASSERT(mBlobImpl);
-
-  RefPtr<BlobImpl> blobImpl;
-
-  // Remote blobs are held alive until the first call to GetBlobImpl. Thereafter
-  // we only hold a weak reference. Normal blobs are held alive until the actor
-  // is destroyed.
-  if (mRemoteBlobImpl && mOwnsBlobImpl) {
-    blobImpl = dont_AddRef(mBlobImpl);
-    mOwnsBlobImpl = false;
-  } else {
-    blobImpl = mBlobImpl;
-  }
-
-  MOZ_ASSERT(blobImpl);
-
-  return blobImpl.forget();
-}
-
-void
-BlobParent::NoteDyingRemoteBlobImpl()
-{
-  MOZ_ASSERT(mRemoteBlobImpl);
-  MOZ_ASSERT(!mOwnsBlobImpl);
-
-  // This may be called on any thread due to the fact that RemoteBlobImpl is
-  // designed to be passed between threads. We must start the shutdown process
-  // on the main thread, so we proxy here if necessary.
-  if (!IsOnOwningThread()) {
-    nsCOMPtr<nsIRunnable> runnable =
-      NewNonOwningRunnableMethod(this, &BlobParent::NoteDyingRemoteBlobImpl);
-
-    if (mEventTarget) {
-      runnable = new CancelableRunnableWrapper(runnable, mEventTarget);
-
-      MOZ_ALWAYS_SUCCEEDS(mEventTarget->Dispatch(runnable,
-                                                 NS_DISPATCH_NORMAL));
-    } else {
-      MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(runnable));
-    }
-
-    return;
-  }
-
-  // Must do this before calling Send__delete__ or we'll crash there trying to
-  // access a dangling pointer.
-  mBlobImpl = nullptr;
-  mRemoteBlobImpl = nullptr;
-
-  Unused << PBlobParent::Send__delete__(this);
-}
-
-bool
-BlobParent::IsOnOwningThread() const
-{
-  return EventTargetIsOnCurrentThread(mEventTarget);
-}
-
-void
-BlobParent::ActorDestroy(ActorDestroyReason aWhy)
-{
-  AssertIsOnOwningThread();
-
-  if (mRemoteBlobImpl) {
-    mRemoteBlobImpl->NoteDyingActor();
-  }
-
-  if (mBlobImpl && mOwnsBlobImpl) {
-    mBlobImpl->Release();
-  }
-
-#ifdef DEBUG
-  mBlobImpl = nullptr;
-  mRemoteBlobImpl = nullptr;
-  mBackgroundManager = nullptr;
-  mContentManager = nullptr;
-  mOwnsBlobImpl = false;
-#endif
-}
-
-mozilla::ipc::IPCResult
-BlobParent::RecvResolveMystery(const ResolveMysteryParams& aParams)
-{
-  AssertIsOnOwningThread();
-  MOZ_ASSERT(aParams.type() != ResolveMysteryParams::T__None);
-  MOZ_ASSERT(mBlobImpl);
-  MOZ_ASSERT(!mRemoteBlobImpl);
-  MOZ_ASSERT(mOwnsBlobImpl);
-
-  switch (aParams.type()) {
-    case ResolveMysteryParams::TNormalBlobConstructorParams: {
-      const NormalBlobConstructorParams& params =
-        aParams.get_NormalBlobConstructorParams();
-
-      if (NS_WARN_IF(params.length() == UINT64_MAX)) {
-        ASSERT_UNLESS_FUZZING();
-        return IPC_FAIL_NO_REASON(this);
-      }
-
-      mBlobImpl->SetLazyData(NullString(),
-                             params.contentType(),
-                             params.length(),
-                             INT64_MAX);
-      return IPC_OK();
-    }
-
-    case ResolveMysteryParams::TFileBlobConstructorParams: {
-      const FileBlobConstructorParams& params =
-        aParams.get_FileBlobConstructorParams();
-      if (NS_WARN_IF(params.name().IsVoid())) {
-        ASSERT_UNLESS_FUZZING();
-        return IPC_FAIL_NO_REASON(this);
-      }
-
-      if (NS_WARN_IF(params.length() == UINT64_MAX)) {
-        ASSERT_UNLESS_FUZZING();
-        return IPC_FAIL_NO_REASON(this);
-      }
-
-      if (NS_WARN_IF(params.modDate() == INT64_MAX)) {
-        ASSERT_UNLESS_FUZZING();
-        return IPC_FAIL_NO_REASON(this);
-      }
-
-      mBlobImpl->SetLazyData(params.name(),
-                             params.contentType(),
-                             params.length(),
-                             params.modDate());
-      return IPC_OK();
-    }
-
-    default:
-      MOZ_CRASH("Unknown params!");
-  }
-
-  MOZ_CRASH("Should never get here!");
-}
-
-mozilla::ipc::IPCResult
-BlobParent::RecvWaitForSliceCreation()
-{
-  AssertIsOnOwningThread();
-  MOZ_ASSERT(mBlobImpl);
-  MOZ_ASSERT(mOwnsBlobImpl);
-
-  // The whole point of this message is to ensure that the sliced blob created
-  // by the child has been inserted into our IDTable.
-  MOZ_ASSERT(mIDTableEntry);
-
-#ifdef DEBUG
-  {
-    MOZ_ASSERT(sIDTableMutex);
-    MutexAutoLock lock(*sIDTableMutex);
-
-    MOZ_ASSERT(sIDTable);
-    MOZ_ASSERT(sIDTable->Contains(mIDTableEntry->ID()));
-  }
-#endif
-
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-BlobParent::RecvGetFileId(int64_t* aFileId)
-{
-  AssertIsOnOwningThread();
-  MOZ_ASSERT(mBlobImpl);
-  MOZ_ASSERT(!mRemoteBlobImpl);
-  MOZ_ASSERT(mOwnsBlobImpl);
-
-  if (NS_WARN_IF(!IndexedDatabaseManager::InTestingMode())) {
-    ASSERT_UNLESS_FUZZING();
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  *aFileId = mBlobImpl->GetFileId();
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-BlobParent::RecvGetFilePath(nsString* aFilePath)
-{
-  AssertIsOnOwningThread();
-  MOZ_ASSERT(mBlobImpl);
-  MOZ_ASSERT(!mRemoteBlobImpl);
-  MOZ_ASSERT(mOwnsBlobImpl);
-
-  // In desktop e10s the file picker code sends this message.
-
-  nsString filePath;
-  ErrorResult rv;
-  mBlobImpl->GetMozFullPathInternal(filePath, rv);
-  if (NS_WARN_IF(rv.Failed())) {
-    rv.SuppressException();
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  *aFilePath = filePath;
-  return IPC_OK();
-}
-
-/*******************************************************************************
- * BlobParent::IDTableEntry
- ******************************************************************************/
-
-BlobParent::
-IDTableEntry::IDTableEntry(const nsID& aID,
-                           intptr_t aProcessID,
-                           BlobImpl* aBlobImpl)
-  : mID(aID)
-  , mProcessID(aProcessID)
-  , mBlobImpl(aBlobImpl)
-{
-  MOZ_ASSERT(aBlobImpl);
-}
-
-BlobParent::
-IDTableEntry::~IDTableEntry()
-{
-  MOZ_ASSERT(sIDTableMutex);
-  sIDTableMutex->AssertNotCurrentThreadOwns();
-  MOZ_ASSERT(sIDTable);
-
-  {
-    MutexAutoLock lock(*sIDTableMutex);
-    MOZ_ASSERT(sIDTable->Get(mID) == this);
-
-    sIDTable->Remove(mID);
-
-    if (!sIDTable->Count()) {
-      sIDTable = nullptr;
-    }
-  }
-}
-
-// static
-already_AddRefed<BlobParent::IDTableEntry>
-BlobParent::
-IDTableEntry::GetOrCreateInternal(const nsID& aID,
-                                  intptr_t aProcessID,
-                                  BlobImpl* aBlobImpl,
-                                  bool aMayCreate,
-                                  bool aMayGet,
-                                  bool aIgnoreProcessID)
-{
-  MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
-  MOZ_ASSERT(sIDTableMutex);
-  sIDTableMutex->AssertNotCurrentThreadOwns();
-
-  RefPtr<IDTableEntry> entry;
-
-  {
-    MutexAutoLock lock(*sIDTableMutex);
-
-    if (!sIDTable) {
-      if (NS_WARN_IF(!aMayCreate)) {
-        return nullptr;
-      }
-
-      sIDTable = new IDTable();
-    }
-
-    entry = sIDTable->Get(aID);
-
-    if (entry) {
-      MOZ_ASSERT_IF(aBlobImpl, entry->GetBlobImpl() == aBlobImpl);
-
-      if (NS_WARN_IF(!aMayGet)) {
-        return nullptr;
-      }
-
-      if (!aIgnoreProcessID && NS_WARN_IF(entry->mProcessID != aProcessID)) {
-        return nullptr;
-      }
-    } else {
-      if (NS_WARN_IF(!aMayCreate)) {
-        return nullptr;
-      }
-
-      MOZ_ASSERT(aBlobImpl);
-
-      entry = new IDTableEntry(aID, aProcessID, aBlobImpl);
-
-      sIDTable->Put(aID, entry);
-    }
-  }
-
-  MOZ_ASSERT(entry);
-
-  return entry.forget();
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/file/ipc/BlobChild.h
+++ /dev/null
@@ -1,238 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_ipc_BlobChild_h
-#define mozilla_dom_ipc_BlobChild_h
-
-#include "mozilla/Attributes.h"
-#include "mozilla/dom/PBlobChild.h"
-#include "nsCOMPtr.h"
-#include "nsID.h"
-
-class nsIEventTarget;
-class nsIRemoteBlob;
-class nsString;
-
-namespace mozilla {
-namespace ipc {
-
-class PBackgroundChild;
-
-} // namespace ipc
-
-namespace dom {
-
-class Blob;
-class BlobImpl;
-class ContentChild;
-class nsIContentChild;
-
-class BlobChild final
-  : public PBlobChild
-{
-  typedef mozilla::ipc::PBackgroundChild PBackgroundChild;
-
-  class RemoteBlobImpl;
-  friend class RemoteBlobImpl;
-
-  class RemoteBlobSliceImpl;
-  friend class RemoteBlobSliceImpl;
-
-  BlobImpl* mBlobImpl;
-  RemoteBlobImpl* mRemoteBlobImpl;
-
-  // One of these will be null and the other non-null.
-  PBackgroundChild* mBackgroundManager;
-  nsCOMPtr<nsIContentChild> mContentManager;
-
-  nsCOMPtr<nsIEventTarget> mEventTarget;
-
-  nsID mParentID;
-
-  bool mOwnsBlobImpl;
-
-public:
-  class FriendKey;
-
-  static void
-  Startup(const FriendKey& aKey);
-
-  // These create functions are called on the sending side.
-  static BlobChild*
-  GetOrCreate(nsIContentChild* aManager, BlobImpl* aBlobImpl);
-
-  static BlobChild*
-  GetOrCreate(PBackgroundChild* aManager, BlobImpl* aBlobImpl);
-
-  // These create functions are called on the receiving side.
-  static BlobChild*
-  Create(nsIContentChild* aManager, const ChildBlobConstructorParams& aParams);
-
-  static BlobChild*
-  Create(PBackgroundChild* aManager,
-         const ChildBlobConstructorParams& aParams);
-
-  static void
-  Destroy(PBlobChild* aActor)
-  {
-    delete static_cast<BlobChild*>(aActor);
-  }
-
-  bool
-  HasManager() const
-  {
-    return mBackgroundManager || mContentManager;
-  }
-
-  PBackgroundChild*
-  GetBackgroundManager() const
-  {
-    return mBackgroundManager;
-  }
-
-  nsIContentChild*
-  GetContentManager() const
-  {
-    return mContentManager;
-  }
-
-  const nsID&
-  ParentID() const;
-
-  // Get the BlobImpl associated with this actor. This may always be called
-  // on the sending side. It may also be called on the receiving side unless
-  // this is a "mystery" blob that has not yet received a SetMysteryBlobInfo()
-  // call.
-  already_AddRefed<BlobImpl>
-  GetBlobImpl();
-
-  // Use this for files.
-  bool
-  SetMysteryBlobInfo(const nsString& aName,
-                     const nsString& aContentType,
-                     uint64_t aLength,
-                     int64_t aLastModifiedDate);
-
-  // Use this for non-file blobs.
-  bool
-  SetMysteryBlobInfo(const nsString& aContentType, uint64_t aLength);
-
-  void
-  AssertIsOnOwningThread() const
-#ifdef DEBUG
-  ;
-#else
-  { }
-#endif
-
-private:
-  // These constructors are called on the sending side.
-  BlobChild(nsIContentChild* aManager, BlobImpl* aBlobImpl);
-
-  BlobChild(PBackgroundChild* aManager, BlobImpl* aBlobImpl);
-
-  BlobChild(nsIContentChild* aManager, BlobChild* aOther);
-
-  BlobChild(PBackgroundChild* aManager, BlobChild* aOther, BlobImpl* aBlobImpl);
-
-  // These constructors are called on the receiving side.
-  BlobChild(nsIContentChild* aManager,
-            const ChildBlobConstructorParams& aParams);
-
-  BlobChild(PBackgroundChild* aManager,
-            const ChildBlobConstructorParams& aParams);
-
-  // These constructors are called for slices.
-  BlobChild(nsIContentChild* aManager,
-            const nsID& aParentID,
-            RemoteBlobSliceImpl* aRemoteBlobSliceImpl);
-
-  BlobChild(PBackgroundChild* aManager,
-            const nsID& aParentID,
-            RemoteBlobSliceImpl* aRemoteBlobSliceImpl);
-
-  // Only called by Destroy().
-  ~BlobChild();
-
-  void
-  CommonInit(BlobImpl* aBlobImpl);
-
-  void
-  CommonInit(BlobChild* aOther, BlobImpl* aBlobImpl);
-
-  void
-  CommonInit(const ChildBlobConstructorParams& aParams);
-
-  void
-  CommonInit(const nsID& aParentID, RemoteBlobImpl* aRemoteBlobImpl);
-
-  template <class ChildManagerType>
-  static BlobChild*
-  GetOrCreateFromImpl(ChildManagerType* aManager, BlobImpl* aBlobImpl);
-
-  template <class ChildManagerType>
-  static BlobChild*
-  CreateFromParams(ChildManagerType* aManager,
-                   const ChildBlobConstructorParams& aParams);
-
-  template <class ChildManagerType>
-  static BlobChild*
-  SendSliceConstructor(ChildManagerType* aManager,
-                       RemoteBlobSliceImpl* aRemoteBlobSliceImpl,
-                       const ParentBlobConstructorParams& aParams);
-
-  static BlobChild*
-  MaybeGetActorFromRemoteBlob(nsIRemoteBlob* aRemoteBlob,
-                              nsIContentChild* aManager,
-                              BlobImpl* aBlobImpl);
-
-  static BlobChild*
-  MaybeGetActorFromRemoteBlob(nsIRemoteBlob* aRemoteBlob,
-                              PBackgroundChild* aManager,
-                              BlobImpl* aBlobImpl);
-
-  void
-  NoteDyingRemoteBlobImpl();
-
-  nsIEventTarget*
-  EventTarget() const
-  {
-    return mEventTarget;
-  }
-
-  bool
-  IsOnOwningThread() const;
-
-  // These methods are only called by the IPDL message machinery.
-  virtual void
-  ActorDestroy(ActorDestroyReason aWhy) override;
-
-  virtual mozilla::ipc::IPCResult
-  RecvCreatedFromKnownBlob() override;
-};
-
-// Only let ContentChild call BlobChild::Startup() and ensure that
-// ContentChild can't access any other BlobChild internals.
-class BlobChild::FriendKey final
-{
-  friend class ContentChild;
-
-private:
-  FriendKey()
-  { }
-
-  FriendKey(const FriendKey& /* aOther */)
-  { }
-
-public:
-  ~FriendKey()
-  { }
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_ipc_BlobChild_h
deleted file mode 100644
--- a/dom/file/ipc/BlobParent.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_ipc_BlobParent_h
-#define mozilla_dom_ipc_BlobParent_h
-
-#include "mozilla/Attributes.h"
-#include "mozilla/StaticPtr.h"
-#include "mozilla/dom/PBlobParent.h"
-#include "nsCOMPtr.h"
-#include "nsTArray.h"
-
-template <class, class> class nsDataHashtable;
-class nsIDHashKey;
-class nsIEventTarget;
-class nsIRemoteBlob;
-template <class> class nsRevocableEventPtr;
-class nsString;
-
-namespace mozilla {
-
-class Mutex;
-
-namespace ipc {
-
-class PBackgroundParent;
-
-} // namespace ipc
-
-namespace dom {
-
-class ContentParent;
-class BlobImpl;
-class nsIContentParent;
-
-class BlobParent final
-  : public PBlobParent
-{
-  typedef mozilla::ipc::PBackgroundParent PBackgroundParent;
-
-  class IDTableEntry;
-  typedef nsDataHashtable<nsIDHashKey, IDTableEntry*> IDTable;
-
-  class RemoteBlobImpl;
-
-  struct CreateBlobImplMetadata;
-
-  static StaticAutoPtr<IDTable> sIDTable;
-  static StaticAutoPtr<Mutex> sIDTableMutex;
-
-  BlobImpl* mBlobImpl;
-  RemoteBlobImpl* mRemoteBlobImpl;
-
-  // One of these will be null and the other non-null.
-  PBackgroundParent* mBackgroundManager;
-  nsCOMPtr<nsIContentParent> mContentManager;
-
-  nsCOMPtr<nsIEventTarget> mEventTarget;
-
-  RefPtr<IDTableEntry> mIDTableEntry;
-
-  bool mOwnsBlobImpl;
-
-public:
-  class FriendKey;
-
-  static void
-  Startup(const FriendKey& aKey);
-
-  // These create functions are called on the sending side.
-  static BlobParent*
-  GetOrCreate(nsIContentParent* aManager, BlobImpl* aBlobImpl);
-
-  static BlobParent*
-  GetOrCreate(PBackgroundParent* aManager, BlobImpl* aBlobImpl);
-
-  // These create functions are called on the receiving side.
-  static BlobParent*
-  Create(nsIContentParent* aManager,
-         const ParentBlobConstructorParams& aParams);
-
-  static BlobParent*
-  Create(PBackgroundParent* aManager,
-         const ParentBlobConstructorParams& aParams);
-
-  static void
-  Destroy(PBlobParent* aActor)
-  {
-    delete static_cast<BlobParent*>(aActor);
-  }
-
-  static already_AddRefed<BlobImpl>
-  GetBlobImplForID(const nsID& aID);
-
-  bool
-  HasManager() const
-  {
-    return mBackgroundManager || mContentManager;
-  }
-
-  PBackgroundParent*
-  GetBackgroundManager() const
-  {
-    return mBackgroundManager;
-  }
-
-  nsIContentParent*
-  GetContentManager() const
-  {
-    return mContentManager;
-  }
-
-  // Get the BlobImpl associated with this actor.
-  already_AddRefed<BlobImpl>
-  GetBlobImpl();
-
-  void
-  AssertIsOnOwningThread() const
-#ifdef DEBUG
-  ;
-#else
-  { }
-#endif
-
-private:
-  // These constructors are called on the sending side.
-  BlobParent(nsIContentParent* aManager, IDTableEntry* aIDTableEntry);
-
-  BlobParent(PBackgroundParent* aManager, IDTableEntry* aIDTableEntry);
-
-  // These constructors are called on the receiving side.
-  BlobParent(nsIContentParent* aManager,
-             BlobImpl* aBlobImpl,
-             IDTableEntry* aIDTableEntry);
-
-  BlobParent(PBackgroundParent* aManager,
-             BlobImpl* aBlobImpl,
-             IDTableEntry* aIDTableEntry);
-
-  // Only destroyed by BackgroundParentImpl and ContentParent.
-  ~BlobParent();
-
-  void
-  CommonInit(IDTableEntry* aIDTableEntry);
-
-  void
-  CommonInit(BlobImpl* aBlobImpl, IDTableEntry* aIDTableEntry);
-
-  template <class ParentManagerType>
-  static BlobParent*
-  GetOrCreateFromImpl(ParentManagerType* aManager,
-                      BlobImpl* aBlobImpl);
-
-  template <class ParentManagerType>
-  static BlobParent*
-  CreateFromParams(ParentManagerType* aManager,
-                   const ParentBlobConstructorParams& aParams);
-
-  template <class ParentManagerType>
-  static BlobParent*
-  SendSliceConstructor(ParentManagerType* aManager,
-                       const ParentBlobConstructorParams& aParams,
-                       const ChildBlobConstructorParams& aOtherSideParams);
-
-  static BlobParent*
-  MaybeGetActorFromRemoteBlob(nsIRemoteBlob* aRemoteBlob,
-                              nsIContentParent* aManager);
-
-  static BlobParent*
-  MaybeGetActorFromRemoteBlob(nsIRemoteBlob* aRemoteBlob,
-                              PBackgroundParent* aManager);
-
-  void
-  NoteDyingRemoteBlobImpl();
-
-  nsIEventTarget*
-  EventTarget() const
-  {
-    return mEventTarget;
-  }
-
-  bool
-  IsOnOwningThread() const;
-
-  // These methods are only called by the IPDL message machinery.
-  virtual void
-  ActorDestroy(ActorDestroyReason aWhy) override;
-
-  virtual mozilla::ipc::IPCResult
-  RecvResolveMystery(const ResolveMysteryParams& aParams) override;
-
-  virtual mozilla::ipc::IPCResult
-  RecvWaitForSliceCreation() override;
-
-  virtual mozilla::ipc::IPCResult
-  RecvGetFileId(int64_t* aFileId) override;
-
-  virtual mozilla::ipc::IPCResult
-  RecvGetFilePath(nsString* aFilePath) override;
-};
-
-// Only let ContentParent call BlobParent::Startup() and ensure that
-// ContentParent can't access any other BlobParent internals.
-class BlobParent::FriendKey final
-{
-  friend class ContentParent;
-
-private:
-  FriendKey()
-  { }
-
-  FriendKey(const FriendKey& /* aOther */)
-  { }
-
-public:
-  ~FriendKey()
-  { }
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_ipc_BlobParent_h
--- a/dom/file/ipc/IPCBlobUtils.cpp
+++ b/dom/file/ipc/IPCBlobUtils.cpp
@@ -5,19 +5,25 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "IPCBlobUtils.h"
 #include "IPCBlobInputStream.h"
 #include "IPCBlobInputStreamChild.h"
 #include "IPCBlobInputStreamParent.h"
 #include "IPCBlobInputStreamStorage.h"
 #include "mozilla/dom/IPCBlob.h"
+#include "mozilla/dom/nsIContentParent.h"
+#include "mozilla/ipc/IPCStreamUtils.h"
+#include "StreamBlobImpl.h"
 #include "prtime.h"
 
 namespace mozilla {
+
+using namespace ipc;
+
 namespace dom {
 namespace IPCBlobUtils {
 
 already_AddRefed<BlobImpl>
 Deserialize(const IPCBlob& aIPCBlob)
 {
   nsCOMPtr<nsIInputStream> inputStream;
 
--- a/dom/file/ipc/IPCBlobUtils.h
+++ b/dom/file/ipc/IPCBlobUtils.h
@@ -135,16 +135,17 @@ namespace mozilla {
 
 namespace ipc {
 class PBackgroundChild;
 class PBackgroundParent;
 }
 
 namespace dom {
 
+class IPCBlob;
 class nsIContentChild;
 class nsIContentParent;
 
 namespace IPCBlobUtils {
 
 already_AddRefed<BlobImpl>
 Deserialize(const IPCBlob& aIPCBlob);
 
deleted file mode 100644
--- a/dom/file/ipc/PBlob.ipdl
+++ /dev/null
@@ -1,51 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-include protocol PBackground;
-include protocol PContent;
-include protocol PContentBridge;
-include protocol PFileDescriptorSet;
-include protocol PChildToParentStream;
-include protocol PParentToChildStream;
-
-include BlobTypes;
-include DOMTypes;
-include InputStreamParams;
-
-namespace mozilla {
-namespace dom {
-
-union ResolveMysteryParams
-{
-  NormalBlobConstructorParams;
-  FileBlobConstructorParams;
-};
-
-sync protocol PBlob
-{
-  manager PBackground or PContent or PContentBridge;
-
-both:
-  async __delete__();
-
-parent:
-  async ResolveMystery(ResolveMysteryParams params);
-
-  sync WaitForSliceCreation();
-
-  // Use only for testing!
-  sync GetFileId()
-    returns (int64_t fileId);
-
-  sync GetFilePath()
-    returns (nsString filePath);
-
-child:
-  // This method must be called by the parent when the PBlobParent is fully
-  // created in order to release the known blob.
-  async CreatedFromKnownBlob();
-};
-
-} // namespace dom
-} // namespace mozilla
--- a/dom/file/ipc/PendingIPCBlobParent.cpp
+++ b/dom/file/ipc/PendingIPCBlobParent.cpp
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "PendingIPCBlobParent.h"
+#include "mozilla/ipc/PBackgroundParent.h"
 
 namespace mozilla {
 
 using namespace ipc;
 
 namespace dom {
 
 /* static */
--- a/dom/file/ipc/moz.build
+++ b/dom/file/ipc/moz.build
@@ -1,45 +1,41 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 EXPORTS.mozilla.dom.ipc += [
-    'BlobChild.h',
-    'BlobParent.h',
     'IPCBlobInputStream.h',
     'IPCBlobInputStreamChild.h',
     'IPCBlobInputStreamParent.h',
     'IPCBlobInputStreamStorage.h',
     'nsIRemoteBlob.h',
     'PendingIPCBlobChild.h',
     'PendingIPCBlobParent.h',
 ]
 
 EXPORTS.mozilla.dom += [
     'IPCBlobUtils.h',
 ]
 
 UNIFIED_SOURCES += [
-    'Blob.cpp',
     'IPCBlobInputStream.cpp',
     'IPCBlobInputStreamChild.cpp',
     'IPCBlobInputStreamParent.cpp',
     'IPCBlobInputStreamStorage.cpp',
     'IPCBlobUtils.cpp',
     'PendingIPCBlobChild.cpp',
     'PendingIPCBlobParent.cpp',
 ]
 
 IPDL_SOURCES += [
     'BlobTypes.ipdlh',
     'IPCBlob.ipdlh',
-    'PBlob.ipdl',
     'PIPCBlobInputStream.ipdl',
     'PPendingIPCBlob.ipdl',
 ]
 
 LOCAL_INCLUDES += [
     '/dom/file',
     '/dom/ipc',
     '/dom/workers',
--- a/dom/file/ipc/nsIRemoteBlob.h
+++ b/dom/file/ipc/nsIRemoteBlob.h
@@ -13,33 +13,20 @@
 #define NS_NO_VTABLE
 #endif
 
 #define NS_IREMOTEBLOB_IID \
   {0x0b8b0091, 0xb315, 0x48a2, {0x90, 0xf1, 0x60, 0x0e, 0x78, 0x35, 0xf7, 0x2d}}
 
 namespace mozilla {
 namespace dom {
-
-class BlobChild;
-class BlobParent;
-
 } // namespace dom
 } // namespace mozilla
 
 class NS_NO_VTABLE nsIRemoteBlob : public nsISupports
 {
 public:
-  typedef mozilla::dom::BlobChild BlobChild;
-  typedef mozilla::dom::BlobParent BlobParent;
-
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IREMOTEBLOB_IID)
-
-  virtual BlobChild*
-  GetBlobChild() = 0;
-
-  virtual BlobParent*
-  GetBlobParent() = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIRemoteBlob, NS_IREMOTEBLOB_IID)
 
 #endif // mozilla_dom_ipc_nsIRemoteBlob_h
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -33,17 +33,16 @@
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/IDBMutableFileBinding.h"
 #include "mozilla/dom/BlobBinding.h"
 #include "mozilla/dom/IDBObjectStoreBinding.h"
 #include "mozilla/dom/MemoryBlobImpl.h"
 #include "mozilla/dom/StructuredCloneHolder.h"
 #include "mozilla/dom/StructuredCloneTags.h"
 #include "mozilla/dom/indexedDB/PBackgroundIDBSharedTypes.h"
-#include "mozilla/dom/ipc/BlobChild.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/PBackgroundSharedTypes.h"
 #include "nsCOMPtr.h"
 #include "nsQueryObject.h"
 #include "ProfilerHelpers.h"
 #include "ReportInternalError.h"
 #include "WorkerPrivate.h"
 #include "WorkerScope.h"
--- a/dom/ipc/ContentBridgeChild.cpp
+++ b/dom/ipc/ContentBridgeChild.cpp
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/ContentBridgeChild.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/TabChild.h"
-#include "mozilla/dom/ipc/BlobChild.h"
 #include "mozilla/jsipc/CrossProcessObjectWrappers.h"
 #include "mozilla/ipc/InputStreamUtils.h"
 #include "base/task.h"
 
 using namespace mozilla::ipc;
 using namespace mozilla::jsipc;
 
 namespace mozilla {
@@ -56,23 +55,16 @@ mozilla::ipc::IPCResult
 ContentBridgeChild::RecvAsyncMessage(const nsString& aMsg,
                                      InfallibleTArray<jsipc::CpowEntry>&& aCpows,
                                      const IPC::Principal& aPrincipal,
                                      const ClonedMessageData& aData)
 {
   return nsIContentChild::RecvAsyncMessage(aMsg, Move(aCpows), aPrincipal, aData);
 }
 
-PBlobChild*
-ContentBridgeChild::SendPBlobConstructor(PBlobChild* actor,
-                                         const BlobConstructorParams& params)
-{
-  return PContentBridgeChild::SendPBlobConstructor(actor, params);
-}
-
 bool
 ContentBridgeChild::SendPBrowserConstructor(PBrowserChild* aActor,
                                             const TabId& aTabId,
                                             const TabId& aSameTabGroupAs,
                                             const IPCTabContext& aContext,
                                             const uint32_t& aChromeFlags,
                                             const ContentParentId& aCpID,
                                             const bool& aIsForBrowser)
@@ -157,28 +149,16 @@ ContentBridgeChild::RecvPBrowserConstruc
                                                   aTabId,
                                                   aSameTabGroupAs,
                                                   aContext,
                                                   aChromeFlags,
                                                   aCpID,
                                                   aIsForBrowser);
 }
 
-PBlobChild*
-ContentBridgeChild::AllocPBlobChild(const BlobConstructorParams& aParams)
-{
-  return nsIContentChild::AllocPBlobChild(aParams);
-}
-
-bool
-ContentBridgeChild::DeallocPBlobChild(PBlobChild* aActor)
-{
-  return nsIContentChild::DeallocPBlobChild(aActor);
-}
-
 PIPCBlobInputStreamChild*
 ContentBridgeChild::AllocPIPCBlobInputStreamChild(const nsID& aID,
                                                   const uint64_t& aSize)
 {
   return nsIContentChild::AllocPIPCBlobInputStreamChild(aID, aSize);
 }
 
 bool
--- a/dom/ipc/ContentBridgeChild.h
+++ b/dom/ipc/ContentBridgeChild.h
@@ -27,20 +27,16 @@ public:
   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
   void DeferredDestroy();
 
   virtual mozilla::ipc::IPCResult RecvAsyncMessage(const nsString& aMsg,
                                                    InfallibleTArray<jsipc::CpowEntry>&& aCpows,
                                                    const IPC::Principal& aPrincipal,
                                                    const ClonedMessageData& aData) override;
 
-  virtual PBlobChild*
-  SendPBlobConstructor(PBlobChild* actor,
-                       const BlobConstructorParams& aParams) override;
-
   jsipc::CPOWManager* GetCPOWManager() override;
 
   virtual bool SendPBrowserConstructor(PBrowserChild* aActor,
                                        const TabId& aTabId,
                                        const TabId& aSameTabGroupAs,
                                        const IPCTabContext& aContext,
                                        const uint32_t& aChromeFlags,
                                        const ContentParentId& aCpID,
@@ -77,19 +73,16 @@ protected:
                                                           const IPCTabContext& aContext,
                                                           const uint32_t& aChromeFlags,
                                                           const ContentParentId& aCpID,
                                                           const bool& aIsForBrowser) override;
 
   virtual mozilla::jsipc::PJavaScriptChild* AllocPJavaScriptChild() override;
   virtual bool DeallocPJavaScriptChild(mozilla::jsipc::PJavaScriptChild*) override;
 
-  virtual PBlobChild* AllocPBlobChild(const BlobConstructorParams& aParams) override;
-  virtual bool DeallocPBlobChild(PBlobChild*) override;
-
   virtual PIPCBlobInputStreamChild*
   AllocPIPCBlobInputStreamChild(const nsID& aID,
                                 const uint64_t& aSize) override;
 
   virtual bool
   DeallocPIPCBlobInputStreamChild(PIPCBlobInputStreamChild*) override;
 
   virtual mozilla::ipc::PChildToParentStreamChild*
--- a/dom/ipc/ContentBridgeParent.cpp
+++ b/dom/ipc/ContentBridgeParent.cpp
@@ -82,23 +82,16 @@ ContentBridgeParent::RecvAsyncMessage(co
                                       InfallibleTArray<jsipc::CpowEntry>&& aCpows,
                                       const IPC::Principal& aPrincipal,
                                       const ClonedMessageData& aData)
 {
   return nsIContentParent::RecvAsyncMessage(aMsg, Move(aCpows),
                                             aPrincipal, aData);
 }
 
-PBlobParent*
-ContentBridgeParent::SendPBlobConstructor(PBlobParent* actor,
-                                          const BlobConstructorParams& params)
-{
-  return PContentBridgeParent::SendPBlobConstructor(actor, params);
-}
-
 PBrowserParent*
 ContentBridgeParent::SendPBrowserConstructor(PBrowserParent* aActor,
                                              const TabId& aTabId,
                                              const TabId& aSameTabGroupAs,
                                              const IPCTabContext& aContext,
                                              const uint32_t& aChromeFlags,
                                              const ContentParentId& aCpID,
                                              const bool& aIsForBrowser)
@@ -113,28 +106,16 @@ ContentBridgeParent::SendPBrowserConstru
 }
 
 PParentToChildStreamParent*
 ContentBridgeParent::SendPParentToChildStreamConstructor(PParentToChildStreamParent* aActor)
 {
   return PContentBridgeParent::SendPParentToChildStreamConstructor(aActor);
 }
 
-PBlobParent*
-ContentBridgeParent::AllocPBlobParent(const BlobConstructorParams& aParams)
-{
-  return nsIContentParent::AllocPBlobParent(aParams);
-}
-
-bool
-ContentBridgeParent::DeallocPBlobParent(PBlobParent* aActor)
-{
-  return nsIContentParent::DeallocPBlobParent(aActor);
-}
-
 PIPCBlobInputStreamParent*
 ContentBridgeParent::SendPIPCBlobInputStreamConstructor(PIPCBlobInputStreamParent* aActor,
                                                         const nsID& aID,
                                                         const uint64_t& aSize)
 {
   return
     PContentBridgeParent::SendPIPCBlobInputStreamConstructor(aActor, aID, aSize);
 }
--- a/dom/ipc/ContentBridgeParent.h
+++ b/dom/ipc/ContentBridgeParent.h
@@ -28,20 +28,16 @@ public:
   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
   void DeferredDestroy();
   virtual bool IsContentBridgeParent() const override { return true; }
   void NotifyTabDestroyed();
 
   static ContentBridgeParent*
   Create(Endpoint<PContentBridgeParent>&& aEndpoint);
 
-  virtual PBlobParent*
-  SendPBlobConstructor(PBlobParent* actor,
-                       const BlobConstructorParams& params) override;
-
   virtual PBrowserParent*
   SendPBrowserConstructor(PBrowserParent* aActor,
                           const TabId& aTabId,
                           const TabId& aSameTabGroupAs,
                           const IPCTabContext& aContext,
                           const uint32_t& aChromeFlags,
                           const ContentParentId& aCpID,
                           const bool& aIsForBrowser) override;
@@ -128,21 +124,16 @@ protected:
                       const TabId& aSameTabGroupAs,
                       const IPCTabContext &aContext,
                       const uint32_t& aChromeFlags,
                       const ContentParentId& aCpID,
                       const bool& aIsForBrowser) override;
 
   virtual bool DeallocPBrowserParent(PBrowserParent*) override;
 
-  virtual PBlobParent*
-  AllocPBlobParent(const BlobConstructorParams& aParams) override;
-
-  virtual bool DeallocPBlobParent(PBlobParent*) override;
-
   virtual PIPCBlobInputStreamParent*
   SendPIPCBlobInputStreamConstructor(PIPCBlobInputStreamParent* aActor,
                                      const nsID& aID,
                                      const uint64_t& aSize) override;
 
   virtual PIPCBlobInputStreamParent*
   AllocPIPCBlobInputStreamParent(const nsID& aID,
                                  const uint64_t& aSize) override;
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -36,17 +36,16 @@
 #include "mozilla/dom/ProcessGlobal.h"
 #include "mozilla/dom/PushNotifier.h"
 #include "mozilla/dom/LocalStorage.h"
 #include "mozilla/dom/StorageIPC.h"
 #include "mozilla/dom/TabGroup.h"
 #include "mozilla/dom/workers/ServiceWorkerManager.h"
 #include "mozilla/dom/nsIContentChild.h"
 #include "mozilla/dom/URLClassifierChild.h"
-#include "mozilla/dom/ipc/BlobChild.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/psm/PSMContentListener.h"
 #include "mozilla/hal_sandbox/PHalChild.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/FileDescriptorSetChild.h"
 #include "mozilla/ipc/FileDescriptorUtils.h"
 #include "mozilla/ipc/GeckoChildProcessHost.h"
 #include "mozilla/ipc/ProcessChild.h"
@@ -984,18 +983,16 @@ ContentChild::InitXPCOM(const XPCOMInitD
   BackgroundChild::Startup();
 
   nsCOMPtr<nsIIPCBackgroundChildCreateCallback> callback =
     new BackgroundChildPrimer();
   if (!BackgroundChild::GetOrCreateForCurrentThread(callback)) {
     MOZ_CRASH("Failed to create PBackgroundChild!");
   }
 
-  BlobChild::Startup(BlobChild::FriendKey());
-
   nsCOMPtr<nsIConsoleService> svc(do_GetService(NS_CONSOLESERVICE_CONTRACTID));
   if (!svc) {
     NS_WARNING("Couldn't acquire console service");
     return;
   }
 
   mConsoleListener = new ConsoleListener(this);
   if (NS_FAILED(svc->RegisterListener(mConsoleListener)))
@@ -1641,53 +1638,30 @@ ContentChild::AllocPIPCBlobInputStreamCh
 }
 
 bool
 ContentChild::DeallocPIPCBlobInputStreamChild(PIPCBlobInputStreamChild* aActor)
 {
   return nsIContentChild::DeallocPIPCBlobInputStreamChild(aActor);
 }
 
-PBlobChild*
-ContentChild::AllocPBlobChild(const BlobConstructorParams& aParams)
-{
-  return nsIContentChild::AllocPBlobChild(aParams);
-}
-
 mozilla::PRemoteSpellcheckEngineChild *
 ContentChild::AllocPRemoteSpellcheckEngineChild()
 {
   MOZ_CRASH("Default Constructor for PRemoteSpellcheckEngineChild should never be called");
   return nullptr;
 }
 
 bool
 ContentChild::DeallocPRemoteSpellcheckEngineChild(PRemoteSpellcheckEngineChild *child)
 {
   delete child;
   return true;
 }
 
-bool
-ContentChild::DeallocPBlobChild(PBlobChild* aActor)
-{
-  return nsIContentChild::DeallocPBlobChild(aActor);
-}
-
-PBlobChild*
-ContentChild::SendPBlobConstructor(PBlobChild* aActor,
-                                   const BlobConstructorParams& aParams)
-{
-  if (IsShuttingDown()) {
-    return nullptr;
-  }
-
-  return PContentChild::SendPBlobConstructor(aActor, aParams);
-}
-
 PPresentationChild*
 ContentChild::AllocPPresentationChild()
 {
   MOZ_CRASH("We should never be manually allocating PPresentationChild actors");
   return nullptr;
 }
 
 bool
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -179,21 +179,16 @@ public:
                                             const TabId& aSameTabGroupAs,
                                             const IPCTabContext& aContext,
                                             const uint32_t& aChromeFlags,
                                             const ContentParentId& aCpID,
                                             const bool& aIsForBrowser) override;
 
   virtual bool DeallocPBrowserChild(PBrowserChild*) override;
 
-  virtual PBlobChild*
-  AllocPBlobChild(const BlobConstructorParams& aParams) override;
-
-  virtual bool DeallocPBlobChild(PBlobChild* aActor) override;
-
   virtual PIPCBlobInputStreamChild*
   AllocPIPCBlobInputStreamChild(const nsID& aID,
                                 const uint64_t& aSize) override;
 
   virtual bool
   DeallocPIPCBlobInputStreamChild(PIPCBlobInputStreamChild* aActor) override;
 
   virtual PHalChild* AllocPHalChild() override;
@@ -508,20 +503,16 @@ public:
   ContentParentId GetID() const { return mID; }
 
 #if defined(XP_WIN) && defined(ACCESSIBILITY)
   uint32_t GetMsaaID() const { return mMsaaID; }
 #endif
 
   bool IsForBrowser() const { return mIsForBrowser; }
 
-  virtual PBlobChild*
-  SendPBlobConstructor(PBlobChild* actor,
-                       const BlobConstructorParams& params) override;
-
   virtual PFileDescriptorSetChild*
   SendPFileDescriptorSetConstructor(const FileDescriptor&) override;
 
   virtual PFileDescriptorSetChild*
   AllocPFileDescriptorSetChild(const FileDescriptor&) override;
 
   virtual bool
   DeallocPFileDescriptorSetChild(PFileDescriptorSetChild*) override;
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -61,17 +61,16 @@
 #include "mozilla/dom/Permissions.h"
 #include "mozilla/dom/PresentationParent.h"
 #include "mozilla/dom/PPresentationParent.h"
 #include "mozilla/dom/PushNotifier.h"
 #include "mozilla/dom/FlyWebPublishedServerIPC.h"
 #include "mozilla/dom/quota/QuotaManagerService.h"
 #include "mozilla/dom/time/DateCacheCleaner.h"
 #include "mozilla/dom/URLClassifierParent.h"
-#include "mozilla/dom/ipc/BlobParent.h"
 #include "mozilla/embedding/printingui/PrintingParent.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/gfx/GPUProcessManager.h"
 #include "mozilla/hal_sandbox/PHalParent.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/BackgroundParent.h"
 #include "mozilla/ipc/FileDescriptorUtils.h"
 #include "mozilla/ipc/PChildToParentStreamParent.h"
@@ -626,18 +625,16 @@ ContentParent::StartUp()
   }
 #endif
 
   // Note: This reporter measures all ContentParents.
   RegisterStrongMemoryReporter(new ContentParentsMemoryReporter());
 
   mozilla::dom::time::InitializeDateCacheCleaner();
 
-  BlobParent::Startup(BlobParent::FriendKey());
-
   BackgroundChild::Startup();
 
   sDisableUnsafeCPOWWarnings = PR_GetEnv("DISABLE_UNSAFE_CPOW_WARNINGS");
 
 #if defined(XP_LINUX) && defined(MOZ_CONTENT_SANDBOX)
   sSandboxBrokerPolicyFactory = MakeUnique<SandboxBrokerPolicyFactory>();
 #endif
 }
@@ -2833,56 +2830,29 @@ ContentParent::AllocPBrowserParent(const
 }
 
 bool
 ContentParent::DeallocPBrowserParent(PBrowserParent* frame)
 {
   return nsIContentParent::DeallocPBrowserParent(frame);
 }
 
-PBlobParent*
-ContentParent::AllocPBlobParent(const BlobConstructorParams& aParams)
-{
-  return nsIContentParent::AllocPBlobParent(aParams);
-}
-
-bool
-ContentParent::DeallocPBlobParent(PBlobParent* aActor)
-{
-  return nsIContentParent::DeallocPBlobParent(aActor);
-}
-
 PIPCBlobInputStreamParent*
 ContentParent::AllocPIPCBlobInputStreamParent(const nsID& aID,
                                               const uint64_t& aSize)
 {
   return nsIContentParent::AllocPIPCBlobInputStreamParent(aID, aSize);
 }
 
 bool
 ContentParent::DeallocPIPCBlobInputStreamParent(PIPCBlobInputStreamParent* aActor)
 {
   return nsIContentParent::DeallocPIPCBlobInputStreamParent(aActor);
 }
 
-mozilla::ipc::IPCResult
-ContentParent::RecvPBlobConstructor(PBlobParent* aActor,
-                                    const BlobConstructorParams& aParams)
-{
-  const ParentBlobConstructorParams& params = aParams.get_ParentBlobConstructorParams();
-  if (params.blobParams().type() == AnyBlobConstructorParams::TKnownBlobConstructorParams) {
-    if (!aActor->SendCreatedFromKnownBlob()) {
-      return IPC_FAIL_NO_REASON(this);
-    }
-    return IPC_OK();
-  }
-
-  return IPC_OK();
-}
-
 mozilla::PRemoteSpellcheckEngineParent *
 ContentParent::AllocPRemoteSpellcheckEngineParent()
 {
   mozilla::RemoteSpellcheckEngineParent *parent = new mozilla::RemoteSpellcheckEngineParent();
   return parent;
 }
 
 bool
@@ -3861,23 +3831,16 @@ ContentParent::DoSendAsyncMessage(JSCont
     return NS_ERROR_UNEXPECTED;
   }
   if (!SendAsyncMessage(nsString(aMessage), cpows, Principal(aPrincipal), data)) {
     return NS_ERROR_UNEXPECTED;
   }
   return NS_OK;
 }
 
-PBlobParent*
-ContentParent::SendPBlobConstructor(PBlobParent* aActor,
-                                    const BlobConstructorParams& aParams)
-{
-  return PContentParent::SendPBlobConstructor(aActor, aParams);
-}
-
 PIPCBlobInputStreamParent*
 ContentParent::SendPIPCBlobInputStreamConstructor(PIPCBlobInputStreamParent* aActor,
                                                   const nsID& aID,
                                                   const uint64_t& aSize)
 {
   return PContentParent::SendPIPCBlobInputStreamConstructor(aActor, aID, aSize);
 }
 
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -477,20 +477,16 @@ public:
                                                             const nsString& aPageURL,
                                                             const bool& aIsAudio,
                                                             const bool& aIsVideo) override;
 
   bool CycleCollectWithLogs(bool aDumpAllTraces,
                             nsICycleCollectorLogSink* aSink,
                             nsIDumpGCAndCCLogsCallback* aCallback);
 
-  virtual PBlobParent*
-  SendPBlobConstructor(PBlobParent* aActor,
-                       const BlobConstructorParams& aParams) override;
-
   virtual mozilla::ipc::IPCResult RecvUnregisterRemoteFrame(const TabId& aTabId,
                                                             const ContentParentId& aCpId,
                                                             const bool& aMarkedDestroying) override;
 
   virtual mozilla::ipc::IPCResult RecvNotifyTabDestroying(const TabId& aTabId,
                                                           const ContentParentId& aCpId) override;
 
   virtual mozilla::ipc::IPCResult RecvTabChildNotReady(const TabId& aTabId) override;
@@ -839,37 +835,28 @@ private:
                                               const TabId& aSameTabGroupAs,
                                               const IPCTabContext& aContext,
                                               const uint32_t& aChromeFlags,
                                               const ContentParentId& aCpId,
                                               const bool& aIsForBrowser) override;
 
   virtual bool DeallocPBrowserParent(PBrowserParent* frame) override;
 
-  virtual PBlobParent*
-  AllocPBlobParent(const BlobConstructorParams& aParams) override;
-
-  virtual bool DeallocPBlobParent(PBlobParent* aActor) override;
-
   virtual PIPCBlobInputStreamParent*
   SendPIPCBlobInputStreamConstructor(PIPCBlobInputStreamParent* aActor,
                                      const nsID& aID,
                                      const uint64_t& aSize) override;
 
   virtual PIPCBlobInputStreamParent*
   AllocPIPCBlobInputStreamParent(const nsID& aID,
                                  const uint64_t& aSize) override;
 
   virtual bool
   DeallocPIPCBlobInputStreamParent(PIPCBlobInputStreamParent* aActor) override;
 
-  virtual mozilla::ipc::IPCResult
-  RecvPBlobConstructor(PBlobParent* aActor,
-                       const BlobConstructorParams& params) override;
-
   virtual mozilla::ipc::IPCResult RecvNSSU2FTokenIsCompatibleVersion(const nsString& aVersion,
                                                                      bool* aIsCompatible) override;
 
   virtual mozilla::ipc::IPCResult RecvNSSU2FTokenIsRegistered(nsTArray<uint8_t>&& aKeyHandle,
                                                               nsTArray<uint8_t>&& aApplication,
                                                               bool* aIsValidKeyHandle) override;
 
   virtual mozilla::ipc::IPCResult RecvNSSU2FTokenRegister(nsTArray<uint8_t>&& aApplication,
--- a/dom/ipc/DOMTypes.ipdlh
+++ b/dom/ipc/DOMTypes.ipdlh
@@ -1,16 +1,14 @@
 /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
 /* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-include protocol PBlob;
-
 include IPCBlob;
 include IPCStream;
 include ProtocolTypes;
 
 using struct mozilla::void_t
   from "ipc/IPCMessageUtils.h";
 
 using struct mozilla::SerializedStructuredCloneBuffer
@@ -91,17 +89,17 @@ struct FileBlobConstructorParams
 
   // This must be of type BlobData in a child->parent message, and will always
   // be of type void_t in a parent->child message.
   OptionalBlobData optionalBlobData;
 };
 
 struct SlicedBlobConstructorParams
 {
-  PBlob source;
+  // broken structure: PBlob source;
   nsID id;
   uint64_t begin;
   uint64_t end;
   nsString contentType;
 };
 
 struct MysteryBlobConstructorParams
 {
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
 /* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
 
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-include protocol PBlob;
 include protocol PColorPicker;
 include protocol PContent;
 include protocol PContentBridge;
 include protocol PDocAccessible;
 include protocol PDocumentRenderer;
 include protocol PFilePicker;
 include protocol PIndexedDBPermissionRequest;
 include protocol PRenderFrame;
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
 /* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 include protocol PBackground;
-include protocol PBlob;
 include protocol PBrowser;
 include protocol PCompositorBridge;
 include protocol PContentBridge;
 include protocol PContentPermissionRequest;
 include protocol PCycleCollectWithLogs;
 include protocol PPSMContentDownloader;
 include protocol PExternalHelperApp;
 include protocol PHandlerService;
@@ -277,17 +276,16 @@ struct XPCOMInitData
 
 /**
  * The PContent protocol is a top-level protocol between the UI process
  * and a content process. There is exactly one PContentParent/PContentChild pair
  * for each content process.
  */
 nested(upto inside_cpow) sync protocol PContent
 {
-    manages PBlob;
     manages PBrowser;
     manages PContentPermissionRequest;
     manages PCycleCollectWithLogs;
     manages PPSMContentDownloader;
     manages PExternalHelperApp;
     manages PFileDescriptorSet;
     manages PHal;
     manages PHandlerService;
@@ -334,18 +332,16 @@ both:
     // TabGroup as |sameTabGroupAs|. This parameter should always be zero
     // for PBrowser messages sent from the child to the parent.
     //
     // Keep the last 3 attributes in sync with GetProcessAttributes!
     async PBrowser(TabId tabId, TabId sameTabGroupAs,
                    IPCTabContext context, uint32_t chromeFlags,
                    ContentParentId cpId, bool isForBrowser);
 
-    async PBlob(BlobConstructorParams params);
-
     async PFileDescriptorSet(FileDescriptor fd);
 
     // For parent->child, aBrowser must be non-null; aOuterWindowID can
     // be 0 to indicate the browser's current root document, or nonzero
     // to persist a subdocument.  For child->parent, arguments are
     // ignored and should be null/zero.
     async PWebBrowserPersistDocument(nullable PBrowser aBrowser,
                                      uint64_t aOuterWindowID);
--- a/dom/ipc/PContentBridge.ipdl
+++ b/dom/ipc/PContentBridge.ipdl
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-include protocol PBlob;
 include protocol PBrowser;
 include protocol PContent;
 include protocol PJavaScript;
 include protocol PFileDescriptorSet;
 include protocol PChildToParentStream;
 include protocol PParentToChildStream;
 include protocol PIPCBlobInputStream;
 
@@ -32,17 +31,16 @@ namespace dom {
  * child processes.  When a child process wants to open its own child, it asks
  * the root process to create a new process and then bridge them.  The first
  * child will allocate the PContentBridgeParent, and the newly opened child will
  * allocate the PContentBridgeChild.  This protocol allows these processes to
  * share PBrowsers and send messages to each other.
  */
 nested(upto inside_cpow) sync protocol PContentBridge
 {
-    manages PBlob;
     manages PBrowser;
     manages PFileDescriptorSet;
     manages PJavaScript;
     manages PChildToParentStream;
     manages PParentToChildStream;
     manages PIPCBlobInputStream;
 
 child:
@@ -71,18 +69,16 @@ parent:
 
 both:
     // Both the parent and the child can construct the PBrowser.
     // See the comment in PContent::PBrowser().
     async PBrowser(TabId tabId, TabId sameTabGroupAs,
                    IPCTabContext context, uint32_t chromeFlags,
                    ContentParentId cpId, bool isForBrowser);
 
-    async PBlob(BlobConstructorParams params);
-
     async PFileDescriptorSet(FileDescriptor fd);
 
     async AsyncMessage(nsString aMessage, CpowEntry[] aCpows,
                        Principal aPrincipal, ClonedMessageData aData);
 };
 
 }
 }
--- a/dom/ipc/nsIContentChild.cpp
+++ b/dom/ipc/nsIContentChild.cpp
@@ -6,17 +6,16 @@
 
 #include "nsIContentChild.h"
 
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/DOMTypes.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/PermissionMessageUtils.h"
 #include "mozilla/dom/TabChild.h"
-#include "mozilla/dom/ipc/BlobChild.h"
 #include "mozilla/dom/ipc/StructuredCloneData.h"
 #include "mozilla/ipc/FileDescriptorSetChild.h"
 #include "mozilla/ipc/InputStreamUtils.h"
 #include "mozilla/ipc/IPCStreamAlloc.h"
 #include "mozilla/ipc/IPCStreamDestination.h"
 #include "mozilla/ipc/IPCStreamSource.h"
 #include "mozilla/ipc/PChildToParentStreamChild.h"
 #include "mozilla/ipc/PParentToChildStreamChild.h"
@@ -121,53 +120,16 @@ nsIContentChild::AllocPIPCBlobInputStrea
 bool
 nsIContentChild::DeallocPIPCBlobInputStreamChild(PIPCBlobInputStreamChild* aActor)
 {
   RefPtr<IPCBlobInputStreamChild> actor =
     dont_AddRef(static_cast<IPCBlobInputStreamChild*>(aActor));
   return true;
 }
 
-PBlobChild*
-nsIContentChild::AllocPBlobChild(const BlobConstructorParams& aParams)
-{
-  return BlobChild::Create(this, aParams);
-}
-
-bool
-nsIContentChild::DeallocPBlobChild(PBlobChild* aActor)
-{
-  BlobChild::Destroy(aActor);
-  return true;
-}
-
-BlobChild*
-nsIContentChild::GetOrCreateActorForBlob(Blob* aBlob)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(aBlob);
-
-  RefPtr<BlobImpl> blobImpl = aBlob->Impl();
-  MOZ_ASSERT(blobImpl);
-
-  return GetOrCreateActorForBlobImpl(blobImpl);
-}
-
-BlobChild*
-nsIContentChild::GetOrCreateActorForBlobImpl(BlobImpl* aImpl)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(aImpl);
-
-  BlobChild* actor = BlobChild::GetOrCreate(this, aImpl);
-  NS_ENSURE_TRUE(actor, nullptr);
-
-  return actor;
-}
-
 PChildToParentStreamChild*
 nsIContentChild::AllocPChildToParentStreamChild()
 {
   MOZ_CRASH("PChildToParentStreamChild actors should be manually constructed!");
 }
 
 bool
 nsIContentChild::DeallocPChildToParentStreamChild(PChildToParentStreamChild* aActor)
--- a/dom/ipc/nsIContentChild.h
+++ b/dom/ipc/nsIContentChild.h
@@ -37,38 +37,29 @@ class Shmem;
 namespace jsipc {
 class PJavaScriptChild;
 class CpowEntry;
 } // namespace jsipc
 
 namespace dom {
 
 class Blob;
-class BlobChild;
 class BlobImpl;
 class BlobConstructorParams;
 class ClonedMessageData;
 class IPCTabContext;
-class PBlobChild;
 class PBrowserChild;
 
 class nsIContentChild : public nsISupports
                       , public CPOWManagerGetter
                       , public mozilla::ipc::IShmemAllocator
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTCHILD_IID)
 
-  BlobChild* GetOrCreateActorForBlob(Blob* aBlob);
-  BlobChild* GetOrCreateActorForBlobImpl(BlobImpl* aImpl);
-
-  virtual PBlobChild*
-  SendPBlobConstructor(PBlobChild* aActor,
-                       const BlobConstructorParams& aParams) = 0;
-
   virtual bool
   SendPBrowserConstructor(PBrowserChild* aActor,
                           const TabId& aTabId,
                           const TabId& aSameTabGroupAs,
                           const IPCTabContext& aContext,
                           const uint32_t& aChromeFlags,
                           const ContentParentId& aCpID,
                           const bool& aIsForBrowser) = 0;
@@ -94,20 +85,16 @@ protected:
   virtual mozilla::ipc::IPCResult RecvPBrowserConstructor(PBrowserChild* aActor,
                                                           const TabId& aTabId,
                                                           const TabId& aSameTabGroupAs,
                                                           const IPCTabContext& aContext,
                                                           const uint32_t& aChromeFlags,
                                                           const ContentParentId& aCpID,
                                                           const bool& aIsForBrowse);
 
-  virtual PBlobChild* AllocPBlobChild(const BlobConstructorParams& aParams);
-
-  virtual bool DeallocPBlobChild(PBlobChild* aActor);
-
   virtual mozilla::ipc::PIPCBlobInputStreamChild*
   AllocPIPCBlobInputStreamChild(const nsID& aID, const uint64_t& aSize);
 
   virtual bool
   DeallocPIPCBlobInputStreamChild(mozilla::ipc::PIPCBlobInputStreamChild* aActor);
 
   virtual mozilla::ipc::PChildToParentStreamChild* AllocPChildToParentStreamChild();
 
--- a/dom/ipc/nsIContentParent.cpp
+++ b/dom/ipc/nsIContentParent.cpp
@@ -9,17 +9,16 @@
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/ContentBridgeParent.h"
 #include "mozilla/dom/ContentProcessManager.h"
 #include "mozilla/dom/PTabContext.h"
 #include "mozilla/dom/PermissionMessageUtils.h"
 #include "mozilla/dom/TabParent.h"
-#include "mozilla/dom/ipc/BlobParent.h"
 #include "mozilla/dom/ipc/IPCBlobInputStreamParent.h"
 #include "mozilla/dom/ipc/StructuredCloneData.h"
 #include "mozilla/jsipc/CrossProcessObjectWrappers.h"
 #include "mozilla/ipc/FileDescriptorSetParent.h"
 #include "mozilla/ipc/PFileDescriptorSetParent.h"
 #include "mozilla/ipc/IPCStreamAlloc.h"
 #include "mozilla/ipc/IPCStreamDestination.h"
 #include "mozilla/ipc/IPCStreamSource.h"
@@ -200,68 +199,31 @@ nsIContentParent::AllocPBrowserParent(co
 bool
 nsIContentParent::DeallocPBrowserParent(PBrowserParent* aFrame)
 {
   TabParent* parent = TabParent::GetFrom(aFrame);
   NS_RELEASE(parent);
   return true;
 }
 
-PBlobParent*
-nsIContentParent::AllocPBlobParent(const BlobConstructorParams& aParams)
-{
-  return BlobParent::Create(this, aParams);
-}
-
-bool
-nsIContentParent::DeallocPBlobParent(PBlobParent* aActor)
-{
-  BlobParent::Destroy(aActor);
-  return true;
-}
-
 PIPCBlobInputStreamParent*
 nsIContentParent::AllocPIPCBlobInputStreamParent(const nsID& aID,
                                                  const uint64_t& aSize)
 {
   MOZ_CRASH("PIPCBlobInputStreamParent actors should be manually constructed!");
   return nullptr;
 }
 
 bool
 nsIContentParent::DeallocPIPCBlobInputStreamParent(PIPCBlobInputStreamParent* aActor)
 {
   delete aActor;
   return true;
 }
 
-BlobParent*
-nsIContentParent::GetOrCreateActorForBlob(Blob* aBlob)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(aBlob);
-
-  RefPtr<BlobImpl> blobImpl = aBlob->Impl();
-  MOZ_ASSERT(blobImpl);
-
-  return GetOrCreateActorForBlobImpl(blobImpl);
-}
-
-BlobParent*
-nsIContentParent::GetOrCreateActorForBlobImpl(BlobImpl* aImpl)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(aImpl);
-
-  BlobParent* actor = BlobParent::GetOrCreate(this, aImpl);
-  NS_ENSURE_TRUE(actor, nullptr);
-
-  return actor;
-}
-
 mozilla::ipc::IPCResult
 nsIContentParent::RecvSyncMessage(const nsString& aMsg,
                                   const ClonedMessageData& aData,
                                   InfallibleTArray<CpowEntry>&& aCpows,
                                   const IPC::Principal& aPrincipal,
                                   nsTArray<ipc::StructuredCloneData>* aRetvals)
 {
   NS_LossyConvertUTF16toASCII messageNameCStr(aMsg);
--- a/dom/ipc/nsIContentParent.h
+++ b/dom/ipc/nsIContentParent.h
@@ -39,43 +39,34 @@ class PParentToChildStreamParent;
 class PIPCBlobInputStreamParent;
 }
 
 namespace dom {
 
 class Blob;
 class BlobConstructorParams;
 class BlobImpl;
-class BlobParent;
 class ContentParent;
 class ContentBridgeParent;
 class IPCTabContext;
-class PBlobParent;
 class PBrowserParent;
 
 class nsIContentParent : public nsISupports
                        , public mozilla::dom::ipc::MessageManagerCallback
                        , public CPOWManagerGetter
                        , public mozilla::ipc::IShmemAllocator
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTPARENT_IID)
 
   nsIContentParent();
 
-  BlobParent* GetOrCreateActorForBlob(Blob* aBlob);
-  BlobParent* GetOrCreateActorForBlobImpl(BlobImpl* aImpl);
-
   virtual ContentParentId ChildID() const = 0;
   virtual bool IsForBrowser() const = 0;
 
-  MOZ_MUST_USE virtual PBlobParent*
-  SendPBlobConstructor(PBlobParent* aActor,
-                       const BlobConstructorParams& aParams) = 0;
-
   virtual mozilla::ipc::PIPCBlobInputStreamParent*
   SendPIPCBlobInputStreamConstructor(mozilla::ipc::PIPCBlobInputStreamParent* aActor,
                                      const nsID& aID,
                                      const uint64_t& aSize) = 0;
 
   MOZ_MUST_USE virtual PBrowserParent*
   SendPBrowserConstructor(PBrowserParent* actor,
                           const TabId& aTabId,
@@ -120,20 +111,16 @@ protected: // IPDL methods
   virtual PBrowserParent* AllocPBrowserParent(const TabId& aTabId,
                                               const TabId& aSameTabGroupsAs,
                                               const IPCTabContext& aContext,
                                               const uint32_t& aChromeFlags,
                                               const ContentParentId& aCpId,
                                               const bool& aIsForBrowser);
   virtual bool DeallocPBrowserParent(PBrowserParent* frame);
 
-  virtual PBlobParent* AllocPBlobParent(const BlobConstructorParams& aParams);
-
-  virtual bool DeallocPBlobParent(PBlobParent* aActor);
-
   virtual mozilla::ipc::PIPCBlobInputStreamParent*
   AllocPIPCBlobInputStreamParent(const nsID& aID, const uint64_t& aSize);
 
   virtual bool
   DeallocPIPCBlobInputStreamParent(mozilla::ipc::PIPCBlobInputStreamParent* aActor);
 
   virtual mozilla::ipc::PFileDescriptorSetParent*
   AllocPFileDescriptorSetParent(const mozilla::ipc::FileDescriptor& aFD);
--- a/dom/messagechannel/SharedMessagePortMessage.cpp
+++ b/dom/messagechannel/SharedMessagePortMessage.cpp
@@ -2,18 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SharedMessagePortMessage.h"
 #include "MessagePort.h"
 #include "MessagePortChild.h"
 #include "MessagePortParent.h"
-#include "mozilla/dom/ipc/BlobChild.h"
-#include "mozilla/dom/ipc/BlobParent.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/PMessagePort.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/BackgroundParent.h"
 
 namespace mozilla {
 
 using namespace ipc;
--- a/ipc/glue/BackgroundChild.h
+++ b/ipc/glue/BackgroundChild.h
@@ -15,17 +15,16 @@ class nsIDOMBlob;
 class nsIIPCBackgroundChildCreateCallback;
 
 namespace mozilla {
 namespace dom {
 
 class BlobImpl;
 class ContentChild;
 class ContentParent;
-class PBlobChild;
 
 } // namespace dom
 
 namespace ipc {
 
 class PBackgroundChild;
 
 // This class allows access to the PBackground protocol. PBackground allows
@@ -66,24 +65,16 @@ public:
   // See above.
   static bool
   GetOrCreateForCurrentThread(nsIIPCBackgroundChildCreateCallback* aCallback);
 
   // See above.
   static PBackgroundChild*
   SynchronouslyCreateForCurrentThread();
 
-  static mozilla::dom::PBlobChild*
-  GetOrCreateActorForBlob(PBackgroundChild* aBackgroundActor,
-                          nsIDOMBlob* aBlob);
-
-  static mozilla::dom::PBlobChild*
-  GetOrCreateActorForBlobImpl(PBackgroundChild* aBackgroundActor,
-                              mozilla::dom::BlobImpl* aBlobImpl);
-
   // See above.
   static void
   CloseForCurrentThread();
 
 private:
   // Only called by ContentChild or ContentParent.
   static void
   Startup();
--- a/ipc/glue/BackgroundChildImpl.cpp
+++ b/ipc/glue/BackgroundChildImpl.cpp
@@ -11,24 +11,22 @@
 #include "ServiceWorkerManagerChild.h"
 #include "FileDescriptorSetChild.h"
 #ifdef MOZ_WEBRTC
 #include "CamerasChild.h"
 #endif
 #include "mozilla/media/MediaChild.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/SchedulerGroup.h"
-#include "mozilla/dom/PBlobChild.h"
 #include "mozilla/dom/PFileSystemRequestChild.h"
 #include "mozilla/dom/FileSystemTaskBase.h"
 #include "mozilla/dom/asmjscache/AsmJSCache.h"
 #include "mozilla/dom/cache/ActorUtils.h"
 #include "mozilla/dom/indexedDB/PBackgroundIDBFactoryChild.h"
 #include "mozilla/dom/indexedDB/PBackgroundIndexedDBUtilsChild.h"
-#include "mozilla/dom/ipc/BlobChild.h"
 #include "mozilla/dom/ipc/IPCBlobInputStreamChild.h"
 #include "mozilla/dom/ipc/PendingIPCBlobChild.h"
 #include "mozilla/dom/quota/PQuotaChild.h"
 #include "mozilla/dom/GamepadEventChannelChild.h"
 #include "mozilla/dom/GamepadTestChannelChild.h"
 #include "mozilla/dom/MessagePortChild.h"
 #include "mozilla/ipc/IPCStreamAlloc.h"
 #include "mozilla/ipc/PBackgroundTestChild.h"
@@ -198,34 +196,16 @@ BackgroundChildImpl::DeallocPBackgroundI
                                          PBackgroundIndexedDBUtilsChild* aActor)
 {
   MOZ_ASSERT(aActor);
 
   delete aActor;
   return true;
 }
 
-auto
-BackgroundChildImpl::AllocPBlobChild(const BlobConstructorParams& aParams)
-  -> PBlobChild*
-{
-  MOZ_ASSERT(aParams.type() != BlobConstructorParams::T__None);
-
-  return mozilla::dom::BlobChild::Create(this, aParams);
-}
-
-bool
-BackgroundChildImpl::DeallocPBlobChild(PBlobChild* aActor)
-{
-  MOZ_ASSERT(aActor);
-
-  mozilla::dom::BlobChild::Destroy(aActor);
-  return true;
-}
-
 PPendingIPCBlobChild*
 BackgroundChildImpl::AllocPPendingIPCBlobChild(const IPCBlob& aBlob)
 {
   return new mozilla::dom::PendingIPCBlobChild(aBlob);
 }
 
 bool
 BackgroundChildImpl::DeallocPPendingIPCBlobChild(PPendingIPCBlobChild* aActor)
--- a/ipc/glue/BackgroundChildImpl.h
+++ b/ipc/glue/BackgroundChildImpl.h
@@ -65,22 +65,16 @@ protected:
 
   virtual PBackgroundIndexedDBUtilsChild*
   AllocPBackgroundIndexedDBUtilsChild() override;
 
   virtual bool
   DeallocPBackgroundIndexedDBUtilsChild(PBackgroundIndexedDBUtilsChild* aActor)
                                         override;
 
-  virtual PBlobChild*
-  AllocPBlobChild(const BlobConstructorParams& aParams) override;
-
-  virtual bool
-  DeallocPBlobChild(PBlobChild* aActor) override;
-
   virtual PPendingIPCBlobChild*
   AllocPPendingIPCBlobChild(const IPCBlob& aBlob) override;
 
   virtual bool
   DeallocPPendingIPCBlobChild(PPendingIPCBlobChild* aActor) override;
 
   virtual PIPCBlobInputStreamChild*
   AllocPIPCBlobInputStreamChild(const nsID& aID,
--- a/ipc/glue/BackgroundImpl.cpp
+++ b/ipc/glue/BackgroundImpl.cpp
@@ -19,18 +19,16 @@
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Services.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/Unused.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/File.h"
-#include "mozilla/dom/ipc/BlobChild.h"
-#include "mozilla/dom/ipc/BlobParent.h"
 #include "mozilla/ipc/ProtocolTypes.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsIEventTarget.h"
 #include "nsIIPCBackgroundChildCreateCallback.h"
 #include "nsIMutable.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
@@ -806,34 +804,16 @@ BackgroundParent::IsOtherProcessActor(PB
 // static
 already_AddRefed<ContentParent>
 BackgroundParent::GetContentParent(PBackgroundParent* aBackgroundActor)
 {
   return ParentImpl::GetContentParent(aBackgroundActor);
 }
 
 // static
-PBlobParent*
-BackgroundParent::GetOrCreateActorForBlobImpl(
-                                            PBackgroundParent* aBackgroundActor,
-                                            BlobImpl* aBlobImpl)
-{
-  AssertIsOnBackgroundThread();
-  MOZ_ASSERT(aBackgroundActor);
-  MOZ_ASSERT(aBlobImpl);
-
-  BlobParent* actor = BlobParent::GetOrCreate(aBackgroundActor, aBlobImpl);
-  if (NS_WARN_IF(!actor)) {
-    return nullptr;
-  }
-
-  return actor;
-}
-
-// static
 intptr_t
 BackgroundParent::GetRawContentParentForComparison(
                                             PBackgroundParent* aBackgroundActor)
 {
   return ParentImpl::GetRawContentParentForComparison(aBackgroundActor);
 }
 
 // static
@@ -873,49 +853,16 @@ BackgroundChild::GetOrCreateForCurrentTh
 // static
 PBackgroundChild*
 BackgroundChild::SynchronouslyCreateForCurrentThread()
 {
   return ChildImpl::SynchronouslyCreateForCurrentThread();
 }
 
 // static
-PBlobChild*
-BackgroundChild::GetOrCreateActorForBlob(PBackgroundChild* aBackgroundActor,
-                                         nsIDOMBlob* aBlob)
-{
-  MOZ_ASSERT(aBlob);
-
-  RefPtr<BlobImpl> blobImpl = static_cast<Blob*>(aBlob)->Impl();
-  MOZ_ASSERT(blobImpl);
-
-  return GetOrCreateActorForBlobImpl(aBackgroundActor, blobImpl);
-}
-
-// static
-PBlobChild*
-BackgroundChild::GetOrCreateActorForBlobImpl(PBackgroundChild* aBackgroundActor,
-                                             BlobImpl* aBlobImpl)
-{
-  MOZ_ASSERT(aBackgroundActor);
-  MOZ_ASSERT(aBlobImpl);
-  MOZ_ASSERT(GetForCurrentThread(),
-             "BackgroundChild not created on this thread yet!");
-  MOZ_ASSERT(aBackgroundActor == GetForCurrentThread(),
-             "BackgroundChild is bound to a different thread!");
-
-  BlobChild* actor = BlobChild::GetOrCreate(aBackgroundActor, aBlobImpl);
-  if (NS_WARN_IF(!actor)) {
-    return nullptr;
-  }
-
-  return actor;
-}
-
-// static
 void
 BackgroundChild::CloseForCurrentThread()
 {
   ChildImpl::CloseForCurrentThread();
 }
 
 // -----------------------------------------------------------------------------
 // BackgroundChildImpl Public Methods
--- a/ipc/glue/BackgroundParent.h
+++ b/ipc/glue/BackgroundParent.h
@@ -13,17 +13,16 @@
 
 template <class> struct already_AddRefed;
 
 namespace mozilla {
 namespace dom {
 
 class BlobImpl;
 class ContentParent;
-class PBlobParent;
 
 } // namespace dom
 
 namespace ipc {
 
 class PBackgroundParent;
 
 template<class PFooSide> class Endpoint;
@@ -53,20 +52,16 @@ public:
   // same process then this function returns null.
   // This function may only be called on the background thread. However,
   // ContentParent is not threadsafe and the returned pointer may not be used on
   // any thread other than the main thread. Callers must take care to use (and
   // release) the returned pointer appropriately.
   static already_AddRefed<ContentParent>
   GetContentParent(PBackgroundParent* aBackgroundActor);
 
-  static mozilla::dom::PBlobParent*
-  GetOrCreateActorForBlobImpl(PBackgroundParent* aBackgroundActor,
-                              BlobImpl* aBlobImpl);
-
   // Get a value that represents the ContentParent associated with the parent
   // actor for comparison. The value is not guaranteed to uniquely identify the
   // ContentParent after the ContentParent has died. This function may only be
   // called on the background thread.
   static intptr_t
   GetRawContentParentForComparison(PBackgroundParent* aBackgroundActor);
 
 private:
--- a/ipc/glue/BackgroundParentImpl.cpp
+++ b/ipc/glue/BackgroundParentImpl.cpp
@@ -14,25 +14,23 @@
 #include "mozilla/media/MediaParent.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/DOMTypes.h"
 #include "mozilla/dom/FileSystemBase.h"
 #include "mozilla/dom/FileSystemRequestParent.h"
 #include "mozilla/dom/GamepadEventChannelParent.h"
 #include "mozilla/dom/GamepadTestChannelParent.h"
-#include "mozilla/dom/PBlobParent.h"
 #include "mozilla/dom/PGamepadEventChannelParent.h"
 #include "mozilla/dom/PGamepadTestChannelParent.h"
 #include "mozilla/dom/MessagePortParent.h"
 #include "mozilla/dom/ServiceWorkerRegistrar.h"
 #include "mozilla/dom/asmjscache/AsmJSCache.h"
 #include "mozilla/dom/cache/ActorUtils.h"
 #include "mozilla/dom/indexedDB/ActorsParent.h"
-#include "mozilla/dom/ipc/BlobParent.h"
 #include "mozilla/dom/ipc/IPCBlobInputStreamParent.h"
 #include "mozilla/dom/ipc/PendingIPCBlobParent.h"
 #include "mozilla/dom/quota/ActorsParent.h"
 #include "mozilla/ipc/BackgroundParent.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/ipc/IPCStreamAlloc.h"
 #include "mozilla/ipc/PBackgroundSharedTypes.h"
 #include "mozilla/ipc/PBackgroundTestParent.h"
@@ -238,43 +236,16 @@ BackgroundParentImpl::RecvFlushPendingFi
   AssertIsOnBackgroundThread();
 
   if (!mozilla::dom::indexedDB::RecvFlushPendingFileDeletions()) {
     return IPC_FAIL_NO_REASON(this);
   }
   return IPC_OK();
 }
 
-auto
-BackgroundParentImpl::AllocPBlobParent(const BlobConstructorParams& aParams)
-  -> PBlobParent*
-{
-  AssertIsInMainProcess();
-  AssertIsOnBackgroundThread();
-
-  if (NS_WARN_IF(aParams.type() !=
-                   BlobConstructorParams::TParentBlobConstructorParams)) {
-    ASSERT_UNLESS_FUZZING();
-    return nullptr;
-  }
-
-  return mozilla::dom::BlobParent::Create(this, aParams);
-}
-
-bool
-BackgroundParentImpl::DeallocPBlobParent(PBlobParent* aActor)
-{
-  AssertIsInMainProcess();
-  AssertIsOnBackgroundThread();
-  MOZ_ASSERT(aActor);
-
-  mozilla::dom::BlobParent::Destroy(aActor);
-  return true;
-}
-
 PPendingIPCBlobParent*
 BackgroundParentImpl::AllocPPendingIPCBlobParent(const IPCBlob& aBlob)
 {
   MOZ_CRASH("PPendingIPCBlobParent actors should be manually constructed!");
 }
 
 bool
 BackgroundParentImpl::DeallocPPendingIPCBlobParent(PPendingIPCBlobParent* aActor)
@@ -300,31 +271,16 @@ BackgroundParentImpl::DeallocPIPCBlobInp
   AssertIsInMainProcess();
   AssertIsOnBackgroundThread();
   MOZ_ASSERT(aActor);
 
   delete aActor;
   return true;
 }
 
-mozilla::ipc::IPCResult
-BackgroundParentImpl::RecvPBlobConstructor(PBlobParent* aActor,
-                                           const BlobConstructorParams& aParams)
-{
-  const ParentBlobConstructorParams& params = aParams;
-  if (params.blobParams().type() == AnyBlobConstructorParams::TKnownBlobConstructorParams) {
-    if (!aActor->SendCreatedFromKnownBlob()) {
-      return IPC_FAIL_NO_REASON(this);
-    }
-    return IPC_OK();
-  }
-
-  return IPC_OK();
-}
-
 PFileDescriptorSetParent*
 BackgroundParentImpl::AllocPFileDescriptorSetParent(
                                           const FileDescriptor& aFileDescriptor)
 {
   AssertIsInMainProcess();
   AssertIsOnBackgroundThread();
 
   return new FileDescriptorSetParent(aFileDescriptor);
--- a/ipc/glue/BackgroundParentImpl.h
+++ b/ipc/glue/BackgroundParentImpl.h
@@ -58,39 +58,29 @@ protected:
   virtual bool
   DeallocPBackgroundIndexedDBUtilsParent(
                                         PBackgroundIndexedDBUtilsParent* aActor)
                                         override;
 
   virtual mozilla::ipc::IPCResult
   RecvFlushPendingFileDeletions() override;
 
-  virtual PBlobParent*
-  AllocPBlobParent(const BlobConstructorParams& aParams) override;
-
-  virtual bool
-  DeallocPBlobParent(PBlobParent* aActor) override;
-
   virtual PPendingIPCBlobParent*
   AllocPPendingIPCBlobParent(const IPCBlob& aBlob) override;
 
   virtual bool
   DeallocPPendingIPCBlobParent(PPendingIPCBlobParent* aActor) override;
 
   virtual PIPCBlobInputStreamParent*
   AllocPIPCBlobInputStreamParent(const nsID& aID,
                                  const uint64_t& aSize) override;
 
   virtual bool
   DeallocPIPCBlobInputStreamParent(PIPCBlobInputStreamParent* aActor) override;
 
-  virtual mozilla::ipc::IPCResult
-  RecvPBlobConstructor(PBlobParent* aActor,
-                       const BlobConstructorParams& params) override;
-
   virtual PFileDescriptorSetParent*
   AllocPFileDescriptorSetParent(const FileDescriptor& aFileDescriptor)
                                 override;
 
   virtual bool
   DeallocPFileDescriptorSetParent(PFileDescriptorSetParent* aActor)
                                   override;
 
--- a/ipc/glue/InputStreamUtils.cpp
+++ b/ipc/glue/InputStreamUtils.cpp
@@ -5,18 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "InputStreamUtils.h"
 
 #include "nsIIPCSerializableInputStream.h"
 
 #include "mozilla/Assertions.h"
 #include "mozilla/dom/File.h"
-#include "mozilla/dom/ipc/BlobChild.h"
-#include "mozilla/dom/ipc/BlobParent.h"
 #include "mozilla/dom/ipc/IPCBlobInputStream.h"
 #include "mozilla/dom/ipc/IPCBlobInputStreamStorage.h"
 #include "nsComponentManagerUtils.h"
 #include "nsDebug.h"
 #include "nsID.h"
 #include "nsIXULRuntime.h"
 #include "nsMIMEInputStream.h"
 #include "nsMultiplexInputStream.h"
@@ -98,38 +96,19 @@ InputStreamHelper::DeserializeInputStrea
       break;
 
     case InputStreamParams::TMultiplexInputStreamParams:
       serializable = do_CreateInstance(kMultiplexInputStreamCID);
       break;
 
     // When the input stream already exists in this process, all we need to do
     // is retrieve the original instead of sending any data over the wire.
-    case InputStreamParams::TRemoteInputStreamParams: {
-      if (NS_WARN_IF(!XRE_IsParentProcess())) {
-        return nullptr;
-      }
-
-      const nsID& id = aParams.get_RemoteInputStreamParams().id();
-
-      RefPtr<BlobImpl> blobImpl = BlobParent::GetBlobImplForID(id);
-
-      MOZ_ASSERT(blobImpl, "Invalid blob contents");
-
-      // If fetching the internal stream fails, we ignore it and return a
-      // null stream.
-      ErrorResult rv;
-      nsCOMPtr<nsIInputStream> stream;
-      blobImpl->GetInternalStream(getter_AddRefs(stream), rv);
-      if (NS_WARN_IF(rv.Failed()) || !stream) {
-        NS_WARNING("Couldn't obtain a valid stream from the blob");
-        rv.SuppressException();
-      }
-      return stream.forget();
-    }
+    case InputStreamParams::TRemoteInputStreamParams:
+      // Thi is broken!
+      return nullptr;
 
     case InputStreamParams::TSameProcessInputStreamParams: {
       MOZ_ASSERT(aFileDescriptors.IsEmpty());
 
       const SameProcessInputStreamParams& params =
         aParams.get_SameProcessInputStreamParams();
 
       stream = dont_AddRef(
--- a/ipc/glue/PBackground.ipdl
+++ b/ipc/glue/PBackground.ipdl
@@ -1,17 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 include protocol PAsmJSCacheEntry;
 include protocol PBackgroundIDBFactory;
 include protocol PBackgroundIndexedDBUtils;
 include protocol PBackgroundTest;
-include protocol PBlob;
 include protocol PBroadcastChannel;
 include protocol PCache;
 include protocol PCacheStorage;
 include protocol PCacheStreamControl;
 include protocol PFileDescriptorSet;
 include protocol PFileSystemRequest;
 include protocol PGamepadEventChannel;
 include protocol PGamepadTestChannel;
@@ -49,17 +48,16 @@ namespace mozilla {
 namespace ipc {
 
 sync protocol PBackground
 {
   manages PAsmJSCacheEntry;
   manages PBackgroundIDBFactory;
   manages PBackgroundIndexedDBUtils;
   manages PBackgroundTest;
-  manages PBlob;
   manages PBroadcastChannel;
   manages PCache;
   manages PCacheStorage;
   manages PCacheStreamControl;
   manages PFileDescriptorSet;
   manages PFileSystemRequest;
   manages PGamepadEventChannel;
   manages PGamepadTestChannel;
@@ -125,15 +123,13 @@ child:
 
   async PParentToChildStream();
 
   async PIPCBlobInputStream(nsID aID, uint64_t aSize);
 
   async PPendingIPCBlob(IPCBlob blob);
 
 both:
-  async PBlob(BlobConstructorParams params);
-
   async PFileDescriptorSet(FileDescriptor fd);
 };
 
 } // namespace ipc
 } // namespace mozilla
--- a/ipc/ipdl/sync-messages.ini
+++ b/ipc/ipdl/sync-messages.ini
@@ -802,22 +802,16 @@ description =
 [PPluginStream::NPN_Write]
 description =
 [PPluginStream::__delete__]
 description =
 
 # The rest
 [PHeapSnapshotTempFileHelper::OpenHeapSnapshotTempFile]
 description =
-[PBlob::WaitForSliceCreation]
-description =
-[PBlob::GetFileId]
-description =
-[PBlob::GetFilePath]
-description =
 [PBackgroundMutableFile::GetFileId]
 description =
 [PBackgroundIndexedDBUtils::GetFileReferences]
 description =
 [PBrowser::SyncMessage]
 description =
 [PBrowser::PPluginWidget]
 description =