Skip to content

Commit

Permalink
Bug 1752444 - Part 2: Rewrite direct_call.py protocols to use {Parent…
Browse files Browse the repository at this point in the history
…,Child}Impl attributes, r=ipc-reviewers,media-playback-reviewers,alwu,mccr8

This is a mechanical change which was performed by a script based on the
contents of direct_call.py, and then manually checked over to fix
various rewriting bugs caused by my glorified sed script. See the
previous part for more context on the change.

Differential Revision: https://phabricator.services.mozilla.com/D137227
  • Loading branch information
mystor committed Feb 9, 2022
1 parent 80daaa9 commit fe46df6
Show file tree
Hide file tree
Showing 165 changed files with 445 additions and 110 deletions.
3 changes: 2 additions & 1 deletion accessible/ipc/other/PDocAccessible.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ struct TextRangeData
int32_t EndOffset;
};

[NestedUpTo=inside_sync] sync protocol PDocAccessible
[NestedUpTo=inside_sync, ChildImpl=virtual, ParentImpl=virtual]
sync protocol PDocAccessible
{
manager PBrowser;
manages PDocAccessiblePlatformExt;
Expand Down
1 change: 1 addition & 0 deletions accessible/ipc/win/PDocAccessible.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct ShowEventData
bool EventSuppressed;
};

