зеркало из https://github.com/mozilla/gecko-dev.git
bug 1523104: remote: merge Handler into JSONHandler as we only have JSONHandlers; r=ato
This commit is contained in:
Родитель
4c773c706e
Коммит
636c17a22e
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче