Backed out changeset d3ef6f3e9193 (bug 1321261) for build bustage (calling missing file BlobParent.h from dom/ipc/TabParent.cpp). r=backout on a CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 01 Dec 2016 12:27:28 +0100
changeset 446581 29fd1259e299250eb26e4c83dbef8c55de612305
parent 446580 961f1e72a7b5a04ac81f6b468c7b45daaabc7452
child 446582 5b14585f3efcd201d4552591d2bbe3acc42cc4ba
push id37820
push userbmo:afarre@mozilla.com
push dateThu, 01 Dec 2016 15:12:21 +0000
reviewersbackout
bugs1321261
milestone53.0a1
backs outd3ef6f3e91935f619c0aa8ea7fa4ab3e85373d60
Backed out changeset d3ef6f3e9193 (bug 1321261) for build bustage (calling missing file BlobParent.h from dom/ipc/TabParent.cpp). r=backout on a CLOSED TREE
b2g/installer/package-manifest.in
browser/installer/package-manifest.in
dom/base/BlobSet.cpp
dom/base/BlobSet.h
dom/base/File.cpp
dom/base/File.h
dom/base/FileList.cpp
dom/base/FileList.h
dom/base/FileReader.cpp
dom/base/FileReader.h
dom/base/MultipartBlobImpl.cpp
dom/base/MultipartBlobImpl.h
dom/base/MutableBlobStorage.cpp
dom/base/MutableBlobStorage.h
dom/base/MutableBlobStreamListener.cpp
dom/base/MutableBlobStreamListener.h
dom/base/StructuredCloneHolder.cpp
dom/base/moz.build
dom/base/nsDOMNavigationTiming.cpp
dom/base/nsHostObjectProtocolHandler.cpp
dom/base/nsHostObjectProtocolHandler.h
dom/base/nsHostObjectURI.cpp
dom/base/nsHostObjectURI.h
dom/base/nsIDOMBlob.idl
dom/base/nsIDOMFileList.idl
dom/base/test/create_file_objects.js
dom/base/test/file_blobURL_expiring.html
dom/base/test/file_mozfiledataurl_audio.ogg
dom/base/test/file_mozfiledataurl_doc.html
dom/base/test/file_mozfiledataurl_inner.html
dom/base/test/file_mozfiledataurl_text.txt
dom/base/test/file_nonascii_blob_url.html
dom/base/test/fileapi_chromeScript.js
dom/base/test/fileutils.js
dom/base/test/mochitest.ini
dom/base/test/test_blobURL_expiring.html
dom/base/test/test_blob_fragment_and_query.html
dom/base/test/test_blobconstructor.html
dom/base/test/test_file_from_blob.html
dom/base/test/test_file_negative_date.html
dom/base/test/test_fileapi.html
dom/base/test/test_fileapi_slice.html
dom/base/test/test_ipc_messagemanager_blob.html
dom/base/test/test_mozfiledataurl.html
dom/base/test/test_nonascii_blob_url.html
dom/file/BlobSet.cpp
dom/file/BlobSet.h
dom/file/File.cpp
dom/file/File.h
dom/file/FileList.cpp
dom/file/FileList.h
dom/file/FileReader.cpp
dom/file/FileReader.h
dom/file/MultipartBlobImpl.cpp
dom/file/MultipartBlobImpl.h
dom/file/MutableBlobStorage.cpp
dom/file/MutableBlobStorage.h
dom/file/MutableBlobStreamListener.cpp
dom/file/MutableBlobStreamListener.h
dom/file/ipc/Blob.cpp
dom/file/ipc/BlobChild.h
dom/file/ipc/BlobParent.h
dom/file/ipc/BlobTypes.ipdlh
dom/file/ipc/PBlob.ipdl
dom/file/ipc/PBlobStream.ipdl
dom/file/ipc/moz.build
dom/file/ipc/nsIRemoteBlob.h
dom/file/moz.build
dom/file/nsHostObjectProtocolHandler.cpp
dom/file/nsHostObjectProtocolHandler.h
dom/file/nsHostObjectURI.cpp
dom/file/nsHostObjectURI.h
dom/file/nsIDOMBlob.idl
dom/file/nsIDOMFileList.idl
dom/file/tests/create_file_objects.js
dom/file/tests/file_blobURL_expiring.html
dom/file/tests/file_mozfiledataurl_audio.ogg
dom/file/tests/file_mozfiledataurl_doc.html
dom/file/tests/file_mozfiledataurl_img.jpg
dom/file/tests/file_mozfiledataurl_inner.html
dom/file/tests/file_mozfiledataurl_text.txt
dom/file/tests/file_nonascii_blob_url.html
dom/file/tests/fileapi_chromeScript.js
dom/file/tests/fileutils.js
dom/file/tests/mochitest.ini
dom/file/tests/test_blobURL_expiring.html
dom/file/tests/test_blob_fragment_and_query.html
dom/file/tests/test_blobconstructor.html
dom/file/tests/test_file_from_blob.html
dom/file/tests/test_file_negative_date.html
dom/file/tests/test_fileapi.html
dom/file/tests/test_fileapi_slice.html
dom/file/tests/test_ipc_messagemanager_blob.html
dom/file/tests/test_nonascii_blob_url.html
dom/ipc/Blob.cpp
dom/ipc/BlobChild.h
dom/ipc/BlobParent.h
dom/ipc/BlobTypes.ipdlh
dom/ipc/ContentChild.cpp
dom/ipc/ContentParent.cpp
dom/ipc/PBlob.ipdl
dom/ipc/PBlobStream.ipdl
dom/ipc/TabParent.cpp
dom/ipc/moz.build
dom/ipc/nsIRemoteBlob.h
dom/moz.build
dom/xhr/moz.build
image/ImageCacheKey.cpp
mobile/android/installer/package-manifest.in
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -145,17 +145,16 @@
 @RESPATH@/components/cookie.xpt
 @RESPATH@/components/directory.xpt
 @RESPATH@/components/diskspacewatcher.xpt
 @RESPATH@/components/docshell.xpt
 @RESPATH@/components/dom.xpt
 @RESPATH@/components/dom_activities.xpt
 @RESPATH@/components/dom_audiochannel.xpt
 @RESPATH@/components/dom_base.xpt
-@RESPATH@/components/dom_file.xpt
 @RESPATH@/components/dom_system.xpt
 @RESPATH@/components/dom_workers.xpt
 #ifdef MOZ_WIDGET_GONK
 @RESPATH@/components/dom_wifi.xpt
 @RESPATH@/components/dom_system_gonk.xpt
 #endif
 @RESPATH@/components/dom_canvas.xpt
 @RESPATH@/components/dom_core.xpt
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -185,17 +185,16 @@
 @RESPATH@/components/content_webrtc.xpt
 #endif
 @RESPATH@/components/content_xslt.xpt
 @RESPATH@/components/cookie.xpt
 @RESPATH@/components/directory.xpt
 @RESPATH@/components/docshell.xpt
 @RESPATH@/components/dom.xpt
 @RESPATH@/components/dom_base.xpt
-@RESPATH@/components/dom_file.xpt
 @RESPATH@/components/dom_system.xpt
 @RESPATH@/components/dom_canvas.xpt
 @RESPATH@/components/dom_core.xpt
 @RESPATH@/components/dom_css.xpt
 @RESPATH@/components/dom_events.xpt
 @RESPATH@/components/dom_geolocation.xpt
 @RESPATH@/components/dom_media.xpt
 @RESPATH@/components/dom_network.xpt
