Skip to content

Commit 508260e

Browse files
committed
Bug 1633379 - Part 1: Move PInProcess into dom/ipc, r=kmag,Yoric
This moves it near the cross-process `PContent` actor, and makes it more clear that this actor is only intended to be used for DOM things. Differential Revision: https://phabricator.services.mozilla.com/D80581
1 parent 0378cc4 commit 508260e

12 files changed

+31
-34
lines changed

dom/ipc/ContentChild.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include "mozilla/dom/DocGroup.h"
5151
#include "mozilla/dom/ExternalHelperAppChild.h"
5252
#include "mozilla/dom/GetFilesHelper.h"
53+
#include "mozilla/dom/InProcessChild.h"
5354
#include "mozilla/dom/IPCBlobInputStreamChild.h"
5455
#include "mozilla/dom/IPCBlobUtils.h"
5556
#include "mozilla/dom/JSActorService.h"
@@ -78,7 +79,6 @@
7879
#include "mozilla/ipc/FileDescriptorSetChild.h"
7980
#include "mozilla/ipc/FileDescriptorUtils.h"
8081
#include "mozilla/ipc/GeckoChildProcessHost.h"
81-
#include "mozilla/ipc/InProcessChild.h"
8282
#include "mozilla/ipc/LibrarySandboxPreload.h"
8383
#include "mozilla/ipc/ProcessChild.h"
8484
#include "mozilla/ipc/PChildToParentStreamChild.h"

ipc/glue/InProcessChild.h renamed to dom/ipc/InProcessChild.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,16 @@
44
* License, v. 2.0. If a copy of the MPL was not distributed with this
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
66

7-
#ifndef mozilla_ipc_InProcessChild_h
8-
#define mozilla_ipc_InProcessChild_h
7+
#ifndef mozilla_dom_InProcessChild_h
8+
#define mozilla_dom_InProcessChild_h
99

10-
#include "mozilla/ipc/PInProcessChild.h"
10+
#include "mozilla/dom/PInProcessChild.h"
1111
#include "mozilla/StaticPtr.h"
1212

1313
namespace mozilla {
1414
namespace dom {
1515
class PWindowGlobalParent;
1616
class PWindowGlobalChild;
17-
} // namespace dom
18-
19-
namespace ipc {
20-
2117
class InProcessParent;
2218

2319
/**
@@ -52,7 +48,7 @@ class InProcessChild final : public PInProcessChild {
5248
static StaticRefPtr<InProcessChild> sSingleton;
5349
};
5450

55-
} // namespace ipc
51+
} // namespace dom
5652
} // namespace mozilla
5753

58-
#endif // defined(mozilla_ipc_InProcessChild_h)
54+
#endif // defined(mozilla_dom_InProcessChild_h)

ipc/glue/InProcessImpl.cpp renamed to dom/ipc/InProcessImpl.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44
* License, v. 2.0. If a copy of the MPL was not distributed with this
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
66

7-
#include "mozilla/ipc/InProcessParent.h"
8-
#include "mozilla/ipc/InProcessChild.h"
7+
#include "mozilla/dom/InProcessParent.h"
8+
#include "mozilla/dom/InProcessChild.h"
99
#include "nsIObserverService.h"
1010
#include "mozilla/Services.h"
1111

12+
using namespace mozilla::ipc;
13+
1214
// This file contains the implementation of core InProcess lifecycle management
1315
// facilities.
1416

1517
namespace mozilla {
16-
namespace ipc {
18+
namespace dom {
1719

1820
StaticRefPtr<InProcessParent> InProcessParent::sSingleton;
1921
StaticRefPtr<InProcessChild> InProcessChild::sSingleton;
@@ -179,5 +181,5 @@ IProtocol* InProcessChild::ParentActorFor(IProtocol* aActor) {
179181

180182
NS_IMPL_ISUPPORTS(InProcessParent, nsIObserver)
181183

182-
} // namespace ipc
184+
} // namespace dom
183185
} // namespace mozilla

ipc/glue/InProcessParent.h renamed to dom/ipc/InProcessParent.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,16 @@
44
* License, v. 2.0. If a copy of the MPL was not distributed with this
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
66

7-
#ifndef mozilla_ipc_InProcessParent_h
8-
#define mozilla_ipc_InProcessParent_h
7+
#ifndef mozilla_dom_InProcessParent_h
8+
#define mozilla_dom_InProcessParent_h
99

10-
#include "mozilla/ipc/PInProcessParent.h"
10+
#include "mozilla/dom/PInProcessParent.h"
1111
#include "mozilla/StaticPtr.h"
1212

1313
namespace mozilla {
1414
namespace dom {
1515
class PWindowGlobalParent;
1616
class PWindowGlobalChild;
17-
} // namespace dom
18-
19-
namespace ipc {
20-
2117
class InProcessChild;
2218

2319
/**
@@ -56,7 +52,7 @@ class InProcessParent final : public nsIObserver, public PInProcessParent {
5652
static bool sShutdown;
5753
};
5854

59-
} // namespace ipc
55+
} // namespace dom
6056
} // namespace mozilla
6157

62-
#endif // defined(mozilla_ipc_InProcessParent_h)
58+
#endif // defined(mozilla_dom_InProcessParent_h)

dom/ipc/JSProcessActorChild.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include "mozilla/dom/JSProcessActorBinding.h"
88
#include "mozilla/dom/JSProcessActorChild.h"
9-
#include "mozilla/ipc/InProcessChild.h"
9+
#include "mozilla/dom/InProcessChild.h"
1010

1111
namespace mozilla {
1212
namespace dom {

ipc/glue/PInProcess.ipdl renamed to dom/ipc/PInProcess.ipdl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ include protocol PWindowGlobal;
99
include DOMTypes;
1010

1111
namespace mozilla {
12-
namespace ipc {
12+
namespace dom {
1313

1414
/**
1515
* PInProcess is intended for use as an alternative actor manager to PContent
1616
* for async actors which want to be used uniformly in both Content->Chrome and
1717
* Chrome->Chrome circumstances.
1818
*
19-
* `mozilla::ipc::InProcess{Parent, Child}::Singleton()` should be used to get
19+
* `mozilla::dom::InProcess{Parent, Child}::Singleton()` should be used to get
2020
* an instance of this actor.
2121
*/
2222
async refcounted protocol PInProcess
2323
{
2424
manages PWindowGlobal;
2525
};
2626

27-
} // namespace ipc
27+
} // namespace dom
2828
} // namespace mozilla

