bug 1523104: remote: merge Handler into JSONHandler as we only have JSONHandlers; r=ato

This commit is contained in:
Alexandre Poirot 2019-03-04 09:45:55 -08:00 коммит произвёл Andreas Tolfsen
Родитель 4c773c706e
Коммит 636c17a22e
1 изменённых файлов: 5 добавлений и 11 удалений

Просмотреть файл

@ -15,9 +15,12 @@ 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) {
@ -31,15 +34,6 @@ class Handler {
}
}
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();