rename from dom/file/BlobSet.cpp
rename to dom/base/BlobSet.cpp
rename from dom/file/BlobSet.h
rename to dom/base/BlobSet.h
--- a/dom/file/BlobSet.h
+++ b/dom/base/BlobSet.h
@@ -2,20 +2,17 @@
 /* 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_BlobSet_h
 #define mozilla_dom_BlobSet_h
 
-#include "jsapi.h"
 #include "mozilla/RefPtr.h"
-#include "nsString.h"
-#include "nsTArray.h"
 
 namespace mozilla {
 namespace dom {
 
 class BlobImpl;
 
 class BlobSet final
 {
rename from dom/file/File.cpp
rename to dom/base/File.cpp
--- a/dom/file/File.cpp
+++ b/dom/base/File.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 "mozilla/dom/File.h"
 
-#include "ipc/nsIRemoteBlob.h"
 #include "MultipartBlobImpl.h"
 #include "nsCExternalHandlerService.h"
 #include "nsContentCID.h"
 #include "nsContentUtils.h"
 #include "nsError.h"
 #include "nsICharsetDetector.h"
 #include "nsIConverterInputStream.h"
 #include "nsIDocument.h"
 #include "nsIFileStreams.h"
 #include "nsIInputStream.h"
 #include "nsIIPCSerializableInputStream.h"
 #include "nsIMIMEService.h"
 #include "nsISeekableStream.h"
 #include "nsIUnicharInputStream.h"
 #include "nsIUnicodeDecoder.h"
+#include "nsIRemoteBlob.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsIUUIDGenerator.h"
 #include "nsHostObjectProtocolHandler.h"
 #include "nsStringStream.h"
 #include "nsJSUtils.h"
 #include "nsPrintfCString.h"
 #include "mozilla/SHA1.h"
rename from dom/file/File.h
rename to dom/base/File.h
rename from dom/file/FileList.cpp
rename to dom/base/FileList.cpp
rename from dom/file/FileList.h
rename to dom/base/FileList.h
rename from dom/file/FileReader.cpp
rename to dom/base/FileReader.cpp
rename from dom/file/FileReader.h
rename to dom/base/FileReader.h
rename from dom/file/MultipartBlobImpl.cpp
rename to dom/base/MultipartBlobImpl.cpp
rename from dom/file/MultipartBlobImpl.h
rename to dom/base/MultipartBlobImpl.h
rename from dom/file/MutableBlobStorage.cpp
rename to dom/base/MutableBlobStorage.cpp
--- a/dom/file/MutableBlobStorage.cpp
+++ b/dom/base/MutableBlobStorage.cpp
@@ -4,17 +4,16 @@
  * 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/MutableBlobStorage.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/dom/File.h"
 #include "nsAnonymousTemporaryFile.h"
 #include "nsNetCID.h"
-#include "nsProxyRelease.h"
 #include "WorkerPrivate.h"
 
 #define BLOB_MEMORY_TEMPORARY_FILE 1048576
 
 namespace mozilla {
 namespace dom {
 
 namespace {
rename from dom/file/MutableBlobStorage.h
rename to dom/base/MutableBlobStorage.h
rename from dom/file/MutableBlobStreamListener.cpp
rename to dom/base/MutableBlobStreamListener.cpp
rename from dom/file/MutableBlobStreamListener.h
rename to dom/base/MutableBlobStreamListener.h
--- a/dom/base/StructuredCloneHolder.cpp
+++ b/dom/base/StructuredCloneHolder.cpp
@@ -16,17 +16,16 @@
 #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/ipc/nsIRemoteBlob.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"
@@ -34,16 +33,17 @@
 #include "mozilla/dom/URLSearchParams.h"
 #include "mozilla/dom/URLSearchParamsBinding.h"
 #include "mozilla/dom/WebCryptoCommon.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/ipc/PBackgroundSharedTypes.h"
 #include "MultipartBlobImpl.h"
+#include "nsIRemoteBlob.h"
 #include "nsQueryObject.h"
 
 #ifdef MOZ_WEBRTC
 #include "mozilla/dom/RTCCertificate.h"
 #include "mozilla/dom/RTCCertificateBinding.h"
 #endif
 
 using namespace mozilla::ipc;
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -6,19 +6,21 @@
 
 TEST_DIRS += ['test']
 
 XPIDL_SOURCES += [
     'mozIDOMWindow.idl',
     'nsIContentPolicy.idl',
     'nsIContentPolicyBase.idl',
     'nsIDocumentEncoder.idl',
+    'nsIDOMBlob.idl',
     'nsIDOMDataChannel.idl',
     'nsIDOMDOMCursor.idl',
     'nsIDOMDOMRequest.idl',
+    'nsIDOMFileList.idl',
     'nsIDOMFormData.idl',
     'nsIDOMParser.idl',
     'nsIDOMSerializer.idl',
     'nsIDroppedLinkHandler.idl',
     'nsIFrameLoader.idl',
     'nsIImageLoadingContent.idl',
     'nsIMessageManager.idl',
     'nsIObjectLoadingContent.idl',
@@ -71,16 +73,18 @@ EXPORTS += [
     'nsDOMJSUtils.h',
     'nsDOMNavigationTiming.h',
     'nsDOMString.h',
     'nsFocusManager.h',
     'nsFrameMessageManager.h',
     'nsGenericDOMDataNode.h',
     'nsGkAtomList.h',
     'nsGkAtoms.h',
+    'nsHostObjectProtocolHandler.h',
+    'nsHostObjectURI.h',
     'nsIAnimationObserver.h',
     'nsIAttribute.h',
     'nsIContent.h',
     'nsIContentInlines.h',
     'nsIContentIterator.h',
     'nsIContentSerializer.h',
     'nsIDocument.h',
     'nsIDocumentInlines.h',
@@ -142,16 +146,17 @@ EXPORTS.mozilla += [
     'UseCounter.h',
 ]
 
 EXPORTS.mozilla.dom += [
     '!UseCounterList.h',
     'AnonymousContent.h',
     'Attr.h',
     'BarProps.h',
+    'BlobSet.h',
     'BodyUtil.h',
     'BorrowedAttrInfo.h',
     'ChildIterator.h',
     'ChromeNodeList.h',
     'ChromeUtils.h',
     'Comment.h',
     'CustomElementRegistry.h',
     'DirectionalityUtils.h',
@@ -170,27 +175,32 @@ EXPORTS.mozilla.dom += [
     'DOMQuad.h',
     'DOMRect.h',
     'DOMRequest.h',
     'DOMStringList.h',
     'DOMTokenListSupportedTokens.h',
     'Element.h',
     'ElementInlines.h',
     'EventSource.h',
+    'File.h',
+    'FileList.h',
+    'FileReader.h',
     'FormData.h',
     'FragmentOrElement.h',
     'FromParser.h',
     'GroupedSHistory.h',
     'IdleDeadline.h',
     'IdleRequest.h',
     'ImageEncoder.h',
     'ImageTracker.h',
     'ImportManager.h',
     'Link.h',
     'Location.h',
+    'MutableBlobStorage.h',
+    'MutableBlobStreamListener.h',
     'NameSpaceConstants.h',
     'Navigator.h',
     'NodeInfo.h',
     'NodeInfoInlines.h',
     'NodeIterator.h',
     'PartialSHistory.h',
     'Pose.h',
     'ProcessGlobal.h',
@@ -211,16 +221,17 @@ EXPORTS.mozilla.dom += [
     'WebSocket.h',
     'WindowOrientationObserver.h',
 ]
 
 UNIFIED_SOURCES += [
     'AnonymousContent.cpp',
     'Attr.cpp',
     'BarProps.cpp',
+    'BlobSet.cpp',
     'BodyUtil.cpp',
     'BorrowedAttrInfo.cpp',
     'ChildIterator.cpp',
     'ChromeNodeList.cpp',
     'ChromeUtils.cpp',
     'Comment.cpp',
     'Crypto.cpp',
     'CustomElementRegistry.cpp',
@@ -237,26 +248,32 @@ UNIFIED_SOURCES += [
     'DOMParser.cpp',
     'DOMPoint.cpp',
     'DOMQuad.cpp',
     'DOMRect.cpp',
     'DOMRequest.cpp',
     'DOMStringList.cpp',
     'Element.cpp',
     'EventSource.cpp',
+    'File.cpp',
+    'FileList.cpp',
+    'FileReader.cpp',
     'FormData.cpp',
     'FragmentOrElement.cpp',
     'GroupedSHistory.cpp',
     'IdleDeadline.cpp',
     'IdleRequest.cpp',
     'ImageEncoder.cpp',
     'ImageTracker.cpp',
     'ImportManager.cpp',
     'Link.cpp',
     'Location.cpp',
+    'MultipartBlobImpl.cpp',
+    'MutableBlobStorage.cpp',
+    'MutableBlobStreamListener.cpp',
     'Navigator.cpp',
     'NodeInfo.cpp',
     'NodeIterator.cpp',
     'nsAtomListUtils.cpp',
     'nsAttrAndChildArray.cpp',
     'nsAttrValue.cpp',
     'nsAttrValueOrString.cpp',
     'nsCCUncollectableMarker.cpp',
@@ -280,16 +297,18 @@ UNIFIED_SOURCES += [
     'nsDOMWindowList.cpp',
     'nsFocusManager.cpp',
     'nsFrameLoader.cpp',
     'nsGenConImageContent.cpp',
     'nsGenericDOMDataNode.cpp',
     'nsGkAtoms.cpp',
     'nsGlobalWindowCommands.cpp',
     'nsHistory.cpp',
+    'nsHostObjectProtocolHandler.cpp',
+    'nsHostObjectURI.cpp',
     'nsHTMLContentSerializer.cpp',
     'nsIGlobalObject.cpp',
     'nsINode.cpp',
     'nsInProcessTabChildGlobal.cpp',
     'nsJSEnvironment.cpp',
     'nsJSTimeoutHandler.cpp',
     'nsJSUtils.cpp',
     'nsLineBreaker.cpp',
@@ -408,17 +427,16 @@ LOCAL_INCLUDES += [
     '../battery',
     '../events',
     '../media',
     '../network',
     '../time',
     '/caps',
     '/docshell/base',
     '/dom/base',
-    '/dom/file',
     '/dom/geolocation',
     '/dom/html',
     '/dom/ipc',
     '/dom/storage',
     '/dom/svg',
     '/dom/u2f',
     '/dom/workers',
     '/dom/xbl',
--- a/dom/base/nsDOMNavigationTiming.cpp
+++ b/dom/base/nsDOMNavigationTiming.cpp
@@ -10,19 +10,16 @@
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "nsIScriptSecurityManager.h"
 #include "prtime.h"
 #include "nsIURI.h"
 #include "nsPrintfCString.h"
 #include "mozilla/dom/PerformanceNavigation.h"
 #include "mozilla/TimeStamp.h"
-#include "mozilla/Telemetry.h"
-
-using namespace mozilla;
 
 nsDOMNavigationTiming::nsDOMNavigationTiming()
 {
   Clear();
 }
 
 nsDOMNavigationTiming::~nsDOMNavigationTiming()
 {
@@ -50,36 +47,35 @@ nsDOMNavigationTiming::Clear()
   mDOMInteractiveSet = false;
   mDOMContentLoadedEventStartSet = false;
   mDOMContentLoadedEventEndSet = false;
   mDOMCompleteSet = false;
   mDocShellHasBeenActiveSinceNavigationStart = false;
 }
 
 DOMTimeMilliSec
-nsDOMNavigationTiming::TimeStampToDOM(TimeStamp aStamp) const
+nsDOMNavigationTiming::TimeStampToDOM(mozilla::TimeStamp aStamp) const
 {
   if (aStamp.IsNull()) {
     return 0;
   }
-
-  TimeDuration duration = aStamp - mNavigationStartTimeStamp;
+  mozilla::TimeDuration duration = aStamp - mNavigationStartTimeStamp;
   return GetNavigationStart() + static_cast<int64_t>(duration.ToMilliseconds());
 }
 
 DOMTimeMilliSec nsDOMNavigationTiming::DurationFromStart()
 {
-  return TimeStampToDOM(TimeStamp::Now());
+  return TimeStampToDOM(mozilla::TimeStamp::Now());
 }
 
 void
 nsDOMNavigationTiming::NotifyNavigationStart(DocShellState aDocShellState)
 {
   mNavigationStartHighRes = (double)PR_Now() / PR_USEC_PER_MSEC;
-  mNavigationStartTimeStamp = TimeStamp::Now();
+  mNavigationStartTimeStamp = mozilla::TimeStamp::Now();
   mDocShellHasBeenActiveSinceNavigationStart = (aDocShellState == DocShellState::eActive);
 }
 
 void
 nsDOMNavigationTiming::NotifyFetchStart(nsIURI* aURI, Type aNavigationType)
 {
   mNavigationType = aNavigationType;
   // At the unload event time we don't really know the loading uri.
@@ -126,17 +122,17 @@ nsDOMNavigationTiming::NotifyLoadEventEn
 {
   if (!mLoadEventEndSet) {
     mLoadEventEnd = DurationFromStart();
     mLoadEventEndSet = true;
   }
 }
 
 void
-nsDOMNavigationTiming::SetDOMLoadingTimeStamp(nsIURI* aURI, TimeStamp aValue)
+nsDOMNavigationTiming::SetDOMLoadingTimeStamp(nsIURI* aURI, mozilla::TimeStamp aValue)
 {
   if (!mDOMLoadingSet) {
     mLoadedURI = aURI;
     mDOMLoading = TimeStampToDOM(aValue);
     mDOMLoadingSet = true;
   }
 }
 
rename from dom/file/nsHostObjectProtocolHandler.cpp
rename to dom/base/nsHostObjectProtocolHandler.cpp
rename from dom/file/nsHostObjectProtocolHandler.h
rename to dom/base/nsHostObjectProtocolHandler.h
rename from dom/file/nsHostObjectURI.cpp
rename to dom/base/nsHostObjectURI.cpp
rename from dom/file/nsHostObjectURI.h
rename to dom/base/nsHostObjectURI.h
rename from dom/file/nsIDOMBlob.idl
rename to dom/base/nsIDOMBlob.idl
rename from dom/file/nsIDOMFileList.idl
rename to dom/base/nsIDOMFileList.idl
rename from dom/file/tests/create_file_objects.js
rename to dom/base/test/create_file_objects.js
rename from dom/file/tests/file_blobURL_expiring.html
rename to dom/base/test/file_blobURL_expiring.html
rename from dom/file/tests/file_mozfiledataurl_audio.ogg
rename to dom/base/test/file_mozfiledataurl_audio.ogg
rename from dom/file/tests/file_mozfiledataurl_doc.html
rename to dom/base/test/file_mozfiledataurl_doc.html
rename from dom/file/tests/file_mozfiledataurl_inner.html
rename to dom/base/test/file_mozfiledataurl_inner.html
rename from dom/file/tests/file_mozfiledataurl_text.txt
rename to dom/base/test/file_mozfiledataurl_text.txt
rename from dom/file/tests/file_nonascii_blob_url.html
rename to dom/base/test/file_nonascii_blob_url.html
rename from dom/file/tests/fileapi_chromeScript.js
rename to dom/base/test/fileapi_chromeScript.js
rename from dom/file/tests/fileutils.js
rename to dom/base/test/fileutils.js
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -49,16 +49,17 @@ support-files =
   bug696301-script-1.js
   bug696301-script-1.js^headers^
   bug696301-script-2.js
   bug704320.sjs
   bug704320_counter.sjs
   bug819051.sjs
   chrome/bug418986-1.js
   copypaste.js
+  create_file_objects.js
   delayedServerEvents.sjs
   eventsource.resource
   eventsource.resource^headers^
   eventsource_redirect.resource
   eventsource_redirect.resource^headers^
   eventsource_redirect_to.resource
   eventsource_redirect_to.resource^headers^
   file_base_xbl.xml
@@ -145,17 +146,21 @@ support-files =
   file_htmlserializer_2.html
   file_htmlserializer_2_basic.html
   file_htmlserializer_2_enthtml.html
   file_htmlserializer_2_entw3c.html
   file_htmlserializer_2_latin1.html
   file_htmlserializer_ipv6.html
   file_htmlserializer_ipv6_out.html
   file_lock_orientation.html
+  file_mozfiledataurl_audio.ogg
+  file_mozfiledataurl_doc.html
   file_mozfiledataurl_img.jpg
+  file_mozfiledataurl_inner.html
+  file_mozfiledataurl_text.txt
   file_record_orientation.html
   file_restrictedEventSource.sjs
   file_simplecontentpolicy.js
   file_timer_flood.html
   file_websocket_basic_wsh.py
   file_websocket_hello_wsh.py
   file_websocket_http_resource.txt
   file_websocket_permessage_deflate_wsh.py
@@ -179,16 +184,18 @@ support-files =
   file_xhtmlserializer_1_sibling_body_only_body.xhtml
   file_xhtmlserializer_1_wrap.xhtml
   file_xhtmlserializer_2.xhtml
   file_xhtmlserializer_2_basic.xhtml
   file_xhtmlserializer_2_enthtml.xhtml
   file_xhtmlserializer_2_entw3c.xhtml
   file_xhtmlserializer_2_latin1.xhtml
   file_youtube_flash_embed.html
+  fileapi_chromeScript.js
+  fileutils.js
   forRemoval.resource
   forRemoval.resource^headers^
   formReset.html
   invalid_accesscontrol.resource
   invalid_accesscontrol.resource^headers^
   mutationobserver_dialog.html
   orientationcommon.js
   script-1_bug597345.sjs
@@ -196,16 +203,17 @@ support-files =
   script_bug602838.sjs
   send_gzip_content.sjs
   somedatas.resource
   somedatas.resource^headers^
   variable_style_sheet.sjs
   viewport_helpers.js
   w3element_traversal.svg
   wholeTexty-helper.xml
+  file_nonascii_blob_url.html
   referrerHelper.js
   img_referrer_testserver.sjs
   file_audioLoop.html
   file_webaudioLoop.html
   file_webaudioLoop2.html
   file_pluginAudio.html
   file_pluginAudioNonAutoStart.html
   noaudio.webm
@@ -218,19 +226,22 @@ support-files =
   referrer_change_server.sjs
   file_change_policy_redirect.html
   file_bug1198095.js
   file_bug1250148.sjs
   file_bug1268962.sjs
   mozbrowser_api_utils.js
   websocket_helpers.js
   websocket_tests.js
+  !/dom/html/test/form_submit_server.sjs
   !/dom/security/test/cors/file_CrossSiteXHR_server.sjs
   !/image/test/mochitest/blue.png
+  !/dom/xhr/tests/file_XHRSendData.sjs
   script_bug1238440.js
+  file_blobURL_expiring.html
   intersectionobserver_iframe.html
   intersectionobserver_window.html
 
 [test_anchor_area_referrer.html]
 [test_anchor_area_referrer_changing.html]
 [test_anchor_area_referrer_invalid.html]
 [test_anchor_area_referrer_rel.html]
 [test_anonymousContent_api.html]
@@ -252,16 +263,19 @@ tags = audiochannel
 tags = audiochannel
 [test_audioNotificationStream.html]
 tags = audiochannel
 [test_audioNotificationStopOnNavigation.html]
 tags = audiochannel
 [test_audioNotificationWithEarlyPlay.html]
 tags = audiochannel
 [test_base.xhtml]
+[test_blob_fragment_and_query.html]
+[test_blobconstructor.html]
+[test_blobURL_expiring.html]
 [test_bug5141.html]
 [test_bug28293.html]
 [test_bug28293.xhtml]
 [test_bug51034.html]
 [test_bug116083.html]
 subsuite = clipboard
 [test_bug166235.html]
 subsuite = clipboard
@@ -628,16 +642,20 @@ skip-if = toolkit == 'android' || e10s #
 [test_e4x_for_each.html]
 [test_element.matches.html]
 [test_element_closest.html]
 [test_elementTraversal.html]
 [test_encodeToStringWithMaxLength.html]
 [test_error.html]
 [test_EventSource_redirects.html]
 [test_explicit_user_agent.html]
+[test_file_from_blob.html]
+[test_file_negative_date.html]
+[test_fileapi.html]
+[test_fileapi_slice.html]
 skip-if = (toolkit == 'android') # Android: Bug 775227
 [test_getAttribute_after_createAttribute.html]
 [test_getElementById.html]
 [test_getTranslationNodes.html]
 [test_getTranslationNodes_limit.html]
 [test_gsp-qualified.html]
 [test_gsp-quirks.html]
 [test_gsp-standards.html]
@@ -651,16 +669,17 @@ skip-if = (toolkit == 'android') # Andro
 [test_iframe_referrer_changing.html]
 [test_iframe_referrer_invalid.html]
 [test_Image_constructor.html]
 [test_img_referrer.html]
 [test_innersize_scrollport.html]
 [test_integer_attr_with_leading_zero.html]
 [test_intersectionobservers.html]
 skip-if = true # Track Bug 1320704
+[test_ipc_messagemanager_blob.html]
 [test_link_prefetch.html]
 skip-if = !e10s # Track Bug 1281415
 [test_link_stylesheet.html]
 [test_messagemanager_targetchain.html]
 [test_meta_viewport0.html]
 skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
 [test_meta_viewport1.html]
 skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
@@ -672,16 +691,18 @@ skip-if = (os != 'android')    # meta-vi
 skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
 [test_meta_viewport5.html]
 skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
 [test_meta_viewport6.html]
 skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
 [test_meta_viewport7.html]
 skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
 [test_mozbrowser_apis_blocked.html]
+[test_mozfiledataurl.html]
+skip-if = toolkit == 'android' #TIMED_OUT
 [test_mozMatchesSelector.html]
 [test_mutationobserver_anonymous.html]
 [test_mutationobservers.html]
 [test_named_frames.html]
 [test_navigator_hardwareConcurrency.html]
 [test_navigator_language.html]
 [test_navigatorPrefOverride.html]
 [test_noAudioNotification.html]
@@ -692,16 +713,17 @@ tags = audiochannel
 tags = audiochannel
 [test_noAudioNotificationOnVolume0Element.html]
 tags = audiochannel
 [test_NodeIterator_basics_filters.xhtml]
 [test_NodeIterator_mutations_1.xhtml]
 [test_NodeIterator_mutations_2.html]
 [test_NodeIterator_mutations_3.html]
 [test_nodelist_holes.html]
+[test_nonascii_blob_url.html]
 [test_noWebAudioNotification.html]
 tags = audiochannel
 [test_open_null_features.html]
 [test_openDialogChromeOnly.html]
 tags = openwindow
 [test_orientation_alternate.html]
 skip-if = true # bug 1312417
 [test_orientation_frame.html]
rename from dom/file/tests/test_blobURL_expiring.html
rename to dom/base/test/test_blobURL_expiring.html
rename from dom/file/tests/test_blob_fragment_and_query.html
rename to dom/base/test/test_blob_fragment_and_query.html
rename from dom/file/tests/test_blobconstructor.html
rename to dom/base/test/test_blobconstructor.html
rename from dom/file/tests/test_file_from_blob.html
rename to dom/base/test/test_file_from_blob.html
rename from dom/file/tests/test_file_negative_date.html
rename to dom/base/test/test_file_negative_date.html
rename from dom/file/tests/test_fileapi.html
rename to dom/base/test/test_fileapi.html
rename from dom/file/tests/test_fileapi_slice.html
rename to dom/base/test/test_fileapi_slice.html
rename from dom/file/tests/test_ipc_messagemanager_blob.html
rename to dom/base/test/test_ipc_messagemanager_blob.html
new file mode 100644
--- /dev/null
+++ b/dom/base/test/test_mozfiledataurl.html
@@ -0,0 +1,223 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
+  <title>Test for File urls</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body onload="start()">
+<p id="display">
+<iframe id=inner></iframe>
+<iframe id=iframe></iframe>
+<img id=img onload="gen.next(event);">
+<audio id=audio onloadeddata="gen.next(event);">
+</p>
+<div id="content" style="display: none">
+
+</div>
+<pre id="test">
+<script class="testbody" type="application/javascript;version=1.8">
+
+try {
+  URL.createObjectURL(undefined);
+} catch(e) { }
+
+window.addEventListener("message", function(e) {
+  gen.next(JSON.parse(e.data));
+}, false);
+
+const innerSameSiteURI = "file_mozfiledataurl_inner.html";
+const innerCrossSiteURI = "http://example.com/tests/dom/base/test/file_mozfiledataurl_inner.html"
+
+var fileNames = ["file_mozfiledataurl_img.jpg",
+                 "file_mozfiledataurl_audio.ogg",
+                 "file_mozfiledataurl_doc.html",
+                 "file_mozfiledataurl_text.txt"];
+
+function start() {
+  let xhr = new XMLHttpRequest;
+  xhr.open("GET", "/dynamic/getMyDirectory.sjs", false);
+  xhr.send();
+  let basePath = xhr.responseText;
+
+  let fullFileNames = [];
+  for (let name of fileNames) {
+    fullFileNames.push(basePath + name);
+  }
+
+  var script = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL("create_file_objects.js"));
+
+  script.addMessageListener("created-file-objects", function handler(files) {
+    script.removeMessageListener("created-file-objects", handler);
+    gen = runTest(files);
+    gen.next();
+  });
+
+  script.sendAsyncMessage("create-file-objects", {fileNames: fullFileNames});
+};
+
+SimpleTest.waitForExplicitFinish();
+
+function* runTest([imgFile, audioFile, docFile, xhrFile]) {
+  inner = document.getElementById('inner');
+  img = document.getElementById('img');
+  audio = document.getElementById('audio');
+  iframe = document.getElementById('iframe');
+  inner.onload = function() { gen.next("inner loaded"); };
+
+  // Attempt to load a image in this document
+  var fileurl = URL.createObjectURL(imgFile);
+  img.src = fileurl;
+  var e = (yield);
+  is(e.type, "load", "loaded successfully");
+  is(img.width, 120, "correct width");
+  is(img.height, 90, "correct height");
+
+  // Revoke url and attempt to load a image in this document
+  img.src = "file_mozfiledataurl_img.jpg";
+  is((yield).type, "load", "successfull reset image");
+  URL.revokeObjectURL(fileurl);
+  todo(false, "urls need to act like 404s, not fail to parse");
+/*  img.src = fileurl;
+  var e = (yield);
+  is(e.type, "error", "failed successfully");
+  isnot(img.width, 120, "correct error width");
+  isnot(img.height, 90, "correct error height");
+*/
+  // Generate new fileurl and make sure it's different from the old
+  var oldFileurl = fileurl;
+  fileurl = URL.createObjectURL(imgFile);
+  isnot(fileurl, oldFileurl, "URL.createObjectURL generated the same url twice");
+
+  // Attempt to load an image in a different same-origin document
+  inner.src = innerSameSiteURI;
+  yield undefined;
+  inner.contentWindow.postMessage(JSON.stringify({img:fileurl}), "*");
+  var res = (yield);
+  is(res.type, "load", "loaded successfully");
+  is(res.width, 120, "correct width");
+  is(res.height, 90, "correct height");
+
+  // Attempt to load an image in a different cross-origin document
+  inner.src = innerCrossSiteURI;
+  yield undefined;
+  inner.contentWindow.postMessage(JSON.stringify({img:fileurl}), "*");
+  var res = (yield);
+  is(res.type, "error", "failed successfully");
+  isnot(res.width, 120, "correct error width");
+  isnot(res.height, 90, "correct error height");
+
+  // Attempt to load an audio in this document
+  fileurl = URL.createObjectURL(audioFile);
+  audio.src = fileurl;
+  var e = (yield);
+  is(e.type, "loadeddata", "loaded successfully");
+
+  // Revoke url and attempt to load a audio in this document
+  audio.src = "file_mozfiledataurl_audio.ogg";
+  is((yield).type, "loadeddata", "successfully reset audio");
+  URL.revokeObjectURL(fileurl);
+  todo(false, "urls need to act like 404s, not fail to parse");
+/*  img.src = fileurl;
+  var e = (yield);
+  is(e.type, "error", "failed successfully");
+  isnot(img.width, 120, "correct error width");
+  isnot(img.height, 90, "correct error height");
+*/
+  // Generate new fileurl and make sure it's different from the old
+  var oldFileurl = fileurl;
+  fileurl = URL.createObjectURL(audioFile);
+  isnot(fileurl, oldFileurl, "URL.createObjectURL generated the same url twice");
+
+  // Attempt to load an audio in a different same-origin document
+  inner.src = innerSameSiteURI;
+  yield undefined;
+  inner.contentWindow.postMessage(JSON.stringify({audio:fileurl}), "*");
+  var res = (yield);
+  is(res.type, "loadeddata", "loaded successfully");
+
+  // Attempt to load an audio in a different cross-origin document
+  inner.src = innerCrossSiteURI;
+  yield undefined;
+  inner.contentWindow.postMessage(JSON.stringify({audio:fileurl}), "*");
+  var res = (yield);
+  is(res.type, "error", "failed successfully");
+
+  // Attempt to load a HTML document in an iframe in this document
+  iframe.onload = function() { gen.next(); };
+  iframe.src = "file_mozfiledataurl_doc.html";
+  yield undefined;
+  is(iframe.contentDocument.getElementsByTagName("p")[0].textContent,
+     "This here is a document!",
+     "iframe loaded successfully");
+  is(iframe.contentDocument.getElementById("img").width, 120,
+     "image in iframe width");
+  is(iframe.contentDocument.getElementById("img").height, 90,
+     "image in iframe height");
+
+  // Attempt to load a HTML document in an iframe in this document, using file url
+  fileurl = URL.createObjectURL(docFile);
+  iframe.src = fileurl;
+  yield undefined;
+  is(iframe.contentDocument.getElementsByTagName("p")[0].textContent,
+     "This here is a document!",
+     "iframe loaded successfully");
+  isnot(iframe.contentDocument.getElementById("img").width, 120,
+        "failed image in iframe width");
+  isnot(iframe.contentDocument.getElementById("img").height, 90,
+        "failed image in iframe height");
+
+  // Attempt to load a HTML document in an iframe in inner document
+  inner.src = innerSameSiteURI;
+  is((yield), "inner loaded", "correct gen.next()");
+  inner.contentWindow.postMessage(JSON.stringify({iframe:"file_mozfiledataurl_doc.html"}), "*");
+  var res = (yield);
+  is(res.type, "load", "loaded successfully");
+  is(res.text, "This here is a document!", "loaded successfully");
+  is(res.imgWidth, 120, "correct width");
+
+  // Attempt to load a HTML document in an iframe in inner document, using file url
+  inner.contentWindow.postMessage(JSON.stringify({iframe:fileurl}), "*");
+  var res = (yield);
+  is(res.type, "load", "loaded successfully");
+  is(res.text, "This here is a document!", "loaded successfully");
+  isnot(res.imgWidth, 120, "correct width");
+
+  // Attempt to load a HTML document in an iframe in inner cross-site document, using file url
+  inner.src = innerCrossSiteURI;
+  is((yield), "inner loaded", "correct gen.next()");
+  inner.contentWindow.postMessage(JSON.stringify({iframe:fileurl}), "*");
+  var res = (yield);
+  is(res.type, "error", "load failed successfully");
+
+  // Attempt to load file url using XHR
+  fileurl = URL.createObjectURL(xhrFile);
+  xhr = new XMLHttpRequest;
+  xhr.onload = function() { gen.next("XHR finished"); };
+  xhr.open("GET", fileurl);
+  xhr.send();
+  is((yield), "XHR finished", "correct gen.next()");
+  xhr.responseText == "Yarr, here be plaintext file, ya landlubber\n";
+
+  // Attempt to load file url using XHR in inner document
+  inner.src = innerSameSiteURI;
+  is((yield), "inner loaded", "correct gen.next()");
+  inner.contentWindow.postMessage(JSON.stringify({xhr:fileurl}), "*");
+  var res = (yield);
+  is(res.didThrow, undefined, "load successful");
+  is(res.text, "Yarr, here be plaintext file, ya landlubber\n", "load successful");
+
+  // Attempt to load file url using XHR
+  inner.src = innerCrossSiteURI;
+  is((yield), "inner loaded", "correct gen.next()");
+  inner.contentWindow.postMessage(JSON.stringify({xhr:fileurl}), "*");
+  var res = (yield);
+  is(res.didError, true, "load failed successfully");
+
+  SimpleTest.finish();
+}
+</script>
+</pre>
+</body>
+</html>
rename from dom/file/tests/test_nonascii_blob_url.html
rename to dom/base/test/test_nonascii_blob_url.html
--- a/dom/file/tests/test_nonascii_blob_url.html
+++ b/dom/base/test/test_nonascii_blob_url.html
@@ -7,17 +7,17 @@
   <script type="text/javascript" src="fileutils.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <div id="content"></div>
 <script class="testbody" type="text/javascript;version=1.7">
 
 var iframe = document.createElement('iframe');
