Bug 1047483 - patch 4 - Removing nsDOMBlobBuilder, r=ehsan
☠☠ backed out by 47a1219c6324 ☠ ☠
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 07 Oct 2014 15:20:57 +0100
changeset 232404 c199f1057d7efc897cabb123ca9dd349c94eb33f
parent 232403 18830d07884c13f1d7af36fbad444c4578859630
child 232405 c09d7f95554aedf53620a150a4f3c494d21820b7
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1047483
milestone35.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 1047483 - patch 4 - Removing nsDOMBlobBuilder, r=ehsan
content/base/public/BlobSet.h
content/base/public/File.h
content/base/public/moz.build
content/base/src/File.cpp
content/base/src/MultipartFileImpl.cpp
content/base/src/MultipartFileImpl.h
content/base/src/moz.build
content/base/src/nsDOMBlobBuilder.cpp
content/base/src/nsDOMBlobBuilder.h
content/base/src/nsXMLHttpRequest.cpp
content/base/src/nsXMLHttpRequest.h
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMWindowUtils.cpp
dom/devicestorage/nsDeviceStorage.cpp
js/xpconnect/loader/mozJSComponentLoader.cpp
layout/build/nsLayoutModule.cpp
new file mode 100644
--- /dev/null
+++ b/content/base/public/BlobSet.h
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* 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_BlobSet_h
+#define mozilla_dom_BlobSet_h
+
+#include "mozilla/CheckedInt.h"
+#include "mozilla/dom/File.h"
+
+namespace mozilla {
+namespace dom {
+
+class BlobSet {
+public:
+  BlobSet()
+    : mData(nullptr), mDataLen(0), mDataBufferLen(0)
+  {}
+
+  ~BlobSet()
+  {
+    moz_free(mData);
+  }
+
+  nsresult AppendVoidPtr(const void* aData, uint32_t aLength);
+  nsresult AppendString(const nsAString& aString, bool nativeEOL, JSContext* aCx);
+  nsresult AppendBlobImpl(FileImpl* aBlobImpl);
+  nsresult AppendBlobImpls(const nsTArray<nsRefPtr<FileImpl>>& aBlobImpls);
+
+  nsTArray<nsRefPtr<FileImpl>>& GetBlobImpls() { Flush(); return mBlobImpls; }
+
+  already_AddRefed<File> GetBlobInternal(nsISupports* aParent,
+                                         const nsACString& aContentType);
+
+protected:
+  bool ExpandBufferSize(uint64_t aSize)
+  {
+    using mozilla::CheckedUint32;
+
+    if (mDataBufferLen >= mDataLen + aSize) {
+      mDataLen += aSize;
+      return true;
+    }
+
+    // Start at 1 or we'll loop forever.
+    CheckedUint32 bufferLen =
+      std::max<uint32_t>(static_cast<uint32_t>(mDataBufferLen), 1);
+    while (bufferLen.isValid() && bufferLen.value() < mDataLen + aSize)
+      bufferLen *= 2;
+
+    if (!bufferLen.isValid())
+      return false;
+
+    void* data = moz_realloc(mData, bufferLen.value());
+    if (!data)
+      return false;
+
+    mData = data;
+    mDataBufferLen = bufferLen.value();
+    mDataLen += aSize;
+    return true;
+  }
+
+  void Flush() {
+    if (mData) {
+      // If we have some data, create a blob for it
+      // and put it on the stack
+
+      nsRefPtr<FileImpl> blobImpl =
+        new FileImplMemory(mData, mDataLen, EmptyString());
+      mBlobImpls.AppendElement(blobImpl);
+      mData = nullptr; // The nsDOMMemoryFile takes ownership of the buffer
+      mDataLen = 0;
+      mDataBufferLen = 0;
+    }
+  }
+
+  nsTArray<nsRefPtr<FileImpl>> mBlobImpls;
+  void* mData;
+  uint64_t mDataLen;
+  uint64_t mDataBufferLen;
+};
+
+} // dom namespace
+} // mozilla namespace
+
+#endif // mozilla_dom_BlobSet_h
--- a/content/base/public/File.h
+++ b/content/base/public/File.h
@@ -53,19 +53,16 @@ namespace dom {
 namespace indexedDB {
 class FileInfo;
 };
 
 struct BlobPropertyBag;
 struct FilePropertyBag;
 class FileImpl;
 
-/* FOLLOWUP TODO:
-1. remove nsDOMBlobBuilder.h
-*/
 class File MOZ_FINAL : public nsIDOMFile
                      , public nsIXHRSendable
                      , public nsIMutable
                      , public nsSupportsWeakReference
                      , public nsWrapperCache
 {
 public:
   NS_DECL_NSIDOMBLOB
--- a/content/base/public/moz.build
+++ b/content/base/public/moz.build
@@ -61,16 +61,17 @@ EXPORTS += [
     'nsNameSpaceManager.h',
     'nsReferencedElement.h',
     'nsTreeSanitizer.h',
     'nsViewportInfo.h',
     'nsXMLNameSpaceMap.h',
 ]
 
 EXPORTS.mozilla.dom += [
+    'BlobSet.h',
     'DirectionalityUtils.h',
     'Element.h',
     'ElementInlines.h',
     'File.h',
     'FragmentOrElement.h',
     'FromParser.h',
 ]
 
--- a/content/base/src/File.cpp
+++ b/content/base/src/File.cpp
@@ -1,20 +1,20 @@
 /* -*- Mode: C++; tab-width: 2; 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 "mozilla/dom/File.h"
 
+#include "MultipartFileImpl.h"
 #include "nsCExternalHandlerService.h"
 #include "nsContentCID.h"
 #include "nsContentUtils.h"
-#include "nsDOMBlobBuilder.h"
 #include "nsError.h"
 #include "nsICharsetDetector.h"
 #include "nsIConverterInputStream.h"
 #include "nsIDocument.h"
 #include "nsIFileStreams.h"
 #include "nsIInputStream.h"
 #include "nsIIPCSerializableInputStream.h"
 #include "nsIMemoryReporter.h"
@@ -30,16 +30,17 @@
 #include "nsStringStream.h"
 #include "nsJSUtils.h"
 #include "nsPrintfCString.h"
 #include "mozilla/SHA1.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/BlobBinding.h"
+#include "mozilla/dom/BlobSet.h"
 #include "mozilla/dom/DOMError.h"
 #include "mozilla/dom/FileBinding.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "nsThreadUtils.h"
 
 #include "mozilla/dom/FileListBinding.h"
 
 namespace mozilla {
@@ -1233,10 +1234,75 @@ FileList::GetLength(uint32_t* aLength)
 NS_IMETHODIMP
 FileList::Item(uint32_t aIndex, nsIDOMFile **aFile)
 {
   nsRefPtr<File> file = Item(aIndex);
   file.forget(aFile);
   return NS_OK;
 }
 
+////////////////////////////////////////////////////////////////////////////
+// BlobSet implementation
+
+already_AddRefed<File>
+BlobSet::GetBlobInternal(nsISupports* aParent, const nsACString& aContentType)
+{
+  nsRefPtr<File> blob = new File(aParent,
+    new MultipartFileImpl(GetBlobImpls(),
+                          NS_ConvertASCIItoUTF16(aContentType)));
+  return blob.forget();
+}
+
+nsresult
+BlobSet::AppendVoidPtr(const void* aData, uint32_t aLength)
+{
+  NS_ENSURE_ARG_POINTER(aData);
+
+  uint64_t offset = mDataLen;
+
+  if (!ExpandBufferSize(aLength))
+    return NS_ERROR_OUT_OF_MEMORY;
+
+  memcpy((char*)mData + offset, aData, aLength);
+  return NS_OK;
+}
+
+nsresult
+BlobSet::AppendString(const nsAString& aString, bool nativeEOL, JSContext* aCx)
+{
+  nsCString utf8Str = NS_ConvertUTF16toUTF8(aString);
+
+  if (nativeEOL) {
+    if (utf8Str.FindChar('\r') != kNotFound) {
+      utf8Str.ReplaceSubstring("\r\n", "\n");
+      utf8Str.ReplaceSubstring("\r", "\n");
+    }
+#ifdef XP_WIN
+    utf8Str.ReplaceSubstring("\n", "\r\n");
+#endif
+  }
+
+  return AppendVoidPtr((void*)utf8Str.Data(),
+                       utf8Str.Length());
+}
+
+nsresult
+BlobSet::AppendBlobImpl(FileImpl* aBlobImpl)
+{
+  NS_ENSURE_ARG_POINTER(aBlobImpl);
+
+  Flush();
+  mBlobImpls.AppendElement(aBlobImpl);
+
+  return NS_OK;
+}
+
+nsresult
+BlobSet::AppendBlobImpls(const nsTArray<nsRefPtr<FileImpl>>& aBlobImpls)
+{
+  Flush();
+  mBlobImpls.AppendElements(aBlobImpls);
+
+  return NS_OK;
+}
+
 } // dom namespace
 } // mozilla namespace
rename from content/base/src/nsDOMBlobBuilder.cpp
rename to content/base/src/MultipartFileImpl.cpp
--- a/content/base/src/nsDOMBlobBuilder.cpp
+++ b/content/base/src/MultipartFileImpl.cpp
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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 "nsDOMBlobBuilder.h"
+#include "MultipartFileImpl.h"
 #include "jsfriendapi.h"
+#include "mozilla/dom/BlobSet.h"
 #include "mozilla/dom/FileBinding.h"
 #include "nsAutoPtr.h"
 #include "nsDOMClassInfoID.h"
 #include "nsIMultiplexInputStream.h"
 #include "nsStringStream.h"
 #include "nsTArray.h"
 #include "nsJSUtils.h"
 #include "nsContentUtils.h"
@@ -345,61 +346,8 @@ MultipartFileImpl::InitializeChromeFile(
   nsCOMPtr<nsIFile> file;
   aRv = NS_NewLocalFile(aData, false, getter_AddRefs(file));
   if (NS_WARN_IF(aRv.Failed())) {
     return;
   }
 
   InitializeChromeFile(aWindow, file, aBag, false, aRv);
 }
-
-nsresult
-BlobSet::AppendVoidPtr(const void* aData, uint32_t aLength)
-{
-  NS_ENSURE_ARG_POINTER(aData);
-
-  uint64_t offset = mDataLen;
-
-  if (!ExpandBufferSize(aLength))
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  memcpy((char*)mData + offset, aData, aLength);
-  return NS_OK;
-}
-
-nsresult
-BlobSet::AppendString(const nsAString& aString, bool aNativeEOL, JSContext* aCx)
-{
-  NS_ConvertUTF16toUTF8 utf8Str(aString);
-
-  if (aNativeEOL) {
-    if (utf8Str.FindChar('\r') != kNotFound) {
-      utf8Str.ReplaceSubstring("\r\n", "\n");
-      utf8Str.ReplaceSubstring("\r", "\n");
-    }
-#ifdef XP_WIN
-    utf8Str.ReplaceSubstring("\n", "\r\n");
-#endif
-  }
-
-  return AppendVoidPtr((void*)utf8Str.Data(),
-                       utf8Str.Length());
-}
-
-nsresult
-BlobSet::AppendBlobImpl(FileImpl* aBlobImpl)
-{
-  NS_ENSURE_ARG_POINTER(aBlobImpl);
-
-  Flush();
-  mBlobImpls.AppendElement(aBlobImpl);
-
-  return NS_OK;
-}
-
-nsresult
-BlobSet::AppendBlobImpls(const nsTArray<nsRefPtr<FileImpl>>& aBlobImpls)
-{
-  Flush();
-  mBlobImpls.AppendElements(aBlobImpls);
-
-  return NS_OK;
-}
rename from content/base/src/nsDOMBlobBuilder.h
rename to content/base/src/MultipartFileImpl.h
--- a/content/base/src/nsDOMBlobBuilder.h
+++ b/content/base/src/MultipartFileImpl.h
@@ -1,15 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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 nsDOMBlobBuilder_h
-#define nsDOMBlobBuilder_h
+#ifndef mozilla_dom_MultipartFileImpl_h
+#define mozilla_dom_MultipartFileImpl_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/BlobBinding.h"
 #include "mozilla/dom/FileBinding.h"
 #include <algorithm>
@@ -115,84 +115,9 @@ protected:
   virtual ~MultipartFileImpl() {}
 
   void SetLengthAndModifiedDate();
 
   nsTArray<nsRefPtr<FileImpl>> mBlobImpls;
   bool mIsFromNsIFile;
 };
 
-class BlobSet {
-public:
-  BlobSet()
-    : mData(nullptr), mDataLen(0), mDataBufferLen(0)
-  {}
-
-  ~BlobSet()
-  {
-    moz_free(mData);
-  }
-
-  nsresult AppendVoidPtr(const void* aData, uint32_t aLength);
-  nsresult AppendString(const nsAString& aString, bool nativeEOL, JSContext* aCx);
-  nsresult AppendBlobImpl(FileImpl* aBlobImpl);
-  nsresult AppendBlobImpls(const nsTArray<nsRefPtr<FileImpl>>& aBlobImpls);
-
-  nsTArray<nsRefPtr<FileImpl>>& GetBlobImpls() { Flush(); return mBlobImpls; }
-
-  already_AddRefed<File>
-  GetBlobInternal(nsISupports* aParent, const nsACString& aContentType)
-  {
-    nsRefPtr<File> blob = new File(aParent,
-      new MultipartFileImpl(GetBlobImpls(), NS_ConvertASCIItoUTF16(aContentType)));
-    return blob.forget();
-  }
-
-protected:
-  bool ExpandBufferSize(uint64_t aSize)
-  {
-    using mozilla::CheckedUint32;
-
-    if (mDataBufferLen >= mDataLen + aSize) {
-      mDataLen += aSize;
-      return true;
-    }
-
-    // Start at 1 or we'll loop forever.
-    CheckedUint32 bufferLen =
-      std::max<uint32_t>(static_cast<uint32_t>(mDataBufferLen), 1);
-    while (bufferLen.isValid() && bufferLen.value() < mDataLen + aSize)
-      bufferLen *= 2;
-
-    if (!bufferLen.isValid())
-      return false;
-
-    void* data = moz_realloc(mData, bufferLen.value());
-    if (!data)
-      return false;
-
-    mData = data;
-    mDataBufferLen = bufferLen.value();
-    mDataLen += aSize;
-    return true;
-  }
-
-  void Flush() {
-    if (mData) {
-      // If we have some data, create a blob for it
-      // and put it on the stack
-
-      nsRefPtr<FileImpl> blobImpl =
-        new FileImplMemory(mData, mDataLen, EmptyString());
-      mBlobImpls.AppendElement(blobImpl);
-      mData = nullptr; // The FileImplMemory takes ownership of the buffer
-      mDataLen = 0;
-      mDataBufferLen = 0;
-    }
-  }
-
-  nsTArray<nsRefPtr<FileImpl>> mBlobImpls;
-  void* mData;
-  uint64_t mDataLen;
-  uint64_t mDataBufferLen;
-};
-
-#endif
+#endif // mozilla_dom_MultipartFileImpl_h
--- a/content/base/src/moz.build
+++ b/content/base/src/moz.build
@@ -99,16 +99,17 @@ UNIFIED_SOURCES += [
     'DOMStringList.cpp',
     'Element.cpp',
     'EventSource.cpp',
     'File.cpp',
     'FileIOObject.cpp',
     'FragmentOrElement.cpp',
     'ImportManager.cpp',
     'Link.cpp',
+    'MultipartFileImpl.cpp',
     'NodeIterator.cpp',
     'nsAtomListUtils.cpp',
     'nsAttrAndChildArray.cpp',
     'nsAttrValue.cpp',
     'nsAttrValueOrString.cpp',
     'nsCCUncollectableMarker.cpp',
     'nsChannelPolicy.cpp',
     'nsContentAreaDragDrop.cpp',
@@ -120,17 +121,16 @@ UNIFIED_SOURCES += [
     'nsCrossSiteListenerProxy.cpp',
     'nsCSPContext.cpp',
     'nsCSPParser.cpp',
     'nsCSPService.cpp',
     'nsCSPUtils.cpp',
     'nsDataDocumentContentPolicy.cpp',
     'nsDocumentEncoder.cpp',
     'nsDOMAttributeMap.cpp',
-    'nsDOMBlobBuilder.cpp',
     'nsDOMCaretPosition.cpp',
     'nsDOMFileReader.cpp',
     'nsDOMMutationObserver.cpp',
     'nsDOMSerializer.cpp',
     'nsDOMSettableTokenList.cpp',
     'nsDOMTokenList.cpp',
     'nsElementFrameLoaderOwner.cpp',
     'nsFormData.cpp',
--- a/content/base/src/nsXMLHttpRequest.cpp
+++ b/content/base/src/nsXMLHttpRequest.cpp
@@ -5,23 +5,23 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsXMLHttpRequest.h"
 
 #ifndef XP_WIN
 #include <unistd.h>
 #endif
 #include "mozilla/ArrayUtils.h"
+#include "mozilla/dom/BlobSet.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/XMLHttpRequestUploadBinding.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/EventListenerManager.h"
 #include "mozilla/LoadInfo.h"
 #include "mozilla/MemoryReporting.h"
-#include "nsDOMBlobBuilder.h"
 #include "nsIDOMDocument.h"
 #include "mozilla/dom/ProgressEvent.h"
 #include "nsIJARChannel.h"
 #include "nsIJARURI.h"
 #include "nsLayoutCID.h"
 #include "nsReadableUtils.h"
 
 #include "nsIURI.h"
--- a/content/base/src/nsXMLHttpRequest.h
+++ b/content/base/src/nsXMLHttpRequest.h
@@ -36,26 +36,26 @@
 
 #ifdef Status
 /* Xlib headers insist on this for some reason... Nuke it because
    it'll override our member name */
 #undef Status
 #endif
 
 class AsyncVerifyRedirectCallbackForwarder;
-class BlobSet;
 class nsFormData;
 class nsIJARChannel;
 class nsILoadGroup;
 class nsIUnicodeDecoder;
 class nsIJSID;
 
 namespace mozilla {
 
 namespace dom {
+class BlobSet;
 class File;
 }
 
 // A helper for building up an ArrayBuffer object's data
 // before creating the ArrayBuffer itself.  Will do doubling
 // based reallocation, up to an optional maximum growth given.
 //
 // When all the data has been appended, call getArrayBuffer,
@@ -671,17 +671,17 @@ protected:
   // It is either a cached blob-response from the last call to GetResponse,
   // but is also explicitly set in OnStopRequest.
   nsRefPtr<mozilla::dom::File> mResponseBlob;
   // Non-null only when we are able to get a os-file representation of the
   // response, i.e. when loading from a file.
   nsRefPtr<mozilla::dom::File> mDOMFile;
   // We stream data to mBlobSet when response type is "blob" or "moz-blob"
   // and mDOMFile is null.
-  nsAutoPtr<BlobSet> mBlobSet;
+  nsAutoPtr<mozilla::dom::BlobSet> mBlobSet;
 
   nsString mOverrideMimeType;
 
   /**
    * The notification callbacks the channel had when Send() was
    * called.  We want to forward things here as needed.
    */
   nsCOMPtr<nsIInterfaceRequestor> mNotificationCallbacks;
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -30,17 +30,16 @@
 #include "nsCRTGlue.h"
 #include "nsICategoryManager.h"
 #include "nsIComponentRegistrar.h"
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIXPConnect.h"
 #include "xptcall.h"
 #include "nsTArray.h"
-#include "nsDOMBlobBuilder.h"
 
 // General helper includes
 #include "nsGlobalWindow.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMEventListener.h"
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -69,17 +69,16 @@
 #include "mozilla/dom/TabChild.h"
 #include "mozilla/dom/IDBFactoryBinding.h"
 #include "mozilla/dom/IDBMutableFileBinding.h"
 #include "mozilla/dom/indexedDB/IDBMutableFile.h"
 #include "mozilla/dom/indexedDB/IndexedDatabaseManager.h"
 #include "mozilla/dom/PermissionMessageUtils.h"
 #include "mozilla/dom/quota/PersistenceType.h"
 #include "mozilla/dom/quota/QuotaManager.h"
-#include "nsDOMBlobBuilder.h"
 #include "nsPrintfCString.h"
 #include "nsViewportInfo.h"
 #include "nsIFormControl.h"
 #include "nsIScriptError.h"
 #include "nsIAppShell.h"
 #include "nsWidgetsCID.h"
 #include "FrameLayerBuilder.h"
 #include "nsDisplayList.h"
--- a/dom/devicestorage/nsDeviceStorage.cpp
+++ b/dom/devicestorage/nsDeviceStorage.cpp
@@ -31,17 +31,16 @@
 #include "nsArrayUtils.h"
 #include "nsAutoPtr.h"
 #include "nsGlobalWindow.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIFile.h"
 #include "nsIDirectoryEnumerator.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceDefs.h"
-#include "nsDOMBlobBuilder.h"
 #include "nsNetUtil.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIPrincipal.h"
 #include "nsJSUtils.h"
 #include "nsContentUtils.h"
 #include "nsXULAppAPI.h"
 #include "DeviceStorageFileDescriptor.h"
 #include "DeviceStorageRequestChild.h"
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -29,17 +29,16 @@
 #include "mozJSComponentLoader.h"
 #include "mozJSLoaderUtils.h"
 #include "nsIXPConnect.h"
 #include "nsIObserverService.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIFileURL.h"
 #include "nsIJARURI.h"
 #include "nsNetUtil.h"
-#include "nsDOMBlobBuilder.h"
 #include "jsprf.h"
 #include "nsJSPrincipals.h"
 #include "nsJSUtils.h"
 #include "xpcprivate.h"
 #include "xpcpublic.h"
 #include "nsContentUtils.h"
 #include "WrapperFactory.h"
 
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -62,17 +62,16 @@
 #include "nsDOMSerializer.h"
 #include "nsXMLHttpRequest.h"
 #include "nsChannelPolicy.h"
 
 // view stuff
 #include "nsContentCreatorFunctions.h"
 
 // DOM includes
-#include "nsDOMBlobBuilder.h"
 #include "nsDOMFileReader.h"
 
 #include "nsFormData.h"
 #include "nsHostObjectProtocolHandler.h"
 #include "nsHostObjectURI.h"
 #include "nsGlobalWindowCommands.h"
 #include "nsIControllerCommandTable.h"
 #include "nsJSProtocolHandler.h"