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

Unified Diff: content/browser/devtools/embedded_worker_devtools_manager.h

Issue 299693002: Add option to open the DevTools window for ServiceWorker on start in serviceworker-internals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WORKER_PAUSED_FOR_DEBUG_ON_START 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
Index: content/browser/devtools/embedded_worker_devtools_manager.h
diff --git a/content/browser/devtools/embedded_worker_devtools_manager.h b/content/browser/devtools/embedded_worker_devtools_manager.h
index 0b30e74a496132b11869f6c764641b777827e63c..3b15c8f209967344375d3a70ca3325de225fb4e2 100644
--- a/content/browser/devtools/embedded_worker_devtools_manager.h
+++ b/content/browser/devtools/embedded_worker_devtools_manager.h
@@ -50,17 +50,27 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager {
DevToolsAgentHost* GetDevToolsAgentHostForServiceWorker(
const ServiceWorkerIdentifier& service_worker_id);
- // Returns true when the worker must be paused on start.
+ // Returns true when the worker must be paused on start because a DevTool
+ // window for the same former SharedWorkerInstance is still opened.
bool SharedWorkerCreated(int worker_process_id,
int worker_route_id,
const SharedWorkerInstance& instance);
- // Returns true when the worker must be paused on start.
+ // Returns true when the worker must be paused on start because a DevTool
+ // window for the same former ServiceWorkerIdentifier is still opened or
+ // debug-on-start is enabled in chrome://serviceworker-internals.
bool ServiceWorkerCreated(int worker_process_id,
int worker_route_id,
const ServiceWorkerIdentifier& service_worker_id);
void WorkerContextStarted(int worker_process_id, int worker_route_id);
void WorkerDestroyed(int worker_process_id, int worker_route_id);
+ void set_debug_service_worker_on_start(bool debug_on_start) {
+ debug_service_worker_on_start_ = debug_on_start;
+ }
+ bool debug_service_worker_on_start() const {
+ return debug_service_worker_on_start_;
+ }
+
private:
friend struct DefaultSingletonTraits<EmbeddedWorkerDevToolsManager>;
friend class EmbeddedWorkerDevToolsManagerTest;
@@ -71,7 +81,8 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager {
WORKER_UNINSPECTED,
WORKER_INSPECTED,
WORKER_TERMINATED,
- WORKER_PAUSED,
+ WORKER_PAUSED_FOR_DEBUG_ON_START,
+ WORKER_PAUSED_FOR_REATTACH,
};
class WorkerInfo {
@@ -117,6 +128,8 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager {
WorkerInfoMap workers_;
+ bool debug_service_worker_on_start_;
+
DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerDevToolsManager);
};

Powered by Google App Engine
This is Rietveld 408576698