-iframe.src = 'http://xn--exmple-cua.test/tests/dom/file/tests/file_nonascii_blob_url.html';
+iframe.src = 'http://xn--exmple-cua.test/tests/dom/base/test/file_nonascii_blob_url.html';
 iframe.onload = function() {
   iframe.contentWindow.postMessage('hello world', '*');
   onmessage = function(e) {
     is(e.data, 'hello world', "Blob URL for non-ascii domain works");
     SimpleTest.finish();
   }
 }
 
deleted file mode 100644
--- a/dom/file/ipc/moz.build
+++ /dev/null
@@ -1,36 +0,0 @@
-# -*- 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',
-    'nsIRemoteBlob.h',
-]
-
-UNIFIED_SOURCES += [
-    'Blob.cpp',
-]
-
-IPDL_SOURCES += [
-    'BlobTypes.ipdlh',
-    'PBlob.ipdl',
-    'PBlobStream.ipdl',
-]
-
-LOCAL_INCLUDES += [
-    '/dom/file',
-    '/dom/ipc',
-    '/dom/workers',
-]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-FINAL_LIBRARY = 'xul'
-
-CXXFLAGS += CONFIG['TK_CFLAGS']
-
-if CONFIG['GNU_CXX']:
-    CXXFLAGS += ['-Wno-error=shadow']
deleted file mode 100644
--- a/dom/file/moz.build
+++ /dev/null
@@ -1,50 +0,0 @@
-# -*- 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/.
-
-DIRS += ['ipc']
-
-XPIDL_SOURCES += [
-    'nsIDOMBlob.idl',
-    'nsIDOMFileList.idl',
-]
-
-XPIDL_MODULE = 'dom_file'
-
-EXPORTS += [
-    'nsHostObjectProtocolHandler.h',
-    'nsHostObjectURI.h',
-]
-
-EXPORTS.mozilla.dom += [
-    'BlobSet.h',
-    'File.h',
-    'FileList.h',
-    'FileReader.h',
-    'MutableBlobStorage.h',
-    'MutableBlobStreamListener.h',
-]
-
-UNIFIED_SOURCES += [
-    'BlobSet.cpp',
-    'File.cpp',
-    'FileList.cpp',
-    'FileReader.cpp',
-    'MultipartBlobImpl.cpp',
-    'MutableBlobStorage.cpp',
-    'MutableBlobStreamListener.cpp',
-    'nsHostObjectProtocolHandler.cpp',
-    'nsHostObjectURI.cpp',
-]
-
-LOCAL_INCLUDES += [
-    '/dom/workers',
-]
-
-MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-FINAL_LIBRARY = 'xul'
deleted file mode 100644
index dcd99b967047b034ae4393188a97f156267fbe5e..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/dom/file/tests/mochitest.ini
+++ /dev/null
@@ -1,27 +0,0 @@
-[DEFAULT]
-support-files =
-  create_file_objects.js
-  file_blobURL_expiring.html
-  file_mozfiledataurl_img.jpg
-  file_mozfiledataurl_audio.ogg
-  file_mozfiledataurl_doc.html
-  file_mozfiledataurl_text.txt
-  file_mozfiledataurl_inner.html
-  file_nonascii_blob_url.html
-  fileutils.js
-  fileapi_chromeScript.js
-  !/dom/html/test/form_submit_server.sjs
-  !/dom/xhr/tests/file_XHRSendData.sjs
-
-[test_blob_fragment_and_query.html]
-[test_blobconstructor.html]
-[test_blobURL_expiring.html]
-[test_file_from_blob.html]
-[test_ipc_messagemanager_blob.html]
-[test_nonascii_blob_url.html]
-[test_file_negative_date.html]
-[test_fileapi.html]
-[test_fileapi_slice.html]
-skip-if = (toolkit == 'android') # Android: Bug 775227
-[test_mozfiledataurl.html]
-skip-if = toolkit == 'android' #TIMED_OUT
rename from dom/file/ipc/Blob.cpp
rename to dom/ipc/Blob.cpp
--- a/dom/file/ipc/Blob.cpp
+++ b/dom/ipc/Blob.cpp
@@ -384,16 +384,30 @@ OptionalFileDescriptorSetToFDs(OptionalF
 
     default:
       MOZ_CRASH("Unknown type!");
   }
 
   MOZ_CRASH("Should never get here!");
 }
 
