Skip to content

Commit

Permalink
Bug 1638373 - remove js/ipc now that CPOWs are dead, r=mccr8
Browse files Browse the repository at this point in the history
Depends on D76597

Differential Revision: https://phabricator.services.mozilla.com/D76598
  • Loading branch information
gijsk committed May 24, 2020
1 parent 2f983e6 commit 38b061e
Show file tree
Hide file tree
Showing 41 changed files with 6 additions and 4,645 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Expand Up @@ -135,7 +135,6 @@ intl/l10n/
# Exclude everything but self-hosted JS
js/ductwork/
js/examples/
js/ipc/
js/public/
js/xpconnect/
js/src/devtools/
Expand Down
11 changes: 0 additions & 11 deletions dom/bindings/BindingUtils.cpp
Expand Up @@ -68,7 +68,6 @@
#include "mozilla/dom/WorkerScope.h"
#include "mozilla/dom/XrayExpandoClass.h"
#include "mozilla/dom/WindowProxyHolder.h"
#include "mozilla/jsipc/CrossProcessObjectWrappers.h"
#include "ipc/ErrorIPCUtils.h"
#include "mozilla/UseCounter.h"
#include "mozilla/dom/DocGroup.h"
Expand Down Expand Up @@ -2387,16 +2386,6 @@ bool InterfaceHasInstance(JSContext* cx, unsigned argc, JS::Value* vp) {
return true;
}

if (jsipc::IsWrappedCPOW(instance)) {
bool boolp = false;
if (!jsipc::DOMInstanceOf(cx, js::UncheckedUnwrap(instance),
clasp->mPrototypeID, clasp->mDepth, &boolp)) {
return false;
}
args.rval().setBoolean(boolp);
return true;
}

