| 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..3d8464247c06811153bcf41d9c13dc10ad778e05 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,7 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager {
|
| WORKER_UNINSPECTED,
|
| WORKER_INSPECTED,
|
| WORKER_TERMINATED,
|
| - WORKER_PAUSED,
|
| + WORKER_PAUSED_FOR_REATTACH,
|
| };
|
|
|
| class WorkerInfo {
|
| @@ -79,7 +89,8 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager {
|
| // Creates WorkerInfo for SharedWorker.
|
| explicit WorkerInfo(const SharedWorkerInstance& instance);
|
| // Creates WorkerInfo for ServiceWorker.
|
| - explicit WorkerInfo(const ServiceWorkerIdentifier& service_worker_id);
|
| + explicit WorkerInfo(const ServiceWorkerIdentifier& service_worker_id,
|
| + bool debug_on_start);
|
| ~WorkerInfo();
|
|
|
| WorkerState state() { return state_; }
|
| @@ -90,10 +101,12 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager {
|
| }
|
| bool Matches(const SharedWorkerInstance& other);
|
| bool Matches(const ServiceWorkerIdentifier& other);
|
| + bool debug_on_start() const { return debug_on_start_; }
|
|
|
| private:
|
| scoped_ptr<SharedWorkerInstance> shared_worker_instance_;
|
| scoped_ptr<ServiceWorkerIdentifier> service_worker_id_;
|
| + const bool debug_on_start_;
|
| WorkerState state_;
|
| EmbeddedWorkerDevToolsAgentHost* agent_host_;
|
| };
|
| @@ -117,6 +130,8 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager {
|
|
|
| WorkerInfoMap workers_;
|
|
|
| + bool debug_service_worker_on_start_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerDevToolsManager);
|
| };
|
|
|
|
|