Bug 1545758 - Move dom/file IPC components into mozilla::dom namespace - TemporaryIPCBlob actors, r=qdot
authorAndrea Marchesini <amarchesini@mozilla.com>
Fri, 26 Apr 2019 18:01:53 +0000
changeset 530378 46448e3d918547f7323fee417cf2f44ff66782db
parent 530377 9e87f6fa89b7019290cdf40cb2d354528a571c4d
child 530379 ffd5b4fd36a5f3dfd69b87474db73cbbce1dbaf5
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1545758
milestone68.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 1545758 - Move dom/file IPC components into mozilla::dom namespace - TemporaryIPCBlob actors, r=qdot Differential Revision: https://phabricator.services.mozilla.com/D28190
dom/file/MutableBlobStorage.cpp
dom/file/ipc/PTemporaryIPCBlob.ipdl
dom/file/ipc/TemporaryIPCBlobChild.h
dom/file/ipc/TemporaryIPCBlobParent.h
dom/file/ipc/moz.build
ipc/glue/BackgroundChildImpl.cpp
ipc/glue/BackgroundParentImpl.cpp
ipc/ipdl/ipdl/direct_call.py
--- a/dom/file/MutableBlobStorage.cpp
+++ b/dom/file/MutableBlobStorage.cpp
@@ -3,17 +3,17 @@
 /* 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/TemporaryIPCBlobChild.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/PBackgroundChild.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/TaskQueue.h"
 #include "File.h"
 #include "nsAnonymousTemporaryFile.h"
 #include "nsNetCID.h"
--- a/dom/file/ipc/PTemporaryIPCBlob.ipdl
+++ b/dom/file/ipc/PTemporaryIPCBlob.ipdl
@@ -6,17 +6,17 @@ include protocol PBackground;
 include protocol PChildToParentStream;
 include protocol PFileDescriptorSet;
 include protocol PIPCBlobInputStream;
 include protocol PParentToChildStream;
 
 include IPCBlob;
 
 namespace mozilla {
-namespace ipc {
+namespace dom {
 
 union IPCBlobOrError
 {
   IPCBlob;
   nsresult;
 };
 
 protocol PTemporaryIPCBlob
@@ -34,10 +34,10 @@ child:
   async __delete__(IPCBlobOrError aBlobOrError);
 
 parent:
   async OperationFailed();
 
   async OperationDone(nsCString aContentType, FileDescriptor aFD);
 };
 
-} // namespace ipc
+} // namespace dom 
 } // namespace mozilla
--- a/dom/file/ipc/TemporaryIPCBlobChild.h
+++ b/dom/file/ipc/TemporaryIPCBlobChild.h
@@ -1,36 +1,35 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef mozilla_dom_ipc_TemporaryIPCBlobChild_h
-#define mozilla_dom_ipc_TemporaryIPCBlobChild_h
+#ifndef mozilla_dom_TemporaryIPCBlobChild_h
+#define mozilla_dom_TemporaryIPCBlobChild_h
 
-#include "mozilla/ipc/PTemporaryIPCBlob.h"
-#include "mozilla/ipc/PTemporaryIPCBlobChild.h"
+#include "mozilla/dom/PTemporaryIPCBlob.h"
+#include "mozilla/dom/PTemporaryIPCBlobChild.h"
 
 namespace mozilla {
 namespace dom {
 
 class MutableBlobStorage;
 
 class TemporaryIPCBlobChildCallback {
  public:
   NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING
 
   virtual void OperationSucceeded(BlobImpl* aBlobImpl) = 0;
   virtual void OperationFailed(nsresult aRv) = 0;
 };
 
-class TemporaryIPCBlobChild final
-    : public mozilla::ipc::PTemporaryIPCBlobChild {
-  friend class mozilla::ipc::PTemporaryIPCBlobChild;
+class TemporaryIPCBlobChild final : public PTemporaryIPCBlobChild {
+  friend class PTemporaryIPCBlobChild;
 
  public:
   NS_INLINE_DECL_REFCOUNTING(TemporaryIPCBlobChild)
 
   explicit TemporaryIPCBlobChild(MutableBlobStorage* aMutableBlobStorage);
 
   void AskForBlob(TemporaryIPCBlobChildCallback* aCallback,
                   const nsACString& aContentType, PRFileDesc* aFD);
@@ -48,9 +47,9 @@ class TemporaryIPCBlobChild final
   RefPtr<MutableBlobStorage> mMutableBlobStorage;
   RefPtr<TemporaryIPCBlobChildCallback> mCallback;
   bool mActive;
 };
 
 }  // namespace dom
 }  // namespace mozilla
 
-#endif  // mozilla_dom_ipc_TemporaryIPCBlobChild_h
+#endif  // mozilla_dom_TemporaryIPCBlobChild_h
--- a/dom/file/ipc/TemporaryIPCBlobParent.h
+++ b/dom/file/ipc/TemporaryIPCBlobParent.h
@@ -1,28 +1,27 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef mozilla_dom_ipc_TemporaryIPCBlobParent_h
-#define mozilla_dom_ipc_TemporaryIPCBlobParent_h
+#ifndef mozilla_dom_TemporaryIPCBlobParent_h
+#define mozilla_dom_TemporaryIPCBlobParent_h
 
-#include "mozilla/ipc/PTemporaryIPCBlob.h"
-#include "mozilla/ipc/PTemporaryIPCBlobParent.h"
+#include "mozilla/dom/PTemporaryIPCBlob.h"
+#include "mozilla/dom/PTemporaryIPCBlobParent.h"
 
 class nsIFile;
 
 namespace mozilla {
 namespace dom {
 
-class TemporaryIPCBlobParent final
-    : public mozilla::ipc::PTemporaryIPCBlobParent {
-  friend class mozilla::ipc::PTemporaryIPCBlobParent;
+class TemporaryIPCBlobParent final : public PTemporaryIPCBlobParent {
+  friend class PTemporaryIPCBlobParent;
 
  public:
   explicit TemporaryIPCBlobParent();
 
   mozilla::ipc::IPCResult CreateAndShareFile();
 
  private:
   ~TemporaryIPCBlobParent();
@@ -38,9 +37,9 @@ class TemporaryIPCBlobParent final
 
   nsCOMPtr<nsIFile> mFile;
   bool mActive;
 };
 
 }  // namespace dom
 }  // namespace mozilla
 
-#endif  // mozilla_dom_ipc_TemporaryIPCBlobParent_h
+#endif  // mozilla_dom_TemporaryIPCBlobParent_h
--- a/dom/file/ipc/moz.build
+++ b/dom/file/ipc/moz.build
@@ -14,25 +14,25 @@ XPIDL_SOURCES += [
 XPIDL_MODULE = 'dom'
 
 EXPORTS.mozilla.dom += [
     'FileCreatorChild.h',
     'FileCreatorParent.h',
     'IPCBlobUtils.h',
     'PendingIPCBlobChild.h',
     'PendingIPCBlobParent.h',
+    'TemporaryIPCBlobChild.h',
+    'TemporaryIPCBlobParent.h',
 ]
 
 EXPORTS.mozilla.dom.ipc += [
     'IPCBlobInputStream.h',
     'IPCBlobInputStreamChild.h',
     'IPCBlobInputStreamParent.h',
     'IPCBlobInputStreamStorage.h',
-    'TemporaryIPCBlobChild.h',
-    'TemporaryIPCBlobParent.h',
 ]
 
 UNIFIED_SOURCES += [
     'FileCreatorChild.cpp',
     'FileCreatorParent.cpp',
     'IPCBlobInputStream.cpp',
     'IPCBlobInputStreamChild.cpp',
     'IPCBlobInputStreamParent.cpp',
--- a/ipc/glue/BackgroundChildImpl.cpp
+++ b/ipc/glue/BackgroundChildImpl.cpp
@@ -21,21 +21,21 @@
 #include "mozilla/dom/PBackgroundLSObserverChild.h"
 #include "mozilla/dom/PBackgroundLSRequestChild.h"
 #include "mozilla/dom/PBackgroundLSSimpleRequestChild.h"
 #include "mozilla/dom/PBackgroundSDBConnectionChild.h"
 #include "mozilla/dom/PFileSystemRequestChild.h"
 #include "mozilla/dom/EndpointForReportChild.h"
 #include "mozilla/dom/FileSystemTaskBase.h"
 #include "mozilla/dom/PendingIPCBlobChild.h"
+#include "mozilla/dom/TemporaryIPCBlobChild.h"
 #include "mozilla/dom/cache/ActorUtils.h"
 #include "mozilla/dom/indexedDB/PBackgroundIDBFactoryChild.h"
 #include "mozilla/dom/indexedDB/PBackgroundIndexedDBUtilsChild.h"
 #include "mozilla/dom/ipc/IPCBlobInputStreamChild.h"
-#include "mozilla/dom/ipc/TemporaryIPCBlobChild.h"
 #include "mozilla/dom/IPCBlobUtils.h"
 #include "mozilla/dom/quota/PQuotaChild.h"
 #include "mozilla/dom/RemoteWorkerChild.h"
 #include "mozilla/dom/RemoteWorkerServiceChild.h"
 #include "mozilla/dom/SharedWorkerChild.h"
 #include "mozilla/dom/StorageIPC.h"
 #include "mozilla/dom/GamepadEventChannelChild.h"
 #include "mozilla/dom/GamepadTestChannelChild.h"
@@ -364,25 +364,26 @@ dom::PSharedWorkerChild* BackgroundChild
 
 bool BackgroundChildImpl::DeallocPSharedWorkerChild(
     dom::PSharedWorkerChild* aActor) {
   RefPtr<dom::SharedWorkerChild> actor =
       dont_AddRef(static_cast<dom::SharedWorkerChild*>(aActor));
   return true;
 }
 
-PTemporaryIPCBlobChild* BackgroundChildImpl::AllocPTemporaryIPCBlobChild() {
+dom::PTemporaryIPCBlobChild*
+BackgroundChildImpl::AllocPTemporaryIPCBlobChild() {
   MOZ_CRASH("This is not supposed to be called.");
   return nullptr;
 }
 
 bool BackgroundChildImpl::DeallocPTemporaryIPCBlobChild(
-    PTemporaryIPCBlobChild* aActor) {
-  RefPtr<mozilla::dom::TemporaryIPCBlobChild> actor =
-      dont_AddRef(static_cast<mozilla::dom::TemporaryIPCBlobChild*>(aActor));
+    dom::PTemporaryIPCBlobChild* aActor) {
+  RefPtr<dom::TemporaryIPCBlobChild> actor =
+      dont_AddRef(static_cast<dom::TemporaryIPCBlobChild*>(aActor));
   return true;
 }
 
 dom::PFileCreatorChild* BackgroundChildImpl::AllocPFileCreatorChild(
     const nsString& aFullPath, const nsString& aType, const nsString& aName,
     const Maybe<int64_t>& aLastModified, const bool& aExistenceCheck,
     const bool& aIsFromNsIFile) {
   return new dom::FileCreatorChild();
--- a/ipc/glue/BackgroundParentImpl.cpp
+++ b/ipc/glue/BackgroundParentImpl.cpp
@@ -25,20 +25,20 @@
 #include "mozilla/dom/PGamepadEventChannelParent.h"
 #include "mozilla/dom/PGamepadTestChannelParent.h"
 #include "mozilla/dom/MessagePortParent.h"
 #include "mozilla/dom/PendingIPCBlobParent.h"
 #include "mozilla/dom/ServiceWorkerActors.h"
 #include "mozilla/dom/ServiceWorkerManagerParent.h"
 #include "mozilla/dom/ServiceWorkerRegistrar.h"
 #include "mozilla/dom/StorageActivityService.h"
+#include "mozilla/dom/TemporaryIPCBlobParent.h"
 #include "mozilla/dom/cache/ActorUtils.h"
 #include "mozilla/dom/indexedDB/ActorsParent.h"
 #include "mozilla/dom/ipc/IPCBlobInputStreamParent.h"
-#include "mozilla/dom/ipc/TemporaryIPCBlobParent.h"
 #include "mozilla/dom/IPCBlobUtils.h"
 #include "mozilla/dom/localstorage/ActorsParent.h"
 #include "mozilla/dom/quota/ActorsParent.h"
 #include "mozilla/dom/simpledb/ActorsParent.h"
 #include "mozilla/dom/RemoteWorkerParent.h"
 #include "mozilla/dom/RemoteWorkerServiceParent.h"
 #include "mozilla/dom/ReportingHeader.h"
 #include "mozilla/dom/SharedWorkerParent.h"
@@ -581,29 +581,30 @@ mozilla::ipc::IPCResult BackgroundParent
 
 bool BackgroundParentImpl::DeallocPFileCreatorParent(
     dom::PFileCreatorParent* aActor) {
   RefPtr<dom::FileCreatorParent> actor =
       dont_AddRef(static_cast<dom::FileCreatorParent*>(aActor));
   return true;
 }
 
-PTemporaryIPCBlobParent* BackgroundParentImpl::AllocPTemporaryIPCBlobParent() {
-  return new mozilla::dom::TemporaryIPCBlobParent();
+dom::PTemporaryIPCBlobParent*
+BackgroundParentImpl::AllocPTemporaryIPCBlobParent() {
+  return new dom::TemporaryIPCBlobParent();
 }
 
 mozilla::ipc::IPCResult BackgroundParentImpl::RecvPTemporaryIPCBlobConstructor(
-    PTemporaryIPCBlobParent* aActor) {
-  mozilla::dom::TemporaryIPCBlobParent* actor =
-      static_cast<mozilla::dom::TemporaryIPCBlobParent*>(aActor);
+    dom::PTemporaryIPCBlobParent* aActor) {
+  dom::TemporaryIPCBlobParent* actor =
+      static_cast<dom::TemporaryIPCBlobParent*>(aActor);
   return actor->CreateAndShareFile();
 }
 
 bool BackgroundParentImpl::DeallocPTemporaryIPCBlobParent(
-    PTemporaryIPCBlobParent* aActor) {
+    dom::PTemporaryIPCBlobParent* aActor) {
   delete aActor;
   return true;
 }
 
 PIPCBlobInputStreamParent* BackgroundParentImpl::AllocPIPCBlobInputStreamParent(
     const nsID& aID, const uint64_t& aSize) {
   AssertIsInMainOrSocketProcess();
   AssertIsOnBackgroundThread();
--- a/ipc/ipdl/ipdl/direct_call.py
+++ b/ipc/ipdl/ipdl/direct_call.py
@@ -88,23 +88,16 @@ DIRECT_CALL_OVERRIDES = {
     ),
     ("PTCPSocket", "child"): (
         "mozilla::dom::TCPSocketChild", "mozilla/dom/network/TCPSocketChild.h"
     ),
     ("PTCPSocket", "parent"): (
         "mozilla::dom::TCPSocketParent", "mozilla/dom/network/TCPSocketParent.h"
     ),
 
-    ("PTemporaryIPCBlob", "child"): (
-        "mozilla::dom::TemporaryIPCBlobChild", "mozilla/dom/ipc/TemporaryIPCBlobChild.h"
-    ),
-    ("PTemporaryIPCBlob", "parent"): (
-        "mozilla::dom::TemporaryIPCBlobParent", "mozilla/dom/ipc/TemporaryIPCBlobParent.h"
-    ),
-
     ("PTestShellCommand", "parent"): ("TestShellCommandParent", "mozilla/ipc/TestShellParent.h"),
 
     ("PTransportProvider", "child"): (
         "TransportProviderChild", "mozilla/net/IPCTransportProvider.h"
     ),
     ("PTransportProvider", "parent"): (
         "TransportProviderParent", "mozilla/net/IPCTransportProvider.h"
     ),