if (IsRemoteObjectProxy(instance, clasp->mPrototypeID)) {
args.rval().setBoolean(true);
return true;
Expand Down
26 changes: 0 additions & 26 deletions dom/ipc/CPOWManagerGetter.h

This file was deleted.

17 changes: 0 additions & 17 deletions dom/ipc/ContentChild.cpp
Expand Up @@ -81,8 +81,6 @@
#include "mozilla/ipc/PParentToChildStreamChild.h"
#include "mozilla/intl/LocaleService.h"
#include "mozilla/ipc/TestShellChild.h"
// Needed for NewJavaScriptChild and ReleaseJavaScriptChild
#include "mozilla/jsipc/CrossProcessObjectWrappers.h"
#include "mozilla/layers/APZChild.h"
#include "mozilla/layers/CompositorManagerChild.h"
#include "mozilla/layers/ContentProcessController.h"
Expand Down Expand Up @@ -1301,9 +1299,6 @@ void ContentChild::InitXPCOM(
RecvBidiKeyboardNotify(aXPCOMInit.isLangRTL(),
aXPCOMInit.haveBidiKeyboards());

// Create the CPOW manager as soon as possible.
SendPJavaScriptConstructor();

if (aXPCOMInit.domainPolicy().active()) {
nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager();
MOZ_ASSERT(ssm);
Expand Down Expand Up @@ -1691,17 +1686,6 @@ static void FirstIdle(void) {
ContentChild::GetSingleton()->SendFirstIdle();
}

mozilla::jsipc::PJavaScriptChild* ContentChild::AllocPJavaScriptChild() {
MOZ_ASSERT(ManagedPJavaScriptChild().IsEmpty());

return jsipc::NewJavaScriptChild();
}

bool ContentChild::DeallocPJavaScriptChild(PJavaScriptChild* aChild) {
jsipc::ReleaseJavaScriptChild(aChild);
return true;
}

mozilla::ipc::IPCResult ContentChild::RecvConstructBrowser(
ManagedEndpoint<PBrowserChild>&& aBrowserEp,
ManagedEndpoint<PWindowGlobalChild>&& aWindowEp, const TabId& aTabId,
Expand Down Expand Up @@ -3509,7 +3493,6 @@ mozilla::ipc::IPCResult ContentChild::RecvSessionStorageData(
return IPC_OK();
}


mozilla::ipc::IPCResult ContentChild::RecvOnAllowAccessFor(
const MaybeDiscarded<BrowsingContext>& aContext,
const nsCString& aTrackingOrigin, uint32_t aCookieBehavior,
Expand Down
6 changes: 1 addition & 5 deletions dom/ipc/ContentChild.h
Expand Up @@ -289,10 +289,6 @@ class ContentChild final : public PContentChild,
mozilla::ipc::IPCResult RecvClearImageCache(const bool& privateLoader,
const bool& chrome);

mozilla::jsipc::PJavaScriptChild* AllocPJavaScriptChild();

bool DeallocPJavaScriptChild(mozilla::jsipc::PJavaScriptChild*);

PRemoteSpellcheckEngineChild* AllocPRemoteSpellcheckEngineChild();

bool DeallocPRemoteSpellcheckEngineChild(PRemoteSpellcheckEngineChild*);
Expand Down Expand Up @@ -794,7 +790,7 @@ class ContentChild final : public PContentChild,
mozilla::ipc::IPCResult RecvHistoryCommitLength(
const MaybeDiscarded<BrowsingContext>& aContext, uint32_t aLength);

private:
private:
#ifdef NIGHTLY_BUILD
virtual PContentChild::Result OnMessageReceived(const Message& aMsg) override;
#else
Expand Down
14 changes: 1 addition & 13 deletions dom/ipc/ContentParent.cpp
Expand Up @@ -137,8 +137,6 @@
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/PChildToParentStreamParent.h"
#include "mozilla/ipc/TestShellParent.h"
// Needed for NewJavaScriptChild and ReleaseJavaScriptChild
#include "mozilla/jsipc/CrossProcessObjectWrappers.h"
#include "mozilla/layers/CompositorThread.h"
#include "mozilla/layers/ImageBridgeParent.h"
#include "mozilla/layers/LayerTreeOwnerTracker.h"
Expand Down Expand Up @@ -3127,16 +3125,6 @@ mozilla::ipc::IPCResult ContentParent::RecvInitBackground(
return IPC_OK();
}

mozilla::jsipc::PJavaScriptParent* ContentParent::AllocPJavaScriptParent() {
MOZ_ASSERT(ManagedPJavaScriptParent().IsEmpty());
return jsipc::NewJavaScriptParent();
}

bool ContentParent::DeallocPJavaScriptParent(PJavaScriptParent* parent) {
jsipc::ReleaseJavaScriptParent(parent);
return true;
}

bool ContentParent::CanOpenBrowser(const IPCTabContext& aContext) {
// (PopupIPCTabContext lets the child process prove that it has access to
// the app it's trying to open.)
Expand Down Expand Up @@ -6380,7 +6368,7 @@ mozilla::ipc::IPCResult ContentParent::RecvHistoryGo(
HistoryGoResolver&& aResolveRequestedIndex) {
if (!aContext.IsDiscarded()) {
nsSHistory* shistory =
static_cast<nsSHistory*>(aContext.get_canonical()->GetSessionHistory());
static_cast<nsSHistory*>(aContext.get_canonical()->GetSessionHistory());
nsTArray<nsSHistory::LoadEntryResult> loadResults;
nsresult rv = shistory->GotoIndex(aOffset, loadResults);
if (NS_FAILED(rv)) {
Expand Down
13 changes: 0 additions & 13 deletions dom/ipc/ContentParent.h
Expand Up @@ -101,10 +101,6 @@ class ProtocolFuzzerHelper;
class SharedPreferenceSerializer;
} // namespace ipc

namespace jsipc {
class PJavaScriptParent;
} // namespace jsipc

namespace layers {
struct TextureFactoryIdentifier;
} // namespace layers
Expand Down Expand Up @@ -461,13 +457,6 @@ class ContentParent final

PHeapSnapshotTempFileHelperParent* AllocPHeapSnapshotTempFileHelperParent();

PJavaScriptParent* AllocPJavaScriptParent();

virtual mozilla::ipc::IPCResult RecvPJavaScriptConstructor(
PJavaScriptParent* aActor) override {
return PContentParent::RecvPJavaScriptConstructor(aActor);
}

PRemoteSpellcheckEngineParent* AllocPRemoteSpellcheckEngineParent();

mozilla::ipc::IPCResult RecvRecordingDeviceEvents(
Expand Down Expand Up @@ -875,8 +864,6 @@ class ContentParent final
mozilla::ipc::IPCResult RecvAddPerformanceMetrics(
const nsID& aID, nsTArray<PerformanceInfo>&& aMetrics);

bool DeallocPJavaScriptParent(mozilla::jsipc::PJavaScriptParent*);

bool DeallocPRemoteSpellcheckEngineParent(PRemoteSpellcheckEngineParent*);

mozilla::ipc::IPCResult RecvConstructPopupBrowser(
Expand Down
1 change: 0 additions & 1 deletion dom/ipc/PBrowser.ipdl
Expand Up @@ -24,7 +24,6 @@ include protocol PBrowserBridge;
include DOMTypes;
include IPCBlob;
include IPCStream;
include JavaScriptTypes;
include URIParams;
include PPrintingTypes;
include PTabContext;
Expand Down
5 changes: 0 additions & 5 deletions dom/ipc/PContent.ipdl
Expand Up @@ -33,7 +33,6 @@ include protocol POfflineCacheUpdate;
include protocol PSpeechSynthesis;
#endif
include protocol PTestShell;
include protocol PJavaScript;
include protocol PRemoteSpellcheckEngine;
include protocol PWebBrowserPersistDocument;
include protocol PWebrtcGlobal;
Expand All @@ -48,7 +47,6 @@ include protocol PScriptCache;
include protocol PSessionStorageObserver;
include protocol PBenchmarkStorage;
include DOMTypes;
include JavaScriptTypes;
include IPCBlob;
include IPCStream;
include PTabContext;
Expand Down Expand Up @@ -392,7 +390,6 @@ nested(upto inside_cpow) sync protocol PContent
manages PSpeechSynthesis;
#endif
manages PTestShell;
manages PJavaScript;
manages PRemoteSpellcheckEngine;
manages PWebBrowserPersistDocument;
manages PWebrtcGlobal;
Expand Down Expand Up @@ -923,8 +920,6 @@ parent:
sync LaunchRDDProcess()
returns (nsresult rv, Endpoint<PRemoteDecoderManagerChild> aEndpoint);

async PJavaScript();

async PRemoteSpellcheckEngine();

async InitCrashReporter(NativeThreadId tid);
Expand Down
1 change: 0 additions & 1 deletion dom/ipc/moz.build
Expand Up @@ -50,7 +50,6 @@ EXPORTS.mozilla.dom += [
'ContentParent.h',
'ContentProcess.h',
'ContentProcessManager.h',
'CPOWManagerGetter.h',
'CSPMessageUtils.h',
'DocShellMessageUtils.h',
'EffectsInfo.h',
Expand Down
2 changes: 0 additions & 2 deletions ipc/ipdl/ipdl/direct_call.py
Expand Up @@ -438,8 +438,6 @@
# set() of (Protocol, side)
VIRTUAL_CALL_CLASSES = set([
# Defined as a strange template
("PJavaScript", "child"),
("PJavaScript", "parent"),
("PMedia", "parent"),
("PTexture", "parent"),

Expand Down
42 changes: 0 additions & 42 deletions ipc/ipdl/sync-messages.ini
Expand Up @@ -614,48 +614,6 @@ platform = win
description = Legacy a11y IPC
platform = win

# CPOWs
[PJavaScript::PreventExtensions]
description = CPOW Implementation
[PJavaScript::GetOwnPropertyDescriptor]
description = CPOW Implementation
[PJavaScript::DefineProperty]
description = CPOW Implementation
[PJavaScript::Delete]
description = CPOW Implementation
[PJavaScript::Has]
description = CPOW Implementation
[PJavaScript::HasOwn]
description = CPOW Implementation
[PJavaScript::Get]
description = CPOW Implementation
[PJavaScript::Set]
description = CPOW Implementation
[PJavaScript::IsExtensible]
description = CPOW Implementation
[PJavaScript::CallOrConstruct]
description = CPOW Implementation
[PJavaScript::HasInstance]
description = CPOW Implementation
[PJavaScript::GetBuiltinClass]
description = CPOW Implementation
[PJavaScript::IsArray]
description = CPOW Implementation
[PJavaScript::ClassName]
description = CPOW Implementation
[PJavaScript::GetPrototype]
description = CPOW Implementation
[PJavaScript::GetPrototypeIfOrdinary]
description = CPOW Implementation
[PJavaScript::RegExpToShared]
description = CPOW Implementation
[PJavaScript::GetPropertyKeys]
description = CPOW Implementation
[PJavaScript::InstanceOf]
description = CPOW Implementation
[PJavaScript::DOMInstanceOf]
description = CPOW Implementation

# Plugins
[PPluginWidget::Create]
description = Legacy NPAPI IPC
Expand Down
24 changes: 0 additions & 24 deletions js/ipc/CpowHolder.h

This file was deleted.

0 comments on commit 38b061e

Please sign in to comment.