+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)
+
 // 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
 {
@@ -465,32 +479,16 @@ NS_INTERFACE_MAP_BEGIN(BlobInputStreamTe
   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;
@@ -555,18 +553,16 @@ private:
   NS_DECL_NSISEEKABLESTREAM
   NS_DECL_NSIIPCSERIALIZABLEINPUTSTREAM
   NS_DECL_NSIFILEMETADATA
 
   nsIInputStream*
   BlockAndGetInternalStream() override;
 };
 
-namespace {
-
 class InputStreamChild final
   : public PBlobStreamChild
 {
   RefPtr<RemoteInputStream> mRemoteStream;
 
 public:
   explicit
   InputStreamChild(RemoteInputStream* aRemoteStream)
@@ -583,16 +579,111 @@ public:
 
 private:
   // This method is only called by the IPDL message machinery.
   mozilla::ipc::IPCResult
   Recv__delete__(const InputStreamParams& aParams,
                  const OptionalFileDescriptorSet& aFDs) override;
 };
 
+class InputStreamParent final
+  : public PBlobStreamParent
+{
+  typedef mozilla::ipc::InputStreamParams InputStreamParams;
+  typedef mozilla::dom::OptionalFileDescriptorSet OptionalFileDescriptorSet;
+
+  bool* mSyncLoopGuard;
+  InputStreamParams* mParams;
+  OptionalFileDescriptorSet* mFDs;
+
+#ifdef DEBUG
+  PRThread* mOwningThread;
+#endif
+
+public:
+  InputStreamParent()
+    : mSyncLoopGuard(nullptr)
+    , mParams(nullptr)
+    , mFDs(nullptr)
+  {
+#ifdef DEBUG
+    mOwningThread = PR_GetCurrentThread();
+#endif
+
+    AssertIsOnOwningThread();
+
+    MOZ_COUNT_CTOR(InputStreamParent);
+  }
+
+  InputStreamParent(bool* aSyncLoopGuard,
+                    InputStreamParams* aParams,
+                    OptionalFileDescriptorSet* aFDs)
+    : mSyncLoopGuard(aSyncLoopGuard)
+    , mParams(aParams)
+    , mFDs(aFDs)
+  {
+#ifdef DEBUG
+    mOwningThread = PR_GetCurrentThread();
+#endif
+
+    AssertIsOnOwningThread();
+    MOZ_ASSERT(aSyncLoopGuard);
+    MOZ_ASSERT(!*aSyncLoopGuard);
+    MOZ_ASSERT(aParams);
+    MOZ_ASSERT(aFDs);
+
+    MOZ_COUNT_CTOR(InputStreamParent);
+  }
+
+  ~InputStreamParent() override
+  {
+    AssertIsOnOwningThread();
+
+    MOZ_COUNT_DTOR(InputStreamParent);
+  }
+
+  void
+  AssertIsOnOwningThread() const
+  {
+#ifdef DEBUG
+    MOZ_ASSERT(PR_GetCurrentThread() == mOwningThread);
+#endif
+  }
+
+  bool
+  Destroy(const InputStreamParams& aParams,
+          const OptionalFileDescriptorSet& aFDs)
+  {
+    AssertIsOnOwningThread();
+
+    if (mSyncLoopGuard) {
+      MOZ_ASSERT(!*mSyncLoopGuard);
+
+      *mSyncLoopGuard = true;
+      *mParams = aParams;
+      *mFDs = aFDs;
+
+      // We're not a live actor so manage the memory ourselves.
+      delete this;
+      return true;
+    }
+
+    // This will be destroyed by BlobParent::DeallocPBlobStreamParent.
+    return PBlobStreamParent::Send__delete__(this, aParams, aFDs);
+  }
+
+private:
+  // This method is only called by the IPDL message machinery.
+  void
+  ActorDestroy(ActorDestroyReason aWhy) override
+  {
+    // Nothing needs to be done here.
+  }
+};
+
 struct MOZ_STACK_CLASS CreateBlobImplMetadata final
 {
   nsString mContentType;
   nsString mName;
   uint64_t mLength;
   int64_t mLastModifiedDate;
   bool mHasRecursed;
 
@@ -613,18 +704,16 @@ struct MOZ_STACK_CLASS CreateBlobImplMet
 
   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);
@@ -1341,110 +1430,18 @@ RemoteInputStream::BlockAndGetInternalSt
   MOZ_ASSERT(!IsOnOwningThread());
 
   nsresult rv = BlockAndWaitForStream();
   NS_ENSURE_SUCCESS(rv, nullptr);
 
   return mStream;
 }
 
-class InputStreamParent final
-  : public PBlobStreamParent
-{
-  typedef mozilla::ipc::InputStreamParams InputStreamParams;
-  typedef mozilla::dom::OptionalFileDescriptorSet OptionalFileDescriptorSet;
-
-  bool* mSyncLoopGuard;
-  InputStreamParams* mParams;
-  OptionalFileDescriptorSet* mFDs;
-
-#ifdef DEBUG
-  PRThread* mOwningThread;
-#endif
-
-public:
-  InputStreamParent()
-    : mSyncLoopGuard(nullptr)
-    , mParams(nullptr)
-    , mFDs(nullptr)
-  {
-#ifdef DEBUG
-    mOwningThread = PR_GetCurrentThread();
-#endif
-
-    AssertIsOnOwningThread();
-
-    MOZ_COUNT_CTOR(InputStreamParent);
-  }
-
-  InputStreamParent(bool* aSyncLoopGuard,
-                    InputStreamParams* aParams,
-                    OptionalFileDescriptorSet* aFDs)
-    : mSyncLoopGuard(aSyncLoopGuard)
-    , mParams(aParams)
-    , mFDs(aFDs)
-  {
-#ifdef DEBUG
-    mOwningThread = PR_GetCurrentThread();
-#endif
-
-    AssertIsOnOwningThread();
-    MOZ_ASSERT(aSyncLoopGuard);
-    MOZ_ASSERT(!*aSyncLoopGuard);
-    MOZ_ASSERT(aParams);
-    MOZ_ASSERT(aFDs);
-
-    MOZ_COUNT_CTOR(InputStreamParent);
-  }
-
-  ~InputStreamParent() override
-  {
-    AssertIsOnOwningThread();
-
-    MOZ_COUNT_DTOR(InputStreamParent);
-  }
-
-  void
-  AssertIsOnOwningThread() const
-  {
-#ifdef DEBUG
-    MOZ_ASSERT(PR_GetCurrentThread() == mOwningThread);
-#endif
-  }
-
-  bool
-  Destroy(const InputStreamParams& aParams,
-          const OptionalFileDescriptorSet& aFDs)
-  {
-    AssertIsOnOwningThread();
-
-    if (mSyncLoopGuard) {
-      MOZ_ASSERT(!*mSyncLoopGuard);
-
-      *mSyncLoopGuard = true;
-      *mParams = aParams;
-      *mFDs = aFDs;
-
-      // We're not a live actor so manage the memory ourselves.
-      delete this;
-      return true;
-    }
-
-    // This will be destroyed by BlobParent::DeallocPBlobStreamParent.
-    return PBlobStreamParent::Send__delete__(this, aParams, aFDs);
-  }
-
-private:
-  // This method is only called by the IPDL message machinery.
-  void
-  ActorDestroy(ActorDestroyReason aWhy) override
-  {
-    // Nothing needs to be done here.
-  }
-};
+} // namespace
+
 StaticAutoPtr<BlobParent::IDTable> BlobParent::sIDTable;
 StaticAutoPtr<Mutex> BlobParent::sIDTableMutex;
 
 /*******************************************************************************
  * BlobParent::IDTableEntry Declaration
  ******************************************************************************/
 
 class BlobParent::IDTableEntry final
