bug 1523104: remote: remove unused ChildRemoteAgent; r=ochameau
authorAndreas Tolfsen <ato@sny.no>
Fri, 08 Feb 2019 16:49:15 +0000
changeset 521071 af7a76690b8a
parent 521070 7b87252c4a31
child 521072 f1d96bc26051
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1523104
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1523104: remote: remove unused ChildRemoteAgent; r=ochameau
remote/RemoteAgent.js
--- a/remote/RemoteAgent.js
+++ b/remote/RemoteAgent.js
@@ -68,18 +68,16 @@ class ParentRemoteAgent {
     ActorManagerParent.addActors(ACTORS);
     ActorManagerParent.flush();
 
     this.consoleService = new ConsoleServiceObserver();
 
     this.tabs = new TabObserver({registerExisting: true});
     this.tabs.on("open", tab => this.targets.connect(tab.linkedBrowser));
     this.tabs.on("close", tab => this.targets.disconnect(tab.linkedBrowser));
-
-    Services.ppmm.addMessageListener("RemoteAgent:IsRunning", this);
   }
 
   // nsIRemoteAgent
 
   get listening() {
     return !!this.server && !this.server._socketClosed;
   }
 
@@ -204,29 +202,16 @@ class ParentRemoteAgent {
   }
 
   get helpInfo() {
     return "  --debug [<host>][:<port>] Start the Firefox remote agent, which is a low-level\n" +
            "                     debugging interface based on the CDP protocol.  Defaults to\n" +
            "                     listen on port 9222.\n";
   }
 
-  // nsIMessageListener
-
-  receiveMessage({name}) {
-    switch (name) {
-      case "RemoteAgent:IsRunning":
-        return this.listening;
-
-      default:
-        log.warn(`Unknown IPC message to parent process: ${name}`);
-        return null;
-    }
-  }
-
   // XPCOM
 
   get QueryInterface() {
     return ChromeUtils.generateQI([
       Ci.nsICommandLineHandler,
       Ci.nsIRemoteAgent,
     ]);
   }
@@ -282,70 +267,34 @@ class Targets {
     return [...this];
   }
 
   toString() {
     return `[object Targets ${this.size}]`;
   }
 }
 
-class ChildRemoteAgent {
-  get listening() {
-    const reply = Services.cpmm.sendSyncMessage("RemoteAgent:IsListening");
-    if (reply.length == 0) {
-      log.error("No reply from parent process");
-      throw Cr.NS_ERROR_ABORT;
-    }
-    return reply[0];
-  }
-
-  listen() {
-    throw Cr.NS_ERROR_NOT_AVAILABLE;
-  }
-
-  close() {
-    throw Cr.NS_ERROR_NOT_AVAILABLE;
-  }
-
-  get scheme() {
-    Preferences.get(SCHEME, null);
-  }
-  get host() {
-    Preferences.get(HOST, null);
-  }
-  get port() {
-    Preferences.get(PORT, null);
-  }
-
-  // XPCOM
-
-  get QueryInterface() {
-    return ChromeUtils.generateQI([Ci.nsIRemoteAgent]);
-  }
-}
-
 const RemoteAgentFactory = {
   instance_: null,
 
   createInstance(outer, iid) {
     if (outer) {
       throw Cr.NS_ERROR_NO_AGGREGATION;
     }
     if (!Preferences.get(ENABLED, false)) {
       return null;
     }
 
-    if (!this.instance_) {
-      if (Services.appinfo.processType == Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT) {
-        this.instance_ = new ChildRemoteAgent();
-      } else {
-        this.instance_ = new ParentRemoteAgent();
-      }
+    if (Services.appinfo.processType == Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT) {
+      throw Cr.NS_ERROR_NOT_IMPLEMENTED;
     }
 
+    if (!this.instance_) {
+      this.instance_ = new ParentRemoteAgent();
+    }
     return this.instance_.QueryInterface(iid);
   },
 };
 
 function RemoteAgent() {}
 
 RemoteAgent.prototype = {
     classDescription: "Remote Agent",