dom/ipc/PropertyBagUtils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "nsVariant.h"
1717

1818
using namespace IPC;
19+
using namespace mozilla::dom;
1920

2021
namespace mozilla {
2122
namespace ipc {

dom/ipc/WindowGlobalChild.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include "mozilla/dom/WindowGlobalActorsBinding.h"
2121
#include "mozilla/dom/WindowGlobalParent.h"
2222
#include "mozilla/dom/WindowContext.h"
23-
#include "mozilla/ipc/InProcessChild.h"
24-
#include "mozilla/ipc/InProcessParent.h"
23+
#include "mozilla/dom/InProcessChild.h"
24+
#include "mozilla/dom/InProcessParent.h"
2525
#include "nsContentUtils.h"
2626
#include "nsDocShell.h"
2727
#include "nsFocusManager.h"

dom/ipc/WindowGlobalParent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include "mozilla/AsyncEventDispatcher.h"
1212
#include "mozilla/ClearOnShutdown.h"
13-
#include "mozilla/ipc/InProcessParent.h"
13+
#include "mozilla/dom/InProcessParent.h"
1414
#include "mozilla/dom/BrowserBridgeParent.h"
1515
#include "mozilla/dom/CanonicalBrowsingContext.h"
1616
#include "mozilla/dom/ClientInfo.h"

dom/ipc/moz.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ EXPORTS.mozilla.dom += [
4848
'DocShellMessageUtils.h',
4949
'EffectsInfo.h',
5050
'FilePickerParent.h',
51+
'InProcessChild.h',
52+
'InProcessParent.h',
5153
'JSActor.h',
5254
'JSActorService.h',
5355
'JSProcessActorChild.h',
@@ -105,6 +107,7 @@ UNIFIED_SOURCES += [
105107
'CSPMessageUtils.cpp',
106108
'DocShellMessageUtils.cpp',
107109
'FilePickerParent.cpp',
110+
'InProcessImpl.cpp',
108111
'JSActor.cpp',
109112
'JSActorService.cpp',
110113
'JSProcessActorChild.cpp',
@@ -158,6 +161,7 @@ IPDL_SOURCES += [
158161
'PContentPermissionRequest.ipdl',
159162
'PCycleCollectWithLogs.ipdl',
160163
'PFilePicker.ipdl',
164+
'PInProcess.ipdl',
161165
'PLoginReputation.ipdl',
162166
'PPluginWidget.ipdl',
163167
'PProcessHangMonitor.ipdl',

ipc/glue/IPDLParamTraits.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include "chrome/common/ipc_message_utils.h"
1111
#include "mozilla/UniquePtr.h"
1212
#include "mozilla/Variant.h"
13+
#include "mozilla/Tuple.h"
14+
#include "nsTArray.h"
1315

1416
#include <type_traits>
1517

ipc/glue/moz.build

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ EXPORTS.mozilla.ipc += [
2929
'GeckoChildProcessHost.h',
3030
'IdleSchedulerChild.h',
3131
'IdleSchedulerParent.h',
32-
'InProcessChild.h',
33-
'InProcessParent.h',
3432
'InputStreamUtils.h',
3533
'IOThreadChild.h',
3634
'IPCStreamAlloc.h',
@@ -155,7 +153,6 @@ UNIFIED_SOURCES += [
155153
'FileDescriptorUtils.cpp',
156154
'IdleSchedulerChild.cpp',
157155
'IdleSchedulerParent.cpp',
158-
'InProcessImpl.cpp',
159156
'InputStreamUtils.cpp',
160157
'IPCMessageUtils.cpp',
161158
'IPCStreamChild.cpp',
@@ -216,7 +213,6 @@ IPDL_SOURCES = [
216213
'PChildToParentStream.ipdl',
217214
'PFileDescriptorSet.ipdl',
218215
'PIdleScheduler.ipdl',
219-
'PInProcess.ipdl',
220216
'PParentToChildStream.ipdl',
221217
'ProtocolTypes.ipdlh',
222218
'URIParams.ipdlh',

0 commit comments

Comments
 (0)