rename from dom/file/ipc/BlobChild.h
rename to dom/ipc/BlobChild.h
rename from dom/file/ipc/BlobParent.h
rename to dom/ipc/BlobParent.h
rename from dom/file/ipc/BlobTypes.ipdlh
rename to dom/ipc/BlobTypes.ipdlh
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifdef MOZ_WIDGET_GTK
 #include <gtk/gtk.h>
 #endif
 
 #include "ContentChild.h"
 
+#include "BlobChild.h"
 #include "CrashReporterChild.h"
 #include "GeckoProfiler.h"
 #include "TabChild.h"
 #include "HandlerServiceChild.h"
 
 #include "mozilla/Attributes.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/Preferences.h"
@@ -32,17 +33,16 @@
 #include "mozilla/dom/FlyWebPublishedServerIPC.h"
 #include "mozilla/dom/GetFilesHelper.h"
 #include "mozilla/dom/PCrashReporterChild.h"
 #include "mozilla/dom/ProcessGlobal.h"
 #include "mozilla/dom/PushNotifier.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"
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -20,16 +20,17 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #endif
 
 #include "chrome/common/process_watcher.h"
 
 #include "mozilla/a11y/PDocAccessible.h"
 #include "AudioChannelService.h"
+#include "BlobParent.h"
 #include "CrashReporterParent.h"
 #include "DeviceStorageStatics.h"
 #include "GMPServiceParent.h"
 #include "HandlerServiceParent.h"
 #include "IHistory.h"
 #include "imgIContainer.h"
 #if defined(XP_WIN) && defined(ACCESSIBILITY)
 #include "mozilla/a11y/AccessibleWrap.h"
