Bug 1545758 - Move dom/file IPC components into mozilla::dom namespace - PendingIPCBlob actors, r=qdot

Differential Revision: https://phabricator.services.mozilla.com/D28189

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrea Marchesini 2019-04-26 18:01:08 +00:00
parent de9252905e
commit 69fd7c57d7
9 changed files with 24 additions and 29 deletions

View File

@ -7,7 +7,7 @@ include protocol PBackground;
include IPCBlob; include IPCBlob;
namespace mozilla { namespace mozilla {
namespace ipc { namespace dom {
// IndexedDB and FileHandle do not know all the Blob/File properties when they // IndexedDB and FileHandle do not know all the Blob/File properties when they
// create a IPCBlob. For this reason, they need to use this simple protocol. // create a IPCBlob. For this reason, they need to use this simple protocol.

View File

@ -4,18 +4,18 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_ipc_PendingIPCBlobChild_h #ifndef mozilla_dom_PendingIPCBlobChild_h
#define mozilla_dom_ipc_PendingIPCBlobChild_h #define mozilla_dom_PendingIPCBlobChild_h
#include "mozilla/ipc/PPendingIPCBlob.h" #include "mozilla/dom/PPendingIPCBlob.h"
#include "mozilla/ipc/PPendingIPCBlobChild.h" #include "mozilla/dom/PPendingIPCBlobChild.h"
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
class BlobImpl; class BlobImpl;
class PendingIPCBlobChild final : public mozilla::ipc::PPendingIPCBlobChild { class PendingIPCBlobChild final : public PPendingIPCBlobChild {
public: public:
explicit PendingIPCBlobChild(const IPCBlob& aBlob); explicit PendingIPCBlobChild(const IPCBlob& aBlob);
@ -39,4 +39,4 @@ class PendingIPCBlobChild final : public mozilla::ipc::PPendingIPCBlobChild {
} // namespace dom } // namespace dom
} // namespace mozilla } // namespace mozilla
#endif // mozilla_dom_ipc_PendingIPCBlobChild_h #endif // mozilla_dom_PendingIPCBlobChild_h

View File

@ -4,10 +4,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_ipc_PendingIPCBlobParent_h #ifndef mozilla_dom_PendingIPCBlobParent_h
#define mozilla_dom_ipc_PendingIPCBlobParent_h #define mozilla_dom_PendingIPCBlobParent_h
#include "mozilla/ipc/PPendingIPCBlobParent.h" #include "mozilla/dom/PPendingIPCBlobParent.h"
namespace mozilla { namespace mozilla {
@ -19,7 +19,7 @@ namespace dom {
class BlobImpl; class BlobImpl;
class PendingIPCBlobParent final : public mozilla::ipc::PPendingIPCBlobParent { class PendingIPCBlobParent final : public PPendingIPCBlobParent {
public: public:
static PendingIPCBlobParent* Create(PBackgroundParent* aManager, static PendingIPCBlobParent* Create(PBackgroundParent* aManager,
BlobImpl* aBlobImpl); BlobImpl* aBlobImpl);
@ -38,4 +38,4 @@ class PendingIPCBlobParent final : public mozilla::ipc::PPendingIPCBlobParent {
} // namespace dom } // namespace dom
} // namespace mozilla } // namespace mozilla
#endif // mozilla_dom_ipc_PendingIPCBlobParent_h #endif // mozilla_dom_PendingIPCBlobParent_h

View File

@ -17,6 +17,8 @@ EXPORTS.mozilla.dom += [
'FileCreatorChild.h', 'FileCreatorChild.h',
'FileCreatorParent.h', 'FileCreatorParent.h',
'IPCBlobUtils.h', 'IPCBlobUtils.h',
'PendingIPCBlobChild.h',
'PendingIPCBlobParent.h',
] ]
EXPORTS.mozilla.dom.ipc += [ EXPORTS.mozilla.dom.ipc += [
@ -24,8 +26,6 @@ EXPORTS.mozilla.dom.ipc += [
'IPCBlobInputStreamChild.h', 'IPCBlobInputStreamChild.h',
'IPCBlobInputStreamParent.h', 'IPCBlobInputStreamParent.h',
'IPCBlobInputStreamStorage.h', 'IPCBlobInputStreamStorage.h',
'PendingIPCBlobChild.h',
'PendingIPCBlobParent.h',
'TemporaryIPCBlobChild.h', 'TemporaryIPCBlobChild.h',
'TemporaryIPCBlobParent.h', 'TemporaryIPCBlobParent.h',
] ]

View File

@ -16,7 +16,7 @@
#include "mozilla/dom/indexedDB/ActorsParent.h" #include "mozilla/dom/indexedDB/ActorsParent.h"
#include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseParent.h" #include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseParent.h"
#include "mozilla/dom/IPCBlobUtils.h" #include "mozilla/dom/IPCBlobUtils.h"
#include "mozilla/dom/ipc/PendingIPCBlobParent.h" #include "mozilla/dom/PendingIPCBlobParent.h"
#include "mozilla/dom/quota/MemoryOutputStream.h" #include "mozilla/dom/quota/MemoryOutputStream.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "nsComponentManagerUtils.h" #include "nsComponentManagerUtils.h"

View File

@ -28,8 +28,8 @@
#include "mozilla/dom/PermissionMessageUtils.h" #include "mozilla/dom/PermissionMessageUtils.h"
#include "mozilla/dom/BrowserChild.h" #include "mozilla/dom/BrowserChild.h"
#include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseFileChild.h" #include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseFileChild.h"
#include "mozilla/dom/ipc/PendingIPCBlobChild.h"
#include "mozilla/dom/IPCBlobUtils.h" #include "mozilla/dom/IPCBlobUtils.h"
#include "mozilla/dom/PendingIPCBlobChild.h"
#include "mozilla/dom/WorkerPrivate.h" #include "mozilla/dom/WorkerPrivate.h"
#include "mozilla/dom/WorkerRunnable.h" #include "mozilla/dom/WorkerRunnable.h"
#include "mozilla/Encoding.h" #include "mozilla/Encoding.h"

View File

@ -25,11 +25,11 @@
#include "mozilla/dom/PFileSystemRequestChild.h" #include "mozilla/dom/PFileSystemRequestChild.h"
#include "mozilla/dom/EndpointForReportChild.h" #include "mozilla/dom/EndpointForReportChild.h"
#include "mozilla/dom/FileSystemTaskBase.h" #include "mozilla/dom/FileSystemTaskBase.h"
#include "mozilla/dom/PendingIPCBlobChild.h"
#include "mozilla/dom/cache/ActorUtils.h" #include "mozilla/dom/cache/ActorUtils.h"
#include "mozilla/dom/indexedDB/PBackgroundIDBFactoryChild.h" #include "mozilla/dom/indexedDB/PBackgroundIDBFactoryChild.h"
#include "mozilla/dom/indexedDB/PBackgroundIndexedDBUtilsChild.h" #include "mozilla/dom/indexedDB/PBackgroundIndexedDBUtilsChild.h"
#include "mozilla/dom/ipc/IPCBlobInputStreamChild.h" #include "mozilla/dom/ipc/IPCBlobInputStreamChild.h"
#include "mozilla/dom/ipc/PendingIPCBlobChild.h"
#include "mozilla/dom/ipc/TemporaryIPCBlobChild.h" #include "mozilla/dom/ipc/TemporaryIPCBlobChild.h"
#include "mozilla/dom/IPCBlobUtils.h" #include "mozilla/dom/IPCBlobUtils.h"
#include "mozilla/dom/quota/PQuotaChild.h" #include "mozilla/dom/quota/PQuotaChild.h"
@ -310,13 +310,13 @@ bool BackgroundChildImpl::DeallocPBackgroundStorageChild(
return true; return true;
} }
PPendingIPCBlobChild* BackgroundChildImpl::AllocPPendingIPCBlobChild( dom::PPendingIPCBlobChild* BackgroundChildImpl::AllocPPendingIPCBlobChild(
const IPCBlob& aBlob) { const IPCBlob& aBlob) {
return new mozilla::dom::PendingIPCBlobChild(aBlob); return new dom::PendingIPCBlobChild(aBlob);
} }
bool BackgroundChildImpl::DeallocPPendingIPCBlobChild( bool BackgroundChildImpl::DeallocPPendingIPCBlobChild(
PPendingIPCBlobChild* aActor) { dom::PPendingIPCBlobChild* aActor) {
delete aActor; delete aActor;
return true; return true;
} }

View File

@ -25,6 +25,7 @@
#include "mozilla/dom/PGamepadEventChannelParent.h" #include "mozilla/dom/PGamepadEventChannelParent.h"
#include "mozilla/dom/PGamepadTestChannelParent.h" #include "mozilla/dom/PGamepadTestChannelParent.h"
#include "mozilla/dom/MessagePortParent.h" #include "mozilla/dom/MessagePortParent.h"
#include "mozilla/dom/PendingIPCBlobParent.h"
#include "mozilla/dom/ServiceWorkerActors.h" #include "mozilla/dom/ServiceWorkerActors.h"
#include "mozilla/dom/ServiceWorkerManagerParent.h" #include "mozilla/dom/ServiceWorkerManagerParent.h"
#include "mozilla/dom/ServiceWorkerRegistrar.h" #include "mozilla/dom/ServiceWorkerRegistrar.h"
@ -32,7 +33,6 @@
#include "mozilla/dom/cache/ActorUtils.h" #include "mozilla/dom/cache/ActorUtils.h"
#include "mozilla/dom/indexedDB/ActorsParent.h" #include "mozilla/dom/indexedDB/ActorsParent.h"
#include "mozilla/dom/ipc/IPCBlobInputStreamParent.h" #include "mozilla/dom/ipc/IPCBlobInputStreamParent.h"
#include "mozilla/dom/ipc/PendingIPCBlobParent.h"
#include "mozilla/dom/ipc/TemporaryIPCBlobParent.h" #include "mozilla/dom/ipc/TemporaryIPCBlobParent.h"
#include "mozilla/dom/IPCBlobUtils.h" #include "mozilla/dom/IPCBlobUtils.h"
#include "mozilla/dom/localstorage/ActorsParent.h" #include "mozilla/dom/localstorage/ActorsParent.h"
@ -468,13 +468,13 @@ bool BackgroundParentImpl::DeallocPBackgroundStorageParent(
return mozilla::dom::DeallocPBackgroundStorageParent(aActor); return mozilla::dom::DeallocPBackgroundStorageParent(aActor);
} }
PPendingIPCBlobParent* BackgroundParentImpl::AllocPPendingIPCBlobParent( mozilla::dom::PPendingIPCBlobParent*
const IPCBlob& aBlob) { BackgroundParentImpl::AllocPPendingIPCBlobParent(const IPCBlob& aBlob) {
MOZ_CRASH("PPendingIPCBlobParent actors should be manually constructed!"); MOZ_CRASH("PPendingIPCBlobParent actors should be manually constructed!");
} }
bool BackgroundParentImpl::DeallocPPendingIPCBlobParent( bool BackgroundParentImpl::DeallocPPendingIPCBlobParent(
PPendingIPCBlobParent* aActor) { mozilla::dom::PPendingIPCBlobParent* aActor) {
AssertIsInMainOrSocketProcess(); AssertIsInMainOrSocketProcess();
AssertIsOnBackgroundThread(); AssertIsOnBackgroundThread();
MOZ_ASSERT(aActor); MOZ_ASSERT(aActor);

View File

@ -53,11 +53,6 @@ DIRECT_CALL_OVERRIDES = {
("PMedia", "child"): ("Child", "mozilla/media/MediaChild.h"), ("PMedia", "child"): ("Child", "mozilla/media/MediaChild.h"),
("PPendingIPCBlob", "child"): ("PendingIPCBlobChild", "mozilla/dom/ipc/PendingIPCBlobChild.h"),
("PPendingIPCBlob", "parent"): (
"mozilla::dom::PendingIPCBlobParent", "mozilla/dom/ipc/PendingIPCBlobParent.h"
),
("PPresentationRequest", "child"): ( ("PPresentationRequest", "child"): (
"PresentationRequestChild", "mozilla/dom/PresentationChild.h" "PresentationRequestChild", "mozilla/dom/PresentationChild.h"
), ),