зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 0a227ecdcca5 (bug 1580485) for debugger failure on a CLOSED TREE
This commit is contained in:
Родитель
a6c404619f
Коммит
b7a3c598ec
|
@ -7,34 +7,9 @@
|
|||
import { workerUtils } from "devtools-utils";
|
||||
const { WorkerDispatcher } = workerUtils;
|
||||
|
||||
let startArgs;
|
||||
let dispatcher;
|
||||
const dispatcher = new WorkerDispatcher();
|
||||
export const start = dispatcher.start.bind(dispatcher);
|
||||
export const stop = dispatcher.stop.bind(dispatcher);
|
||||
|
||||
function getDispatcher() {
|
||||
if (!dispatcher) {
|
||||
dispatcher = new WorkerDispatcher();
|
||||
dispatcher.start(...startArgs);
|
||||
}
|
||||
|
||||
return dispatcher;
|
||||
}
|
||||
|
||||
export const start = (...args) => {
|
||||
startArgs = args;
|
||||
};
|
||||
|
||||
export const stop = () => {
|
||||
if (dispatcher) {
|
||||
dispatcher.stop();
|
||||
dispatcher = null;
|
||||
startArgs = null;
|
||||
}
|
||||
};
|
||||
|
||||
export const getMatches = (...args) => {
|
||||
return getDispatcher().invoke("getMatches", ...args);
|
||||
};
|
||||
|
||||
export const findSourceMatches = (...args) => {
|
||||
return getDispatcher().invoke("findSourceMatches", ...args);
|
||||
};
|
||||
export const getMatches = dispatcher.task("getMatches");
|
||||
export const findSourceMatches = dispatcher.task("findSourceMatches");
|
||||
|
|
Загрузка…
Ссылка в новой задаче