[ChildImpl=virtual, ParentImpl=virtual]
sync protocol PDocAccessible
{
manager PBrowser;
Expand Down
1 change: 1 addition & 0 deletions dom/broadcastchannel/PBroadcastChannel.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace mozilla {
namespace dom {

// This protocol is used for the BroadcastChannel API
[ChildImpl=virtual, ParentImpl=virtual]
protocol PBroadcastChannel
{
manager PBackground;
Expand Down
1 change: 1 addition & 0 deletions dom/clients/manager/PClientHandle.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ include "mozilla/ipc/ProtocolMessageUtils.h";
namespace mozilla {
namespace dom {

[ChildImpl=virtual, ParentImpl=virtual]
protocol PClientHandle
{
manager PClientManager;
Expand Down
1 change: 1 addition & 0 deletions dom/clients/manager/PClientHandleOp.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ include ClientIPCTypes;
namespace mozilla {
namespace dom {

[ChildImpl=virtual, ParentImpl=virtual]
protocol PClientHandleOp
{
manager PClientHandle;
Expand Down
1 change: 1 addition & 0 deletions dom/clients/manager/PClientManager.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ include ClientIPCTypes;
namespace mozilla {
namespace dom {

[ChildImpl=virtual, ParentImpl=virtual]
sync protocol PClientManager
{
manager PBackground;
Expand Down
1 change: 1 addition & 0 deletions dom/clients/manager/PClientManagerOp.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ include ClientIPCTypes;
namespace mozilla {
namespace dom {

[ChildImpl=virtual, ParentImpl=virtual]
protocol PClientManagerOp
{
manager PClientManager;
Expand Down
1 change: 1 addition & 0 deletions dom/clients/manager/PClientNavigateOp.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ include ClientIPCTypes;
namespace mozilla {
namespace dom {

[ChildImpl=virtual, ParentImpl=virtual]
protocol PClientNavigateOp
{
manager PClientManager;
Expand Down
1 change: 1 addition & 0 deletions dom/clients/manager/PClientSource.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include ClientIPCTypes;
namespace mozilla {
namespace dom {

[ChildImpl=virtual, ParentImpl=virtual]
sync protocol PClientSource
{
manager PClientManager;
Expand Down
1 change: 1 addition & 0 deletions dom/clients/manager/PClientSourceOp.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ include ClientIPCTypes;
namespace mozilla {
namespace dom {

[ChildImpl=virtual, ParentImpl=virtual]
protocol PClientSourceOp
{
manager PClientSource;
Expand Down
3 changes: 3 additions & 0 deletions dom/filehandle/PBackgroundFileHandle.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ include protocol PRemoteLazyInputStream; // FIXME: bug 792908

include IPCBlob;

include "mozilla/dom/indexedDB/ActorsChild.h";

namespace mozilla {
namespace dom {

Expand Down Expand Up @@ -67,6 +69,7 @@ union FileRequestParams
FileRequestFlushParams;
};

[ChildImpl="indexedDB::BackgroundFileHandleChild", ParentImpl=virtual]
protocol PBackgroundFileHandle
{
manager PBackgroundMutableFile;
Expand Down
3 changes: 3 additions & 0 deletions dom/filehandle/PBackgroundFileRequest.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

include protocol PBackgroundFileHandle;

include "mozilla/dom/indexedDB/ActorsChild.h";

using struct mozilla::void_t from "mozilla/ipc/IPCCore.h";

namespace mozilla {
Expand Down Expand Up @@ -47,6 +49,7 @@ union FileRequestResponse
FileRequestFlushResponse;
};

[ChildImpl="indexedDB::BackgroundFileRequestChild", ParentImpl=virtual]
protocol PBackgroundFileRequest
{
manager PBackgroundFileHandle;
Expand Down
3 changes: 3 additions & 0 deletions dom/filehandle/PBackgroundMutableFile.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ include protocol PBackgroundFileHandle;
include protocol PBackgroundIDBDatabase;

include "mozilla/dom/filehandle/SerializationHelpers.h";
include "mozilla/dom/indexedDB/ActorsChild.h";
include "mozilla/dom/filehandle/ActorsParent.h";

using mozilla::dom::FileMode
from "mozilla/dom/FileModeBinding.h";

namespace mozilla {
namespace dom {

[ChildImpl="indexedDB::BackgroundMutableFileChild", ParentImpl="BackgroundMutableFileParentBase"]
sync protocol PBackgroundMutableFile
{
manager PBackgroundIDBDatabase;
Expand Down
5 changes: 4 additions & 1 deletion dom/filesystem/PFileSystemRequest.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ include protocol PRemoteLazyInputStream;

include IPCBlob;

include "mozilla/dom/FileSystemTaskBase.h";

namespace mozilla {
namespace dom {

Expand Down Expand Up @@ -66,7 +68,8 @@ union FileSystemResponseValue
FileSystemErrorResponse;
};

[RefCounted] protocol PFileSystemRequest
[RefCounted, ChildImpl="FileSystemTaskChildBase"]
protocol PFileSystemRequest
{
manager PBackground;

Expand Down
4 changes: 3 additions & 1 deletion dom/indexedDB/PBackgroundIDBCursor.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include protocol PRemoteLazyInputStream; // FIXME: bug 792908
include PBackgroundIDBSharedTypes;

include "mozilla/dom/indexedDB/SerializationHelpers.h";
include "mozilla/dom/indexedDB/ActorsChild.h";

using struct mozilla::void_t from "mozilla/ipc/IPCCore.h";

Expand Down Expand Up @@ -83,7 +84,8 @@ union CursorResponse
IndexKeyCursorResponse[];
};

[RefCounted] protocol PBackgroundIDBCursor
[RefCounted, ChildImpl="indexedDB::BackgroundCursorChildBase", ParentImpl=virtual]
protocol PBackgroundIDBCursor
{
manager PBackgroundIDBTransaction or PBackgroundIDBVersionChangeTransaction;

Expand Down
2 changes: 2 additions & 0 deletions dom/indexedDB/PBackgroundIDBDatabase.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ include InputStreamParams;
include PBackgroundIDBSharedTypes;

include "mozilla/dom/indexedDB/SerializationHelpers.h";
include "mozilla/dom/indexedDB/ActorsChild.h";

using struct mozilla::null_t from "mozilla/ipc/IPCCore.h";

Expand All @@ -39,6 +40,7 @@ union DatabaseRequestParams
CreateFileParams;
};

[ChildImpl="indexedDB::BackgroundDatabaseChild", ParentImpl=virtual]
sync protocol PBackgroundIDBDatabase
{
manager PBackgroundIDBFactory;
Expand Down
1 change: 1 addition & 0 deletions dom/indexedDB/PBackgroundIDBDatabaseFile.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace mozilla {
namespace dom {
namespace indexedDB {

[ChildImpl=virtual, ParentImpl=virtual]
protocol PBackgroundIDBDatabaseFile
{
manager PBackgroundIDBDatabase;
Expand Down
3 changes: 3 additions & 0 deletions dom/indexedDB/PBackgroundIDBDatabaseRequest.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
include protocol PBackgroundIDBDatabase;
include protocol PBackgroundMutableFile;

include "mozilla/dom/indexedDB/ActorsChild.h";

namespace mozilla {
namespace dom {
namespace indexedDB {
Expand All @@ -20,6 +22,7 @@ union DatabaseRequestResponse
CreateFileRequestResponse;
};

[ChildImpl="indexedDB::BackgroundDatabaseRequestChild", ParentImpl=virtual]
protocol PBackgroundIDBDatabaseRequest
{
manager PBackgroundIDBDatabase;
Expand Down
4 changes: 3 additions & 1 deletion dom/indexedDB/PBackgroundIDBFactory.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ include PBackgroundIDBSharedTypes;
include PBackgroundSharedTypes;

include "mozilla/dom/quota/SerializationHelpers.h";
include "mozilla/dom/indexedDB/ActorsChild.h";

using struct mozilla::void_t from "mozilla/ipc/IPCCore.h";

Expand Down Expand Up @@ -39,7 +40,8 @@ union FactoryRequestParams
DeleteDatabaseRequestParams;
};

[RefCounted] sync protocol PBackgroundIDBFactory
[RefCounted, ChildImpl="indexedDB::BackgroundFactoryChild", ParentImpl=virtual]
sync protocol PBackgroundIDBFactory
{
manager PBackground;

Expand Down
3 changes: 3 additions & 0 deletions dom/indexedDB/PBackgroundIDBFactoryRequest.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ include protocol PBackgroundIDBDatabase;

include PBackgroundSharedTypes;

include "mozilla/dom/indexedDB/ActorsChild.h";

namespace mozilla {
namespace dom {
namespace indexedDB {
Expand All @@ -28,6 +30,7 @@ union FactoryRequestResponse
DeleteDatabaseRequestResponse;
};

[ChildImpl="indexedDB::BackgroundFactoryRequestChild", ParentImpl=virtual]
protocol PBackgroundIDBFactoryRequest
{
manager PBackgroundIDBFactory;
Expand Down
2 changes: 2 additions & 0 deletions dom/indexedDB/PBackgroundIDBRequest.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include protocol PRemoteLazyInputStream; // FIXME: bug 792908
include PBackgroundIDBSharedTypes;

include "mozilla/dom/indexedDB/SerializationHelpers.h";
include "mozilla/dom/indexedDB/ActorsChild.h";

using struct mozilla::void_t from "mozilla/ipc/IPCCore.h";

Expand Down Expand Up @@ -146,6 +147,7 @@ union PreprocessResponse
ObjectStoreGetAllPreprocessResponse;
};

[ChildImpl="indexedDB::BackgroundRequestChild", ParentImpl=virtual]
protocol PBackgroundIDBRequest
{
manager PBackgroundIDBTransaction or PBackgroundIDBVersionChangeTransaction;
Expand Down
5 changes: 4 additions & 1 deletion dom/indexedDB/PBackgroundIDBTransaction.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ include protocol PBackgroundMutableFile;

include PBackgroundIDBSharedTypes;

include "mozilla/dom/indexedDB/ActorsChild.h";

namespace mozilla {
namespace dom {
namespace indexedDB {

[RefCounted] protocol PBackgroundIDBTransaction {
[RefCounted, ChildImpl="indexedDB::BackgroundTransactionChild", ParentImpl=virtual]
protocol PBackgroundIDBTransaction {
manager PBackgroundIDBDatabase;

manages PBackgroundIDBCursor;
Expand Down
5 changes: 4 additions & 1 deletion dom/indexedDB/PBackgroundIDBVersionChangeTransaction.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ include protocol PRemoteLazyInputStream; // FIXME: bug 792908

include PBackgroundIDBSharedTypes;

include "mozilla/dom/indexedDB/ActorsChild.h";

namespace mozilla {
namespace dom {
namespace indexedDB {

[RefCounted] protocol PBackgroundIDBVersionChangeTransaction {
[RefCounted, ChildImpl="indexedDB::BackgroundVersionChangeTransactionChild", ParentImpl=virtual]
protocol PBackgroundIDBVersionChangeTransaction {
manager PBackgroundIDBDatabase;

manages PBackgroundIDBCursor;
Expand Down
2 changes: 2 additions & 0 deletions dom/indexedDB/PBackgroundIndexedDBUtils.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
include protocol PBackground;

include "mozilla/dom/quota/SerializationHelpers.h";
include "mozilla/dom/indexedDB/ActorsChild.h";

using mozilla::dom::quota::PersistenceType
from "mozilla/dom/quota/PersistenceType.h";
Expand All @@ -13,6 +14,7 @@ namespace mozilla {
namespace dom {
namespace indexedDB {

[ChildImpl="indexedDB::BackgroundUtilsChild", ParentImpl=virtual]
sync protocol PBackgroundIndexedDBUtils
{
manager PBackground;
Expand Down
1 change: 1 addition & 0 deletions dom/ipc/PColorPicker.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ include protocol PBrowser;
namespace mozilla {
namespace dom {

[ChildImpl=virtual, ParentImpl=virtual]
protocol PColorPicker
{
manager PBrowser;
Expand Down
3 changes: 3 additions & 0 deletions dom/ipc/PContentPermissionRequest.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
include protocol PContent;
include PContentPermission;

include "nsContentPermissionHelper.h";

namespace mozilla {
namespace dom {

[ChildImpl="RemotePermissionRequest", ParentImpl=virtual]
protocol PContentPermissionRequest
{
manager PContent;
Expand Down
1 change: 1 addition & 0 deletions dom/ipc/PCycleCollectWithLogs.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ include protocol PContent;
namespace mozilla {
namespace dom {

[ChildImpl=virtual, ParentImpl=virtual]
protocol PCycleCollectWithLogs {
manager PContent;

Expand Down
1 change: 1 addition & 0 deletions dom/ipc/PFilePicker.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ union MaybeInputData
void_t;
};

[ChildImpl=virtual]
protocol PFilePicker
{
manager PBrowser;
Expand Down
3 changes: 3 additions & 0 deletions dom/ipc/PLoginReputation.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@

include protocol PContent;

include "mozilla/LoginReputationIPC.h";

namespace mozilla {
namespace dom {

// PLoginReputation allows child to send URL to parent when user focuses
// on a password field. Right now this is an one way IPC call (No callback
// will return after parent receives the IPC message) since we just process
// the URL in parent (LoginReputationService) and stores the result to telemetry.
[ChildImpl=virtual, ParentImpl="LoginReputationParent"]
protocol PLoginReputation
{
manager PContent;
Expand Down
1 change: 1 addition & 0 deletions dom/ipc/PProcessHangMonitor.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ struct SlowScriptData
double duration;
};

[ChildImpl=virtual, ParentImpl=virtual]
protocol PProcessHangMonitor
{
parent:
Expand Down
3 changes: 3 additions & 0 deletions dom/ipc/PURLClassifierLocal.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ include protocol PContent;
include PURLClassifierInfo;

include "mozilla/ipc/URIUtils.h";
include "mozilla/dom/URLClassifierParent.h";
include "mozilla/dom/URLClassifierChild.h";

[RefCounted] using class nsIURI from "nsIURI.h";

Expand All @@ -23,6 +25,7 @@ struct URLClassifierLocalResult
nsCString matchingList;
};

[ChildImpl="URLClassifierLocalChild", ParentImpl="URLClassifierLocalParent"]
protocol PURLClassifierLocal
{
manager PContent;
Expand Down
1 change: 1 addition & 0 deletions dom/localstorage/PBackgroundLSDatabase.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ struct LSSnapshotInitInfo
* ContentParent::AboutToLoadHttpFtpDocumentForChild, the central place
* for pre-loading.)
*/
[ChildImpl=virtual, ParentImpl=virtual]
sync protocol PBackgroundLSDatabase
{
manager PBackground;
Expand Down
Loading

0 comments on commit fe46df6

Please sign in to comment.