Skip to content

Commit

Permalink
Bug 1690474 - [remote] Move CDP specific code to cdp/. r=remote-proto…
Browse files Browse the repository at this point in the history
…col-reviewers,jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D104574
  • Loading branch information
whimboo committed Feb 14, 2021
1 parent ec7ae63 commit 8cb9082
Show file tree
Hide file tree
Showing 59 changed files with 205 additions and 202 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ modules/libpref/test/unit/*data/
python/

# These are (mainly) imported code that we don't want to lint to make imports easier.
remote/Protocol.jsm
remote/cdp/Protocol.jsm
remote/test/browser/chrome-remote-interface.js

# services/ exclusions
Expand Down
2 changes: 1 addition & 1 deletion remote/Connection.jsm → remote/cdp/Connection.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const { truncate } = ChromeUtils.import(
);
const { Log } = ChromeUtils.import("chrome://remote/content/shared/Log.jsm");
const { UnknownMethodError } = ChromeUtils.import(
"chrome://remote/content/Error.jsm"
"chrome://remote/content/cdp/Error.jsm"
);

XPCOMUtils.defineLazyGetter(this, "log", Log.get);
Expand Down
4 changes: 2 additions & 2 deletions remote/Error.jsm → remote/cdp/Error.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class RemoteAgentError extends Error {
* The error must be of this form:
*
* {"message": "TypeError: foo is not a function\n
* execute@chrome://remote/content/sessions/Session.jsm:73:39\n
* onMessage@chrome://remote/content/sessions/TabSession.jsm:65:20"}
* execute@chrome://remote/content/cdp/sessions/Session.jsm:73:39\n
* onMessage@chrome://remote/content/cdp/sessions/TabSession.jsm:65:20"}
*
* This approach has the notable deficiency that it cannot deal
* with causes to errors because of the unstructured nature of CDP
Expand Down
6 changes: 4 additions & 2 deletions remote/JSONHandler.jsm → remote/cdp/JSONHandler.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ const { HTTP_404, HTTP_505 } = ChromeUtils.import(
"chrome://remote/content/server/HTTPD.jsm"
);
const { Log } = ChromeUtils.import("chrome://remote/content/shared/Log.jsm");
const { Protocol } = ChromeUtils.import("chrome://remote/content/Protocol.jsm");
const { Protocol } = ChromeUtils.import(
"chrome://remote/content/cdp/Protocol.jsm"
);
const { RemoteAgentError } = ChromeUtils.import(
"chrome://remote/content/Error.jsm"
"chrome://remote/content/cdp/Error.jsm"
);

class JSONHandler {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ XPCOMUtils.defineLazyServiceGetters(this, {
});

const { UnsupportedError } = ChromeUtils.import(
"chrome://remote/content/Error.jsm"
"chrome://remote/content/cdp/Error.jsm"
);

class StreamRegistry {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
var EXPORTED_SYMBOLS = ["ContentProcessDomain"];

const { Domain } = ChromeUtils.import(
"chrome://remote/content/domains/Domain.jsm"
"chrome://remote/content/cdp/domains/Domain.jsm"
);

class ContentProcessDomain extends Domain {
Expand Down
25 changes: 25 additions & 0 deletions remote/cdp/domains/ContentProcessDomains.jsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */

"use strict";

var EXPORTED_SYMBOLS = ["ContentProcessDomains"];

const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);

const ContentProcessDomains = {};

XPCOMUtils.defineLazyModuleGetters(ContentProcessDomains, {
DOM: "chrome://remote/content/cdp/domains/content/DOM.jsm",
Emulation: "chrome://remote/content/cdp/domains/content/Emulation.jsm",
Input: "chrome://remote/content/cdp/domains/content/Input.jsm",
Log: "chrome://remote/content/cdp/domains/content/Log.jsm",
Network: "chrome://remote/content/cdp/domains/content/Network.jsm",
Page: "chrome://remote/content/cdp/domains/content/Page.jsm",
Performance: "chrome://remote/content/cdp/domains/content/Performance.jsm",
Runtime: "chrome://remote/content/cdp/domains/content/Runtime.jsm",
Security: "chrome://remote/content/cdp/domains/content/Security.jsm",
});
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
var EXPORTED_SYMBOLS = ["DomainCache"];

const { Domain } = ChromeUtils.import(
"chrome://remote/content/domains/Domain.jsm"
"chrome://remote/content/cdp/domains/Domain.jsm"
);
const { UnknownMethodError } = ChromeUtils.import(
"chrome://remote/content/Error.jsm"
"chrome://remote/content/cdp/Error.jsm"
);

/**
Expand Down
24 changes: 24 additions & 0 deletions remote/cdp/domains/ParentProcessDomains.jsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */

"use strict";

var EXPORTED_SYMBOLS = ["ParentProcessDomains"];

const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);

const ParentProcessDomains = {};

