Skip to content

Commit

Permalink
devtools: subscribe dirac to DebuggerPaused and DebuggerResumed events
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin committed Nov 10, 2017
1 parent c36463f commit 11da5bd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions resources/unpacked/devtools/front_end/dirac_lazy/dirac_lazy.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,24 @@ Object.assign(window.dirac, (function() {
const globalObjectClearedHandler = (...args) => {
callback("GlobalObjectCleared", ...args);
};
const debuggerPausedHandler = (...args) => {
callback("DebuggerPaused", ...args);
};
const debuggerResumedHandler = (...args) => {
callback("DebuggerResumed", ...args);
};

SDK.targetManager.addModelListener(SDK.DebuggerModel, SDK.DebuggerModel.Events.GlobalObjectCleared, globalObjectClearedHandler, window.dirac);
SDK.targetManager.addModelListener(SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerPaused, debuggerPausedHandler, window.dirac);
SDK.targetManager.addModelListener(SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerResumed, debuggerResumedHandler, window.dirac);

/**
* @return {boolean}
*/
debuggerEventsUnsubscriber = () => {
SDK.targetManager.removeModelListener(SDK.DebuggerModel, SDK.DebuggerModel.Events.GlobalObjectCleared, globalObjectClearedHandler, window.dirac);
SDK.targetManager.removeModelListener(SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerPaused, debuggerPausedHandler, window.dirac);
SDK.targetManager.removeModelListener(SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerResumed, debuggerResumedHandler, window.dirac);
return true;
};

Expand Down

0 comments on commit 11da5bd

Please sign in to comment.