Skip to content

Commit cd067d3

Browse files
author
David Teller
committed
Bug 1580448 - Rename JSWindowActor into JSActor;r=nika
Differential Revision: https://phabricator.services.mozilla.com/D70038
1 parent cdd42f2 commit cd067d3

29 files changed

+551
-887
lines changed

dom/base/ChromeUtils.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "mozilla/dom/ContentChild.h"
2727
#include "mozilla/dom/ContentParent.h"
2828
#include "mozilla/dom/IdleDeadline.h"
29-
#include "mozilla/dom/JSWindowActorService.h"
29+
#include "mozilla/dom/JSActorService.h"
3030
#include "mozilla/dom/MediaControlUtils.h"
3131
#include "mozilla/dom/MediaControlService.h"
3232
#include "mozilla/dom/MediaMetadata.h"
@@ -1204,7 +1204,7 @@ void ChromeUtils::RegisterWindowActor(const GlobalObject& aGlobal,
12041204
ErrorResult& aRv) {
12051205
MOZ_ASSERT(XRE_IsParentProcess());
12061206

1207-
RefPtr<JSWindowActorService> service = JSWindowActorService::GetSingleton();
1207+
RefPtr<JSActorService> service = JSActorService::GetSingleton();
12081208
service->RegisterWindowActor(aName, aOptions, aRv);
12091209
}
12101210

@@ -1213,7 +1213,7 @@ void ChromeUtils::UnregisterWindowActor(const GlobalObject& aGlobal,
12131213
const nsACString& aName) {
12141214
MOZ_ASSERT(XRE_IsParentProcess());
12151215

1216-
RefPtr<JSWindowActorService> service = JSWindowActorService::GetSingleton();
1216+
RefPtr<JSActorService> service = JSActorService::GetSingleton();
12171217
service->UnregisterWindowActor(aName);
12181218
}
12191219

dom/base/InProcessBrowserChildMessageManager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "mozilla/dom/SameProcessMessageQueue.h"
2121
#include "mozilla/dom/ScriptLoader.h"
2222
#include "mozilla/dom/WindowProxyHolder.h"
23-
#include "mozilla/dom/JSWindowActorService.h"
23+
#include "mozilla/dom/JSActorService.h"
2424