XPCOMUtils.defineLazyModuleGetters(ParentProcessDomains, {
Browser: "chrome://remote/content/cdp/domains/parent/Browser.jsm",
Emulation: "chrome://remote/content/cdp/domains/parent/Emulation.jsm",
Input: "chrome://remote/content/cdp/domains/parent/Input.jsm",
IO: "chrome://remote/content/cdp/domains/parent/IO.jsm",
Network: "chrome://remote/content/cdp/domains/parent/Network.jsm",
Page: "chrome://remote/content/cdp/domains/parent/Page.jsm",
Security: "chrome://remote/content/cdp/domains/parent/Security.jsm",
Target: "chrome://remote/content/cdp/domains/parent/Target.jsm",
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
var EXPORTED_SYMBOLS = ["DOM"];

const { ContentProcessDomain } = ChromeUtils.import(
"chrome://remote/content/domains/ContentProcessDomain.jsm"
"chrome://remote/content/cdp/domains/ContentProcessDomain.jsm"
);

class DOM extends ContentProcessDomain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
var EXPORTED_SYMBOLS = ["Emulation"];

const { ContentProcessDomain } = ChromeUtils.import(
"chrome://remote/content/domains/ContentProcessDomain.jsm"
"chrome://remote/content/cdp/domains/ContentProcessDomain.jsm"
);

class Emulation extends ContentProcessDomain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
var EXPORTED_SYMBOLS = ["Input"];

const { ContentProcessDomain } = ChromeUtils.import(
"chrome://remote/content/domains/ContentProcessDomain.jsm"
"chrome://remote/content/cdp/domains/ContentProcessDomain.jsm"
);

class Input extends ContentProcessDomain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
var EXPORTED_SYMBOLS = ["Log"];

const { ContentProcessDomain } = ChromeUtils.import(
"chrome://remote/content/domains/ContentProcessDomain.jsm"
"chrome://remote/content/cdp/domains/ContentProcessDomain.jsm"
);
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
var EXPORTED_SYMBOLS = ["Network"];

const { ContentProcessDomain } = ChromeUtils.import(
"chrome://remote/content/domains/ContentProcessDomain.jsm"
"chrome://remote/content/cdp/domains/ContentProcessDomain.jsm"
);

class Network extends ContentProcessDomain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { XPCOMUtils } = ChromeUtils.import(
);

const { ContentProcessDomain } = ChromeUtils.import(
"chrome://remote/content/domains/ContentProcessDomain.jsm"
"chrome://remote/content/cdp/domains/ContentProcessDomain.jsm"
);

XPCOMUtils.defineLazyServiceGetter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
var EXPORTED_SYMBOLS = ["Performance"];

const { ContentProcessDomain } = ChromeUtils.import(
"chrome://remote/content/domains/ContentProcessDomain.jsm"
"chrome://remote/content/cdp/domains/ContentProcessDomain.jsm"
);

class Performance extends ContentProcessDomain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const { addDebuggerToGlobal } = ChromeUtils.import(
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");

const { ContentProcessDomain } = ChromeUtils.import(
"chrome://remote/content/domains/ContentProcessDomain.jsm"
"chrome://remote/content/cdp/domains/ContentProcessDomain.jsm"
);
const { ExecutionContext } = ChromeUtils.import(
"chrome://remote/content/domains/content/runtime/ExecutionContext.jsm"
"chrome://remote/content/cdp/domains/content/runtime/ExecutionContext.jsm"
);
const { executeSoon } = ChromeUtils.import(
"chrome://remote/content/shared/Sync.jsm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
var EXPORTED_SYMBOLS = ["Security"];

const { ContentProcessDomain } = ChromeUtils.import(
"chrome://remote/content/domains/ContentProcessDomain.jsm"
"chrome://remote/content/cdp/domains/ContentProcessDomain.jsm"
);

class Security extends ContentProcessDomain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var EXPORTED_SYMBOLS = ["Browser"];

const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { Domain } = ChromeUtils.import(
"chrome://remote/content/domains/Domain.jsm"
"chrome://remote/content/cdp/domains/Domain.jsm"
);

class Browser extends Domain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var EXPORTED_SYMBOLS = ["Emulation"];
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");

const { Domain } = ChromeUtils.import(
"chrome://remote/content/domains/Domain.jsm"
"chrome://remote/content/cdp/domains/Domain.jsm"
);

const MAX_WINDOW_SIZE = 10000000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ XPCOMUtils.defineLazyModuleGetters(this, {
});

const { Domain } = ChromeUtils.import(
"chrome://remote/content/domains/Domain.jsm"
"chrome://remote/content/cdp/domains/Domain.jsm"
);
const { StreamRegistry } = ChromeUtils.import(
"chrome://remote/content/StreamRegistry.jsm"
"chrome://remote/content/cdp/StreamRegistry.jsm"
);

const DEFAULT_CHUNK_SIZE = 10 * 1024 * 1024;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var EXPORTED_SYMBOLS = ["Input"];
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");

const { Domain } = ChromeUtils.import(
"chrome://remote/content/domains/Domain.jsm"
"chrome://remote/content/cdp/domains/Domain.jsm"
);

class Input extends Domain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const { XPCOMUtils } = ChromeUtils.import(
XPCOMUtils.defineLazyGlobalGetters(this, ["URL"]);

const { Domain } = ChromeUtils.import(
"chrome://remote/content/domains/Domain.jsm"
"chrome://remote/content/cdp/domains/Domain.jsm"
);

const MAX_COOKIE_EXPIRY = Number.MAX_SAFE_INTEGER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ const { clearInterval, setInterval } = ChromeUtils.import(
);

const { DialogHandler } = ChromeUtils.import(
"chrome://remote/content/domains/parent/page/DialogHandler.jsm"
"chrome://remote/content/cdp/domains/parent/page/DialogHandler.jsm"
);
const { Domain } = ChromeUtils.import(
"chrome://remote/content/domains/Domain.jsm"
"chrome://remote/content/cdp/domains/Domain.jsm"
);
const { UnsupportedError } = ChromeUtils.import(
"chrome://remote/content/Error.jsm"
"chrome://remote/content/cdp/Error.jsm"
);
const { streamRegistry } = ChromeUtils.import(
"chrome://remote/content/domains/parent/IO.jsm"
"chrome://remote/content/cdp/domains/parent/IO.jsm"
);
const { PollPromise } = ChromeUtils.import(
"chrome://remote/content/shared/Sync.jsm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
var EXPORTED_SYMBOLS = ["Security"];

const { Domain } = ChromeUtils.import(
"chrome://remote/content/domains/Domain.jsm"
"chrome://remote/content/cdp/domains/Domain.jsm"
);

const { Preferences } = ChromeUtils.import(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ const { ContextualIdentityService } = ChromeUtils.import(
"resource://gre/modules/ContextualIdentityService.jsm"
);
const { Domain } = ChromeUtils.import(
"chrome://remote/content/domains/Domain.jsm"
"chrome://remote/content/cdp/domains/Domain.jsm"
);
const { MainProcessTarget } = ChromeUtils.import(
"chrome://remote/content/targets/MainProcessTarget.jsm"
"chrome://remote/content/cdp/targets/MainProcessTarget.jsm"
);
const { TabManager } = ChromeUtils.import(
"chrome://remote/content/shared/TabManager.jsm"
);
const { TabSession } = ChromeUtils.import(
"chrome://remote/content/sessions/TabSession.jsm"
"chrome://remote/content/cdp/sessions/TabSession.jsm"
);
const { WindowManager } = ChromeUtils.import(
"chrome://remote/content/shared/WindowManager.jsm"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const { CommonUtils } = ChromeUtils.import(
"resource://services-common/utils.js"
);
const { ChannelEventSinkFactory } = ChromeUtils.import(
"chrome://remote/content/observers/ChannelEventSink.jsm"
"chrome://remote/content/cdp/observers/ChannelEventSink.jsm"
);

const CC = Components.Constructor;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
var EXPORTED_SYMBOLS = ["ContentProcessSession"];

const { ContentProcessDomains } = ChromeUtils.import(
"chrome://remote/content/domains/ContentProcessDomains.jsm"
"chrome://remote/content/cdp/domains/ContentProcessDomains.jsm"
);
const { DomainCache } = ChromeUtils.import(
"chrome://remote/content/domains/DomainCache.jsm"
"chrome://remote/content/cdp/domains/DomainCache.jsm"
);

ChromeUtils.defineModuleGetter(
this,
"ContextObserver",
"chrome://remote/content/observers/ContextObserver.jsm"
"chrome://remote/content/cdp/observers/ContextObserver.jsm"
);

class ContentProcessSession {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
var EXPORTED_SYMBOLS = ["MainProcessSession"];

const { Session } = ChromeUtils.import(
"chrome://remote/content/sessions/Session.jsm"
"chrome://remote/content/cdp/sessions/Session.jsm"
);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
var EXPORTED_SYMBOLS = ["Session"];

const { ParentProcessDomains } = ChromeUtils.import(
"chrome://remote/content/domains/ParentProcessDomains.jsm"
"chrome://remote/content/cdp/domains/ParentProcessDomains.jsm"
);
const { DomainCache } = ChromeUtils.import(
"chrome://remote/content/domains/DomainCache.jsm"
"chrome://remote/content/cdp/domains/DomainCache.jsm"
);

const { NetworkObserver } = ChromeUtils.import(
"chrome://remote/content/observers/NetworkObserver.jsm"
"chrome://remote/content/cdp/observers/NetworkObserver.jsm"
);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
var EXPORTED_SYMBOLS = ["TabSession"];

const { Session } = ChromeUtils.import(
"chrome://remote/content/sessions/Session.jsm"
"chrome://remote/content/cdp/sessions/Session.jsm"
);

/**
Expand Down Expand Up @@ -40,7 +40,7 @@ class TabSession extends Session {
this.mm.addMessageListener("remote:error", this);

this.mm.loadFrameScript(
"chrome://remote/content/sessions/frame-script.js",
"chrome://remote/content/cdp/sessions/frame-script.js",
false
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"use strict";

const { ContentProcessSession } = ChromeUtils.import(
"chrome://remote/content/sessions/ContentProcessSession.jsm"
"chrome://remote/content/cdp/sessions/ContentProcessSession.jsm"
);

/* global content, docShell */
Expand Down
Loading

0 comments on commit 8cb9082

Please sign in to comment.