1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
10 } = require("resource://devtools/shared/protocol.js");
12 customHighlighterSpec
,
13 } = require("resource://devtools/shared/specs/highlighters.js");
16 } = require("resource://devtools/shared/async-utils.js");
18 class CustomHighlighterFront
extends FrontClassWithSpec(customHighlighterSpec
) {
19 constructor(client
, targetFront
, parentFront
) {
20 super(client
, targetFront
, parentFront
);
22 // show/hide requests can be triggered while DevTools are closing.
23 this.show
= safeAsyncMethod(this.show
.bind(this), () => this.isDestroyed());
24 this.hide
= safeAsyncMethod(this.hide
.bind(this), () => this.isDestroyed());
26 this._isShown
= false;
31 return super.show(...args
);
35 this._isShown
= false;
44 if (this.isDestroyed()) {
47 super.finalize(); // oneway call, doesn't expect a response.
52 exports
.CustomHighlighterFront
= CustomHighlighterFront
;
53 registerFront(CustomHighlighterFront
);