Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Unified Diff: Source/devtools/front_end/main/Main.js

Issue 299803003: Add isPausedWorker command to Runtime and use it to auto attach DevTools to ServiceWorker. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rename isPausedWorker to into isRunRequired Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/WorkerRuntimeAgent.cpp ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/main/Main.js
diff --git a/Source/devtools/front_end/main/Main.js b/Source/devtools/front_end/main/Main.js
index 168e335337c9c275980add65566b11f23a8f7837..c6cba8c1d3d919b577753b3fa0aebb2c4c371b27 100644
--- a/Source/devtools/front_end/main/Main.js
+++ b/Source/devtools/front_end/main/Main.js
@@ -135,13 +135,34 @@ WebInspector.Main.prototype = {
_loadCompletedForWorkers: function()
{
- // Make sure script execution of dedicated worker is resumed and then paused
- // on the first script statement in case we autoattached to it.
+ // Make sure script execution of dedicated worker or service worker is
+ // resumed and then paused on the first script statement in case we
+ // autoattached to it.
if (WebInspector.queryParam("workerPaused")) {
+ pauseAndResume.call(this);
+ } else{
+ RuntimeAgent.isRunRequired(isRunRequiredCallback.bind(this));
+ }
+
+ /**
+ * @this {WebInspector.Main}
+ */
+ function isRunRequiredCallback(error, result)
+ {
+ if (result) {
+ pauseAndResume.call(this);
+ } else if (!Capabilities.isMainFrontend) {
+ calculateTitle.call(this);
+ }
+ }
+
+ /**
+ * @this {WebInspector.Main}
+ */
+ function pauseAndResume()
+ {
DebuggerAgent.pause();
RuntimeAgent.run(calculateTitle.bind(this));
- } else if (!Capabilities.isMainFrontend) {
- calculateTitle.call(this);
}
/**
« no previous file with comments | « Source/core/inspector/WorkerRuntimeAgent.cpp ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698