bug 1523104: remote: merge Handler into JSONHandler as we only have JSONHandlers; r=ato
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 04 Mar 2019 09:45:55 -0800
changeset 521115 6a8bdb28bc820eeca20ae65ab067ea7565743efb
parent 521114 2bb69a9505ba13d1ffc45c13d4f0b14b4104343e
child 521116 9f03512232fb28d951209b1dae8c7f61be48523b
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)
reviewersato
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: merge Handler into JSONHandler as we only have JSONHandlers; r=ato
remote/Handler.jsm
--- a/remote/Handler.jsm
+++ b/remote/Handler.jsm
@@ -10,41 +10,35 @@ var EXPORTED_SYMBOLS = [
 ];
 
 const {Log} = ChromeUtils.import("chrome://remote/content/Log.jsm");
 const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Protocol} = ChromeUtils.import("chrome://remote/content/Protocol.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "log", Log.get);
 
-class Handler {
+class JSONHandler {
   register(server) {
-    server.registerPathHandler(this.path, this.rawHandle);
+    server.registerPathHandler(this.path, (req, resp) => {
+      resp.setHeader("content-type", "application/json");
+      this.rawHandle(req, new JSONWriter(resp));
+    });
   }
 
   rawHandle(request, response) {
     log.trace(`(${request._scheme})-> ${request._method} ${request._path}`);
 
     try {
       this.handle(request, response);
     } catch (e) {
       log.warn(e);
     }
   }
 }
 
-class JSONHandler extends Handler {
-  register(server) {
-    server.registerPathHandler(this.path, (req, resp) => {
-      resp.setHeader("content-type", "application/json");
-      this.rawHandle(req, new JSONWriter(resp));
-    });
-  }
-}
-
 class TargetListHandler extends JSONHandler {
   constructor(targets) {
     super();
     this.targets = targets;
   }
 
   get path() {
     return "/json/list";