2525
using namespace mozilla;
2626
using namespace mozilla::dom;
@@ -37,7 +37,7 @@ InProcessBrowserChildMessageManager::Create(nsDocShell* aShell,
3737
NS_ENSURE_TRUE(mm->Init(), nullptr);
3838

3939
if (XRE_IsParentProcess()) {
40-
RefPtr<JSWindowActorService> wasvc = JSWindowActorService::GetSingleton();
40+
RefPtr<JSActorService> wasvc = JSActorService::GetSingleton();
4141
wasvc->RegisterChromeEventTarget(mm);
4242
}
4343

@@ -111,7 +111,7 @@ InProcessBrowserChildMessageManager::InProcessBrowserChildMessageManager(
111111

112112
InProcessBrowserChildMessageManager::~InProcessBrowserChildMessageManager() {
113113
if (XRE_IsParentProcess()) {
114-
JSWindowActorService::UnregisterChromeEventTarget(this);
114+
JSActorService::UnregisterChromeEventTarget(this);
115115
}
116116

117117
mAnonymousGlobalScopes.Clear();

dom/base/nsWindowRoot.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "mozilla/dom/BrowserParent.h"
3131
#include "mozilla/dom/HTMLTextAreaElement.h"
3232
#include "mozilla/dom/HTMLInputElement.h"
33-
#include "mozilla/dom/JSWindowActorService.h"
33+
#include "mozilla/dom/JSActorService.h"
3434

3535
#ifdef MOZ_XUL
3636
# include "nsXULElement.h"
@@ -50,7 +50,7 @@ nsWindowRoot::~nsWindowRoot() {
5050
}
5151

5252
if (XRE_IsContentProcess()) {
53-
JSWindowActorService::UnregisterChromeEventTarget(this);
53+
JSActorService::UnregisterChromeEventTarget(this);
5454
}
5555
}
5656

@@ -379,7 +379,7 @@ already_AddRefed<EventTarget> NS_NewWindowRoot(nsPIDOMWindowOuter* aWindow) {
379379
nsCOMPtr<EventTarget> result = new nsWindowRoot(aWindow);
380380

381381
if (XRE_IsContentProcess()) {
382-
RefPtr<JSWindowActorService> wasvc = JSWindowActorService::GetSingleton();
382+
RefPtr<JSActorService> wasvc = JSActorService::GetSingleton();
383383
wasvc->RegisterChromeEventTarget(result);
384384
}
385385

dom/chrome-webidl/ChromeUtils.webidl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* You can obtain one at http://mozilla.org/MPL/2.0/.
55
*/
66

7+
interface nsIContentChild;
8+
79
/**
810
* An optimized QueryInterface method, generated by generateQI.
911
*

dom/chrome-webidl/JSActor.webidl

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2+
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3+
/* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this
5+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6+
7+
8+
interface mixin JSActor {
9+
[Throws]
10+
void sendAsyncMessage(DOMString messageName,
11+
optional any obj);
12+
13+
[Throws]
14+
Promise<any> sendQuery(DOMString messageName,
15+
optional any obj);
16+
};
17+
18+
/**
19+
* WebIDL callback interface version of the nsIObserver interface for use when
20+
* calling the observe method on JSActors.
21+
*
22+
* NOTE: This isn't marked as ChromeOnly, as it has no interface object, and
23+
* thus cannot be conditionally exposed.
24+
*/
25+
[Exposed=Window]
26+
callback interface MozObserverCallback {
27+
void observe(nsISupports subject, ByteString topic, DOMString? data);
28+
};
29+
30+
/**
31+
* WebIDL callback interface calling the `willDestroy`, `didDestroy`, and
32+
* `actorCreated` methods on JSActors.
33+
*/
34+
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
35+
callback MozJSActorCallback = void();
36+
37+
/**
38+
* The willDestroy method, if present, will be called at the last opportunity
39+
* to send messages to the remote side, giving implementers the chance to clean
40+
* up and send final messages.
41+
* The didDestroy method, if present, will be called after the actor is no
42+
* longer able to receive any more messages.
43+
* The actorCreated method, if present, will be called immediately after the
44+
* actor has been created and initialized.
45+
*
46+
* NOTE: Messages may be received between willDestroy and didDestroy, but they
47+
* may not be sent.
48+
*/
49+
[GenerateInit]
50+
dictionary MozJSActorCallbacks {
51+
[ChromeOnly] MozJSActorCallback willDestroy;
52+
[ChromeOnly] MozJSActorCallback didDestroy;
53+
[ChromeOnly] MozJSActorCallback actorCreated;
54+
};

dom/chrome-webidl/JSWindowActor.webidl

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,6 @@
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
66

77
interface nsISupports;
8-
interface nsIContentChild;
9-
interface nsIContentParent;
10-
11-
interface mixin JSWindowActor {
12-
[Throws]
13-
void sendAsyncMessage(DOMString messageName,
14-
optional any obj);
15-
16-
[Throws]
17-
Promise<any> sendQuery(DOMString messageName,
18-
optional any obj);
19-
};
208

219
[ChromeOnly, Exposed=Window]
2210
interface JSWindowActorParent {
@@ -33,13 +21,13 @@ interface JSWindowActorParent {
3321
[Throws]
3422
readonly attribute CanonicalBrowsingContext? browsingContext;
3523
};
36-
JSWindowActorParent includes JSWindowActor;
24+
JSWindowActorParent includes JSActor;
3725

3826
[ChromeOnly, Exposed=Window]
3927
interface JSWindowActorChild {
4028
[ChromeOnly]
4129
constructor();
42-
30+
4331
/**
4432
* Actor initialization occurs after the constructor is called but before the
4533
* first message is delivered. Until the actor is initialized, accesses to
@@ -64,45 +52,7 @@ interface JSWindowActorChild {
6452
[Throws]
6553
readonly attribute WindowProxy? contentWindow;
6654
};
67-
JSWindowActorChild includes JSWindowActor;
68-
69-
/**
70-
* WebIDL callback interface version of the nsIObserver interface for use when
71-
* calling the observe method on JSWindowActors.
72-
*
73-
* NOTE: This isn't marked as ChromeOnly, as it has no interface object, and
74-
* thus cannot be conditionally exposed.
75-
*/
76-
[Exposed=Window]
77-
callback interface MozObserverCallback {
78-
void observe(nsISupports subject, ByteString topic, DOMString? data);
79-
};
80-
81-
/**
82-
* WebIDL callback interface calling the `willDestroy`, `didDestroy`, and
83-
* `actorCreated` methods on JSWindowActors.
84-
*/
85-
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
86-
callback MozJSWindowActorCallback = void();
87-
88-
/**
89-
* The willDestroy method, if present, will be called at the last opportunity
90-
* to send messages to the remote side, giving implementers the chance to clean
91-
* up and send final messages.
92-
* The didDestroy method, if present, will be called after the actor is no
93-
* longer able to receive any more messages.
94-
* The actorCreated method, if present, will be called immediately after the
95-
* actor has been created and initialized.
96-
*
97-
* NOTE: Messages may be received between willDestroy and didDestroy, but they
98-
* may not be sent.
99-
*/
100-
[GenerateInit]
101-
dictionary MozJSWindowActorCallbacks {
102-
[ChromeOnly] MozJSWindowActorCallback willDestroy;
103-
[ChromeOnly] MozJSWindowActorCallback didDestroy;
104-
[ChromeOnly] MozJSWindowActorCallback actorCreated;
105-
};
55+
JSWindowActorChild includes JSActor;
10656

10757
/**
10858
* Used by ChromeUtils.registerWindowActor() to register JS window actor.

dom/chrome-webidl/WindowGlobalActors.webidl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ interface URI;
88
interface nsIDocShell;
99
interface RemoteTab;
1010
interface nsITransportSecurityInfo;
11+
interface nsIContentParent;
1112

1213
[Exposed=Window, ChromeOnly]
1314
interface WindowContext {

dom/chrome-webidl/moz.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ WEBIDL_FILES = [
4949
'HeapSnapshot.webidl',
5050
'InspectorUtils.webidl',
5151
'IteratorResult.webidl',
52+
'JSActor.webidl',
5253
'JSWindowActor.webidl',
5354
'L10nOverlays.webidl',
5455
'Localization.webidl',

dom/ipc/ContentChild.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#include "mozilla/dom/GetFilesHelper.h"
4949
#include "mozilla/dom/IPCBlobInputStreamChild.h"
5050
#include "mozilla/dom/IPCBlobUtils.h"
51-
#include "mozilla/dom/JSWindowActorService.h"
51+
#include "mozilla/dom/JSActorService.h"
5252
#include "mozilla/dom/LSObject.h"
5353
#include "mozilla/dom/MemoryReportRequest.h"
5454
#include "mozilla/dom/PLoginReputationChild.h"
@@ -2624,14 +2624,14 @@ mozilla::ipc::IPCResult ContentChild::RecvInitBlobURLs(
26242624

26252625
mozilla::ipc::IPCResult ContentChild::RecvInitJSWindowActorInfos(
26262626
nsTArray<JSWindowActorInfo>&& aInfos) {
2627-
RefPtr<JSWindowActorService> actSvc = JSWindowActorService::GetSingleton();
2628-
actSvc->LoadJSWindowActorInfos(std::move(aInfos));
2627+
RefPtr<JSActorService> actSvc = JSActorService::GetSingleton();
2628+
actSvc->LoadJSWindowActorInfos(aInfos);
26292629
return IPC_OK();
26302630
}
26312631

26322632
mozilla::ipc::IPCResult ContentChild::RecvUnregisterJSWindowActor(
26332633
const nsCString& aName) {
2634-
RefPtr<JSWindowActorService> actSvc = JSWindowActorService::GetSingleton();
2634+
RefPtr<JSActorService> actSvc = JSActorService::GetSingleton();
26352635
actSvc->UnregisterWindowActor(aName);
26362636
return IPC_OK();
26372637
}

dom/ipc/ContentParent.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
#include "mozilla/dom/GetFilesHelper.h"
9393
#include "mozilla/dom/IPCBlobInputStreamParent.h"
9494
#include "mozilla/dom/IPCBlobUtils.h"
95-
#include "mozilla/dom/JSWindowActorService.h"
95+
#include "mozilla/dom/JSActorService.h"
9696
#include "mozilla/dom/LocalStorageCommon.h"
9797
#include "mozilla/dom/MediaController.h"
9898
#include "mozilla/dom/MemoryReportRequest.h"
@@ -2614,7 +2614,7 @@ bool ContentParent::InitInternal(ProcessPriority aInitialPriority) {
26142614
}
26152615

26162616
// Send down WindowActorOptions at startup to content process.
2617-
RefPtr<JSWindowActorService> actorSvc = JSWindowActorService::GetSingleton();
2617+
RefPtr<JSActorService> actorSvc = JSActorService::GetSingleton();
26182618
if (actorSvc) {
26192619
nsTArray<JSWindowActorInfo> infos;
26202620
actorSvc->GetJSWindowActorInfos(infos);

0 commit comments

Comments
 (0)