Bug 1466023 - nsHostObjectURI renamed BlobURL, r=qdot
authorAndrea Marchesini <amarchesini@mozilla.com>
Sat, 02 Jun 2018 15:51:42 +0200
changeset 475202 4a8ed669dab3b9d001e1563b68c2cd6bd6ce5b1a
parent 475201 dfeb1b271403c093be29da3296dbf128eb332876
child 475203 6fae037fabaec69c10777b3b2c5c470f3ff34ef3
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1466023
milestone62.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 1466023 - nsHostObjectURI renamed BlobURL, r=qdot
dom/file/BlobURL.cpp
dom/file/BlobURL.h
dom/file/BlobURLProtocolHandler.cpp
dom/file/MutableBlobStorage.cpp
dom/file/moz.build
dom/file/nsHostObjectURI.cpp
dom/file/nsHostObjectURI.h
ipc/glue/URIUtils.cpp
layout/build/nsLayoutModule.cpp
rename from dom/file/nsHostObjectURI.cpp
rename to dom/file/BlobURL.cpp
--- a/dom/file/nsHostObjectURI.cpp
+++ b/dom/file/BlobURL.cpp
@@ -1,109 +1,110 @@
 /* -*- 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 "nsHostObjectURI.h"
-
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 
+#include "mozilla/dom/BlobURL.h"
 #include "mozilla/dom/BlobURLProtocolHandler.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/ipc/URIUtils.h"
 
+using namespace mozilla::dom;
+
 static NS_DEFINE_CID(kHOSTOBJECTURICID, NS_HOSTOBJECTURI_CID);
 
 static NS_DEFINE_CID(kThisSimpleURIImplementationCID,
                      NS_THIS_SIMPLEURI_IMPLEMENTATION_CID);
 
-NS_IMPL_ADDREF_INHERITED(nsHostObjectURI, mozilla::net::nsSimpleURI)
-NS_IMPL_RELEASE_INHERITED(nsHostObjectURI, mozilla::net::nsSimpleURI)
+NS_IMPL_ADDREF_INHERITED(BlobURL, mozilla::net::nsSimpleURI)
+NS_IMPL_RELEASE_INHERITED(BlobURL, mozilla::net::nsSimpleURI)
 
-NS_INTERFACE_MAP_BEGIN(nsHostObjectURI)
+NS_INTERFACE_MAP_BEGIN(BlobURL)
   NS_INTERFACE_MAP_ENTRY(nsIURIWithPrincipal)
   if (aIID.Equals(kHOSTOBJECTURICID))
     foundInterface = static_cast<nsIURI*>(this);
   else if (aIID.Equals(kThisSimpleURIImplementationCID)) {
     // Need to return explicitly here, because if we just set foundInterface
     // to null the NS_INTERFACE_MAP_END_INHERITING will end up calling into
     // nsSimplURI::QueryInterface and finding something for this CID.
     *aInstancePtr = nullptr;
     return NS_NOINTERFACE;
   }
   else
 NS_INTERFACE_MAP_END_INHERITING(mozilla::net::nsSimpleURI)
 
 // nsIURIWithPrincipal methods:
 
 NS_IMETHODIMP
-nsHostObjectURI::GetPrincipal(nsIPrincipal** aPrincipal)
+BlobURL::GetPrincipal(nsIPrincipal** aPrincipal)
 {
   MOZ_ASSERT(NS_IsMainThread());
   nsCOMPtr<nsIPrincipal> principal = mPrincipal.get();
   principal.forget(aPrincipal);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHostObjectURI::GetPrincipalUri(nsIURI** aUri)
+BlobURL::GetPrincipalUri(nsIURI** aUri)
 {
   if (mPrincipal) {
     mPrincipal->GetURI(aUri);
   }
   else {
     *aUri = nullptr;
   }
 
   return NS_OK;
 }
 
 // nsISerializable methods:
 
 NS_IMETHODIMP
-nsHostObjectURI::Read(nsIObjectInputStream* aStream)
+BlobURL::Read(nsIObjectInputStream* aStream)
 {
   NS_NOTREACHED("Use nsIURIMutator.read() instead");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
-nsHostObjectURI::ReadPrivate(nsIObjectInputStream *aStream)
+BlobURL::ReadPrivate(nsIObjectInputStream *aStream)
 {
   nsresult rv = mozilla::net::nsSimpleURI::ReadPrivate(aStream);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsISupports> supports;
   rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(supports));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIPrincipal> principal = do_QueryInterface(supports, &rv);
   mPrincipal = new nsMainThreadPtrHolder<nsIPrincipal>("nsIPrincipal", principal, false);
   return rv;
 }
 
 NS_IMETHODIMP
-nsHostObjectURI::Write(nsIObjectOutputStream* aStream)
+BlobURL::Write(nsIObjectOutputStream* aStream)
 {
   nsresult rv = mozilla::net::nsSimpleURI::Write(aStream);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIPrincipal> principal = mPrincipal.get();
   return NS_WriteOptionalCompoundObject(aStream, principal,
                                         NS_GET_IID(nsIPrincipal),
                                         true);
 }
 
 // nsIIPCSerializableURI methods:
 void
-nsHostObjectURI::Serialize(mozilla::ipc::URIParams& aParams)
+BlobURL::Serialize(mozilla::ipc::URIParams& aParams)
 {
   using namespace mozilla::ipc;
 
   HostObjectURIParams hostParams;
   URIParams simpleParams;
 
   mozilla::net::nsSimpleURI::Serialize(simpleParams);
   hostParams.simpleParams() = simpleParams;
@@ -120,17 +121,17 @@ nsHostObjectURI::Serialize(mozilla::ipc:
   } else {
     hostParams.principal() = mozilla::void_t();
   }
 
   aParams = hostParams;
 }
 
 bool
-nsHostObjectURI::Deserialize(const mozilla::ipc::URIParams& aParams)
+BlobURL::Deserialize(const mozilla::ipc::URIParams& aParams)
 {
   using namespace mozilla::ipc;
 
   if (aParams.type() != URIParams::THostObjectURIParams) {
       NS_ERROR("Received unknown parameters from the other process!");
       return false;
   }
 
@@ -149,60 +150,60 @@ nsHostObjectURI::Deserialize(const mozil
     return false;
   }
   mPrincipal = new nsMainThreadPtrHolder<nsIPrincipal>("nsIPrincipal", principal, false);
 
   return true;
 }
 
 nsresult
-nsHostObjectURI::SetScheme(const nsACString& aScheme)
+BlobURL::SetScheme(const nsACString& aScheme)
 {
   // Disallow setting the scheme, since that could cause us to be associated
   // with a different protocol handler that doesn't expect us to be carrying
   // around a principal with nsIURIWithPrincipal.
   return NS_ERROR_FAILURE;
 }
 
 // nsIURI methods:
 nsresult
-nsHostObjectURI::CloneInternal(mozilla::net::nsSimpleURI::RefHandlingEnum aRefHandlingMode,
-                               const nsACString& newRef,
-                               nsIURI** aClone)
+BlobURL::CloneInternal(mozilla::net::nsSimpleURI::RefHandlingEnum aRefHandlingMode,
+                       const nsACString& newRef,
+                       nsIURI** aClone)
 {
   nsCOMPtr<nsIURI> simpleClone;
   nsresult rv =
     mozilla::net::nsSimpleURI::CloneInternal(aRefHandlingMode, newRef, getter_AddRefs(simpleClone));
   NS_ENSURE_SUCCESS(rv, rv);
 
 #ifdef DEBUG
-  RefPtr<nsHostObjectURI> uriCheck;
+  RefPtr<BlobURL> uriCheck;
   rv = simpleClone->QueryInterface(kHOSTOBJECTURICID, getter_AddRefs(uriCheck));
   MOZ_ASSERT(NS_SUCCEEDED(rv) && uriCheck);
 #endif
 
-  nsHostObjectURI* u = static_cast<nsHostObjectURI*>(simpleClone.get());
+  BlobURL* u = static_cast<BlobURL*>(simpleClone.get());
 
   u->mPrincipal = mPrincipal;
 
   simpleClone.forget(aClone);
   return NS_OK;
 }
 
 /* virtual */ nsresult