@@ -58,17 +59,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/PSendStreamParent.h"
rename from dom/file/ipc/PBlob.ipdl
rename to dom/ipc/PBlob.ipdl
rename from dom/file/ipc/PBlobStream.ipdl
rename to dom/ipc/PBlobStream.ipdl
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -14,17 +14,16 @@
 #include "nsAccessibilityService.h"
 #endif
 #include "mozilla/BrowserElementParent.h"
 #include "mozilla/dom/ContentBridgeParent.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/DataTransfer.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/indexedDB/ActorsParent.h"
-#include "mozilla/dom/ipc/BlobParent.h"
 #include "mozilla/plugins/PluginWidgetParent.h"
 #include "mozilla/EventStateManager.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/gfx/DataSurfaceHelpers.h"
 #include "mozilla/gfx/GPUProcessManager.h"
 #include "mozilla/Hal.h"
 #include "mozilla/IMEStateManager.h"
 #include "mozilla/ipc/DocumentRendererParent.h"
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -6,17 +6,20 @@
 
 XPIDL_SOURCES += [
     'nsIHangReport.idl',
 ]
 
 XPIDL_MODULE = 'dom'
 
 EXPORTS.mozilla.dom.ipc += [
+    'BlobChild.h',
+    'BlobParent.h',
     'IdType.h',
+    'nsIRemoteBlob.h',
     'StructuredCloneData.h',
 ]
 
 EXPORTS.mozilla.dom += [
     'ContentBridgeChild.h',
     'ContentBridgeParent.h',
     'ContentChild.h',
     'ContentParent.h',
@@ -62,27 +65,32 @@ UNIFIED_SOURCES += [
     'TabChild.cpp',
     'TabContext.cpp',
     'TabMessageUtils.cpp',
     'TabParent.cpp',
     'URLClassifierChild.cpp',
     'URLClassifierParent.cpp',
 ]
 
+# Blob.cpp cannot be compiled in unified mode because it triggers a fatal gcc warning.
 # CrashReporterChild.cpp cannot be compiled in unified mode because of name clashes
 # in OS X headers.
 # ContentChild.cpp cannot be compiled in unified mode on  linux due to Time conflict
 SOURCES += [
+    'Blob.cpp',
     'ContentChild.cpp',
     'CrashReporterChild.cpp',
     'ProcessHangMonitor.cpp',
 ]
 
 IPDL_SOURCES += [
+    'BlobTypes.ipdlh',
     'DOMTypes.ipdlh',
+    'PBlob.ipdl',
+    'PBlobStream.ipdl',
     'PBrowser.ipdl',
     'PBrowserOrId.ipdlh',
     'PColorPicker.ipdl',
     'PContent.ipdl',
     'PContentBridge.ipdl',
     'PContentPermission.ipdlh',
     'PContentPermissionRequest.ipdl',
     'PCrashReporter.ipdl',
rename from dom/file/ipc/nsIRemoteBlob.h
rename to dom/ipc/nsIRemoteBlob.h
--- a/dom/moz.build
+++ b/dom/moz.build
@@ -43,17 +43,16 @@ DIRS += [
     'browser-element',
     'cache',
     'canvas',
     'crypto',
     'devicestorage',
     'encoding',
     'events',
     'fetch',
-    'file',
     'filehandle',
     'filesystem',
     'flyweb',
     'gamepad',
     'geolocation',
     'grid',
     'html',
     'json',
--- a/dom/xhr/moz.build
+++ b/dom/xhr/moz.build
@@ -24,17 +24,16 @@ UNIFIED_SOURCES += [
     'XMLHttpRequestMainThread.cpp',
     'XMLHttpRequestString.cpp',
     'XMLHttpRequestUpload.cpp',
     'XMLHttpRequestWorker.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/dom/base',
-    '/dom/file',
     '/dom/workers',
     '/netwerk/base',
 ]
 
 MOCHITEST_MANIFESTS += [ 'tests/mochitest.ini' ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
--- a/image/ImageCacheKey.cpp
+++ b/image/ImageCacheKey.cpp
@@ -1,20 +1,20 @@
 /* -*- 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 "ImageCacheKey.h"
 
 #include "mozilla/Move.h"
+#include "File.h"
 #include "ImageURL.h"
 #include "nsHostObjectProtocolHandler.h"
 #include "nsString.h"
-#include "mozilla/dom/File.h"
 #include "mozilla/dom/workers/ServiceWorkerManager.h"
 #include "nsIDocument.h"
 #include "nsPrintfCString.h"
 
 namespace mozilla {
 
 using namespace dom;
 
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -113,17 +113,16 @@
 @BINPATH@/components/directory.xpt
 @BINPATH@/components/docshell.xpt
 @BINPATH@/components/dom.xpt
 @BINPATH@/components/dom_base.xpt
 @BINPATH@/components/dom_canvas.xpt
 @BINPATH@/components/dom_core.xpt
 @BINPATH@/components/dom_css.xpt
 @BINPATH@/components/dom_events.xpt
-@BINPATH@/components/dom_file.xpt
 @BINPATH@/components/dom_geolocation.xpt
 @BINPATH@/components/dom_media.xpt
 @BINPATH@/components/dom_network.xpt
 @BINPATH@/components/dom_notification.xpt
 @BINPATH@/components/dom_html.xpt
 @BINPATH@/components/dom_offline.xpt
 @BINPATH@/components/dom_json.xpt
 @BINPATH@/components/dom_power.xpt