-nsHostObjectURI::EqualsInternal(nsIURI* aOther,
-                                mozilla::net::nsSimpleURI::RefHandlingEnum aRefHandlingMode,
-                                bool* aResult)
+BlobURL::EqualsInternal(nsIURI* aOther,
+                        mozilla::net::nsSimpleURI::RefHandlingEnum aRefHandlingMode,
+                        bool* aResult)
 {
   if (!aOther) {
     *aResult = false;
     return NS_OK;
   }
 
-  RefPtr<nsHostObjectURI> otherUri;
+  RefPtr<BlobURL> otherUri;
   aOther->QueryInterface(kHOSTOBJECTURICID, getter_AddRefs(otherUri));
   if (!otherUri) {
     *aResult = false;
     return NS_OK;
   }
 
   // Compare the member data that our base class knows about.
   if (!mozilla::net::nsSimpleURI::EqualsInternal(otherUri, aRefHandlingMode)) {
@@ -215,82 +216,82 @@ nsHostObjectURI::EqualsInternal(nsIURI* 
     return mPrincipal->Equals(otherUri->mPrincipal, aResult);
   }
   // else, at least one of us lacks a principal; only equal if *both* lack it.
   *aResult = (!mPrincipal && !otherUri->mPrincipal);
   return NS_OK;
 }
 
 // Queries this list of interfaces. If none match, it queries mURI.
-NS_IMPL_NSIURIMUTATOR_ISUPPORTS(nsHostObjectURI::Mutator,
+NS_IMPL_NSIURIMUTATOR_ISUPPORTS(BlobURL::Mutator,
                                 nsIURISetters,
                                 nsIURIMutator,
                                 nsIPrincipalURIMutator,
                                 nsISerializable)
 
 NS_IMETHODIMP
-nsHostObjectURI::Mutate(nsIURIMutator** aMutator)
+BlobURL::Mutate(nsIURIMutator** aMutator)
 {
-    RefPtr<nsHostObjectURI::Mutator> mutator = new nsHostObjectURI::Mutator();
+    RefPtr<BlobURL::Mutator> mutator = new BlobURL::Mutator();
     nsresult rv = mutator->InitFromURI(this);
     if (NS_FAILED(rv)) {
         return rv;
     }
     mutator.forget(aMutator);
     return NS_OK;
 }
 
 // nsIClassInfo methods:
 NS_IMETHODIMP
-nsHostObjectURI::GetInterfaces(uint32_t *count, nsIID * **array)
+BlobURL::GetInterfaces(uint32_t *count, nsIID * **array)
 {
   *count = 0;
   *array = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHostObjectURI::GetScriptableHelper(nsIXPCScriptable **_retval)
+BlobURL::GetScriptableHelper(nsIXPCScriptable **_retval)
 {
   *_retval = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHostObjectURI::GetContractID(nsACString& aContractID)
+BlobURL::GetContractID(nsACString& aContractID)
 {
   // Make sure to modify any subclasses as needed if this ever
   // changes.
   aContractID.SetIsVoid(true);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHostObjectURI::GetClassDescription(nsACString& aClassDescription)
+BlobURL::GetClassDescription(nsACString& aClassDescription)
 {
   aClassDescription.SetIsVoid(true);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHostObjectURI::GetClassID(nsCID * *aClassID)
+BlobURL::GetClassID(nsCID * *aClassID)
 {
   // Make sure to modify any subclasses as needed if this ever
   // changes to not call the virtual GetClassIDNoAlloc.
   *aClassID = (nsCID*) moz_xmalloc(sizeof(nsCID));
   NS_ENSURE_TRUE(*aClassID, NS_ERROR_OUT_OF_MEMORY);
 
   return GetClassIDNoAlloc(*aClassID);
 }
 
 NS_IMETHODIMP
-nsHostObjectURI::GetFlags(uint32_t *aFlags)
+BlobURL::GetFlags(uint32_t *aFlags)
 {
   *aFlags = nsIClassInfo::MAIN_THREAD_ONLY;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHostObjectURI::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
+BlobURL::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
 {
   *aClassIDNoAlloc = kHOSTOBJECTURICID;
   return NS_OK;
 }
rename from dom/file/nsHostObjectURI.h
rename to dom/file/BlobURL.h
--- a/dom/file/nsHostObjectURI.h
+++ b/dom/file/BlobURL.h
@@ -1,45 +1,48 @@
 /* -*- 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 nsHostObjectURI_h
-#define nsHostObjectURI_h
+#ifndef mozilla_dom_BlobURL_h
+#define mozilla_dom_BlobURL_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/File.h"
 #include "nsCOMPtr.h"
 #include "nsIClassInfo.h"
 #include "nsIPrincipal.h"
 #include "nsISerializable.h"
 #include "nsIURIWithPrincipal.h"
 #include "nsSimpleURI.h"
 #include "nsIIPCSerializableURI.h"
 #include "nsProxyRelease.h"
 
+namespace mozilla {
+namespace dom {
+
 /**
- * These URIs refer to host objects with "blob" scheme. The underlying objects
- * can be Blobs or MediaSources.
+ * These URIs refer to host objects with "blob" scheme. The underlying object is
+ * a BlobImpl.
  */
-class nsHostObjectURI final
+class BlobURL final
   : public mozilla::net::nsSimpleURI
   , public nsIURIWithPrincipal
 {
 private:
-  explicit nsHostObjectURI(nsIPrincipal* aPrincipal)
+  explicit BlobURL(nsIPrincipal* aPrincipal)
     : mozilla::net::nsSimpleURI()
   {
     mPrincipal = new nsMainThreadPtrHolder<nsIPrincipal>("nsIPrincipal", aPrincipal, false);
   }
 
   // For use only from deserialization
-  explicit nsHostObjectURI()
+  explicit BlobURL()
     : mozilla::net::nsSimpleURI()
   {}
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIURIWITHPRINCIPAL
   NS_DECL_NSISERIALIZABLE
   NS_DECL_NSICLASSINFO
@@ -48,40 +51,40 @@ public:
   // Override CloneInternal() and EqualsInternal()
   virtual nsresult CloneInternal(RefHandlingEnum aRefHandlingMode,
                                  const nsACString& newRef,
                                  nsIURI** aClone) override;
   virtual nsresult EqualsInternal(nsIURI* aOther,
                                   RefHandlingEnum aRefHandlingMode,
                                   bool* aResult) override;
 
-  // Override StartClone to hand back a nsHostObjectURI
+  // Override StartClone to hand back a BlobURL
   virtual mozilla::net::nsSimpleURI* StartClone(RefHandlingEnum refHandlingMode,
                                                 const nsACString& newRef) override
   {
-    nsHostObjectURI* url = new nsHostObjectURI();
+    BlobURL* url = new BlobURL();
     SetRefOnClone(url, refHandlingMode, newRef);
     return url;
   }
 
   NS_IMETHOD Mutate(nsIURIMutator * *_retval) override;
 
   nsMainThreadPtrHandle<nsIPrincipal> mPrincipal;
 
-protected:
-  virtual ~nsHostObjectURI() {}
+private:
+  virtual ~BlobURL() = default;
 
   nsresult SetScheme(const nsACString &aProtocol) override;
   bool Deserialize(const mozilla::ipc::URIParams&);
   nsresult ReadPrivate(nsIObjectInputStream *stream);
 
 public:
   class Mutator final
     : public nsIURIMutator
-    , public BaseURIMutator<nsHostObjectURI>
+    , public BaseURIMutator<BlobURL>
     , public nsIPrincipalURIMutator
     , public nsISerializable
   {
     NS_DECL_ISUPPORTS
     NS_FORWARD_SAFE_NSIURISETTERS_RET(mURI)
     NS_DEFINE_NSIMUTATOR_COMMON
 
     NS_IMETHOD
@@ -102,27 +105,31 @@ public:
         if (!mURI) {
             return NS_ERROR_NULL_POINTER;
         }
         MOZ_ASSERT(NS_IsMainThread());
         mURI->mPrincipal = new nsMainThreadPtrHolder<nsIPrincipal>("nsIPrincipal", aPrincipal, false);
         return NS_OK;
     }
 
-    explicit Mutator() { }
+    Mutator() = default;
+
   private:
-    virtual ~Mutator() { }
+    ~Mutator() = default;
 
-    friend class nsHostObjectURI;
+    friend class BlobURL;
   };
 
-  friend BaseURIMutator<nsHostObjectURI>;
+  friend BaseURIMutator<BlobURL>;
 };
 
 #define NS_HOSTOBJECTURI_CID \
 { 0xf5475c51, 0x59a7, 0x4757, \
   { 0xb3, 0xd9, 0xe2, 0x11, 0xa9, 0x41, 0x08, 0x72 } }
 
 #define NS_HOSTOBJECTURIMUTATOR_CID \
 { 0xbbe50ef2, 0x80eb, 0x469d, \
   { 0xb7, 0x0d, 0x02, 0x85, 0x82, 0x75, 0x38, 0x9f } }
 
-#endif /* nsHostObjectURI_h */
+} // dom namespace
+} // mozilla namespace
+
+#endif /* mozilla_dom_BlobURL_h */
--- a/dom/file/BlobURLProtocolHandler.cpp
+++ b/dom/file/BlobURLProtocolHandler.cpp
@@ -1,32 +1,32 @@
 /* -*- 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 "BlobURLProtocolHandler.h"
 
+#include "mozilla/dom/BlobURL.h"
 #include "mozilla/dom/ChromeUtils.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/Exceptions.h"
 #include "mozilla/dom/BlobImpl.h"
 #include "mozilla/dom/IPCBlobUtils.h"
 #include "mozilla/dom/MediaSource.h"
 #include "mozilla/ipc/IPCStreamUtils.h"
 #include "mozilla/LoadInfo.h"
 #include "mozilla/ModuleUtils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/SystemGroup.h"
 #include "nsClassHashtable.h"
 #include "nsContentUtils.h"
 #include "nsError.h"
-#include "nsHostObjectURI.h"
 #include "nsIAsyncShutdown.h"
 #include "nsIException.h" // for nsIStackFrame
 #include "nsIMemoryReporter.h"
 #include "nsIPrincipal.h"
 #include "nsIUUIDGenerator.h"
 #include "nsNetUtil.h"
 
 #define RELEASING_TIMER 5000
@@ -833,17 +833,17 @@ BlobURLProtocolHandler::NewURI(const nsA
   RefPtr<BlobImpl> blob;
   if (info && info->mObjectType == DataInfo::eBlobImpl) {
     MOZ_ASSERT(info->mBlobImpl);
     principal = info->mPrincipal;
     blob = info->mBlobImpl;
   }
 
   nsCOMPtr<nsIURI> uri;
-  rv = NS_MutateURI(new nsHostObjectURI::Mutator())
+  rv = NS_MutateURI(new BlobURL::Mutator())
          .SetSpec(aSpec)
          .Apply(NS_MutatorMethod(&nsIPrincipalURIMutator::SetPrincipal, principal))
          .Finalize(uri);
   NS_ENSURE_SUCCESS(rv, rv);
 
   uri.forget(aResult);
 
   return NS_OK;
--- a/dom/file/MutableBlobStorage.cpp
+++ b/dom/file/MutableBlobStorage.cpp
@@ -1,14 +1,15 @@
 /* -*- 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 "EmptyBlobImpl.h"
 #include "MutableBlobStorage.h"
 #include "MemoryBlobImpl.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/dom/ipc/TemporaryIPCBlobChild.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/PBackgroundChild.h"
 #include "mozilla/Preferences.h"
--- a/dom/file/moz.build
+++ b/dom/file/moz.build
@@ -4,25 +4,22 @@
 # 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/.
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "DOM: File")
 
 DIRS += ['ipc']
 
-EXPORTS += [
-    'nsHostObjectURI.h',
-]
-
 EXPORTS.mozilla.dom += [
     'BaseBlobImpl.h',
     'Blob.h',
     'BlobImpl.h',
     'BlobSet.h',
+    'BlobURL.h',
     'BlobURLProtocolHandler.h',
     'File.h',
     'FileBlobImpl.h',
     'FileCreatorHelper.h',
     'FileList.h',
     'FileReader.h',
     'FileReaderSync.h',
     'FontTableURIProtocolHandler.h',
@@ -33,30 +30,30 @@ EXPORTS.mozilla.dom += [
     'StreamBlobImpl.h',
 ]
 
 UNIFIED_SOURCES += [
     'BaseBlobImpl.cpp',
     'Blob.cpp',
     'BlobImpl.cpp',
     'BlobSet.cpp',
+    'BlobURL.cpp',
     'BlobURLProtocolHandler.cpp',
     'EmptyBlobImpl.cpp',
     'File.cpp',
     'FileBlobImpl.cpp',
     'FileCreatorHelper.cpp',
     'FileList.cpp',
     'FileReader.cpp',
     'FileReaderSync.cpp',
     'FontTableURIProtocolHandler.cpp',
     'MemoryBlobImpl.cpp',
     'MultipartBlobImpl.cpp',
     'MutableBlobStorage.cpp',
     'MutableBlobStreamListener.cpp',
-    'nsHostObjectURI.cpp',
     'StreamBlobImpl.cpp',
     'StringBlobImpl.cpp',
     'TemporaryFileBlobImpl.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/dom/file/ipc',
 ]
--- a/ipc/glue/URIUtils.cpp
+++ b/ipc/glue/URIUtils.cpp
@@ -5,22 +5,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "URIUtils.h"
 
 #include "nsIIPCSerializableURI.h"
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Assertions.h"
+#include "mozilla/dom/BlobURL.h"
 #include "nsComponentManagerUtils.h"
 #include "nsDebug.h"
 #include "nsID.h"
 #include "nsJARURI.h"
 #include "nsIIconURI.h"
-#include "nsHostObjectURI.h"
 #include "NullPrincipalURI.h"
 #include "nsJSProtocolHandler.h"
 #include "nsNetCID.h"
 #include "nsSimpleNestedURI.h"
 #include "nsThreadUtils.h"
 #include "nsIURIMutator.h"
 
 using namespace mozilla::ipc;
@@ -104,17 +104,17 @@ DeserializeURI(const URIParams& aParams)
       mutator = new NullPrincipalURI::Mutator();
       break;
 
     case URIParams::TSimpleNestedURIParams:
       mutator = new net::nsSimpleNestedURI::Mutator();
       break;
 
     case URIParams::THostObjectURIParams:
-      mutator = new nsHostObjectURI::Mutator();
+      mutator = new mozilla::dom::BlobURL::Mutator();
       break;
 
     default:
       MOZ_CRASH("Unknown params!");
   }
 
   MOZ_ASSERT(mutator);
 
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -54,23 +54,23 @@
 #include "nsIMessageManager.h"
 
 // Transformiix stuff
 #include "mozilla/dom/XPathEvaluator.h"
 
 // view stuff
 #include "nsContentCreatorFunctions.h"
 
-#include "nsHostObjectURI.h"
 #include "nsGlobalWindowCommands.h"
 #include "nsIControllerCommandTable.h"
 #include "nsJSProtocolHandler.h"
 #include "nsIControllerContext.h"
 #include "nsZipArchive.h"
 #include "mozilla/Attributes.h"
+#include "mozilla/dom/BlobURL.h"
 #include "mozilla/dom/DOMRequest.h"
 #include "mozilla/dom/LocalStorageManager.h"
 #include "mozilla/dom/network/UDPSocketChild.h"
 #include "mozilla/dom/quota/QuotaManagerService.h"
 #include "mozilla/dom/ServiceWorkerManager.h"
 #include "mozilla/dom/SessionStorageManager.h"
 #include "mozilla/dom/StorageActivityService.h"
 #include "mozilla/dom/WorkerDebuggerManager.h"
@@ -191,18 +191,18 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(HTMLEdito
 { 0xe1e79dec, 0x4085, 0x4994, { 0xac, 0x5b, 0x74, 0x4b, 0x01, 0x66, 0x97, 0xe6 } }
 
 #define PRESENTATION_TCP_SESSION_TRANSPORT_CID \
 { 0xc9d023f4, 0x6228, 0x4c07, { 0x8b, 0x1d, 0x9c, 0x19, 0x57, 0x3f, 0xaa, 0x27 } }
 
 already_AddRefed<nsIPresentationService> NS_CreatePresentationService();
 
 // Factory Constructor
-typedef nsHostObjectURI::Mutator nsHostObjectURIMutator;
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsHostObjectURIMutator)
+typedef mozilla::dom::BlobURL::Mutator BlobURLMutator;
+NS_GENERIC_FACTORY_CONSTRUCTOR(BlobURLMutator)
 NS_GENERIC_FACTORY_CONSTRUCTOR(LocalStorageManager)
 NS_GENERIC_FACTORY_CONSTRUCTOR(SessionStorageManager)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(DOMRequestService,
                                          DOMRequestService::FactoryCreate)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(QuotaManagerService,
                                          QuotaManagerService::FactoryCreate)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ServiceWorkerManager,
                                          ServiceWorkerManager::GetInstance)
@@ -782,18 +782,18 @@ static const mozilla::Module::CIDEntry k
   { &kNS_JSURI_CID, false, nullptr, nsJSURIMutatorConstructor }, // do_CreateInstance returns mutator
   { &kNS_JSURIMUTATOR_CID, false, nullptr, nsJSURIMutatorConstructor },
   { &kNS_WINDOWCOMMANDTABLE_CID, false, nullptr, CreateWindowCommandTableConstructor },
   { &kNS_WINDOWCONTROLLER_CID, false, nullptr, CreateWindowControllerWithSingletonCommandTable },
   { &kNS_PLUGINDOCLOADERFACTORY_CID, false, nullptr, CreateContentDLF },
   { &kNS_PLUGINDOCUMENT_CID, false, nullptr, CreatePluginDocument },
   { &kNS_VIDEODOCUMENT_CID, false, nullptr, CreateVideoDocument },
   { &kNS_STYLESHEETSERVICE_CID, false, nullptr, nsStyleSheetServiceConstructor },
-  { &kNS_HOSTOBJECTURI_CID, false, nullptr, nsHostObjectURIMutatorConstructor }, // do_CreateInstance returns mutator
-  { &kNS_HOSTOBJECTURIMUTATOR_CID, false, nullptr, nsHostObjectURIMutatorConstructor },
+  { &kNS_HOSTOBJECTURI_CID, false, nullptr, BlobURLMutatorConstructor }, // do_CreateInstance returns mutator
+  { &kNS_HOSTOBJECTURIMUTATOR_CID, false, nullptr, BlobURLMutatorConstructor },
   { &kNS_DOMSESSIONSTORAGEMANAGER_CID, false, nullptr, SessionStorageManagerConstructor },
   { &kNS_DOMLOCALSTORAGEMANAGER_CID, false, nullptr, LocalStorageManagerConstructor },
   { &kNS_TEXTEDITOR_CID, false, nullptr, TextEditorConstructor },
   { &kDOMREQUEST_SERVICE_CID, false, nullptr, DOMRequestServiceConstructor },
   { &kQUOTAMANAGER_SERVICE_CID, false, nullptr, QuotaManagerServiceConstructor },
   { &kSERVICEWORKERMANAGER_CID, false, nullptr, ServiceWorkerManagerConstructor },
   { &kSTORAGEACTIVITYSERVICE_CID, false, nullptr, StorageActivityServiceConstructor },
   { &kNOTIFICATIONTELEMETRYSERVICE_CID, false, nullptr, NotificationTelemetryServiceConstructor },