Chromium Code Reviews| 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 ea075740e84ef64268819021fe1344c64ad81422..f643af8125cf529c6b794177952e7cd7ef0751e4 100644 |
| --- a/content/browser/devtools/embedded_worker_devtools_manager.h |
| +++ b/content/browser/devtools/embedded_worker_devtools_manager.h |
| @@ -7,7 +7,6 @@ |
| #include "base/basictypes.h" |
| #include "base/containers/scoped_ptr_hash_map.h" |
| -#include "base/files/file_path.h" |
| #include "base/gtest_prod_util.h" |
| #include "base/memory/scoped_vector.h" |
| #include "base/memory/singleton.h" |
| @@ -15,10 +14,10 @@ |
| #include "content/browser/shared_worker/shared_worker_instance.h" |
| #include "content/common/content_export.h" |
| -class GURL; |
| - |
| namespace content { |
| + |
| class DevToolsAgentHost; |
| +class ServiceWorkerContextCore; |
| // EmbeddedWorkerDevToolsManager is used instead of WorkerDevToolsManager when |
| // "enable-embedded-shared-worker" flag is set. |
| @@ -34,21 +33,22 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager { |
| DevToolsAgentHost* GetDevToolsAgentHostForWorker(int worker_process_id, |
| int worker_route_id); |
| DevToolsAgentHost* GetDevToolsAgentHostForServiceWorker( |
| - const base::FilePath& storage_partition_path, |
| - const GURL& service_worker_scope); |
| + const ServiceWorkerContextCore* const service_worker_context_core, |
| + int64 service_worker_version_id); |
| // Returns true when the worker must be paused on start. |
| bool SharedWorkerCreated(int worker_process_id, |
| int worker_route_id, |
| const SharedWorkerInstance& instance); |
| // Returns true when the worker must be paused on start. |
| - // TODO(horo): Currently we identify ServiceWorkers with the path of storage |
| - // partition and the scope of ServiceWorker. Consider having a class like |
| - // SharedWorkerInstance instead of the pair. |
| - bool ServiceWorkerCreated(int worker_process_id, |
| - int worker_route_id, |
| - const base::FilePath& storage_partition_path, |
| - const GURL& service_worker_scope); |
| + // TODO(horo): Currently we identify ServiceWorkers with the pointer of |
| + // ServiceWorkerContextCore and the version id of ServiceWorker. Consider |
|
yurys
2014/05/16 13:27:05
It may be a good time to fix this TODO.
horo
2014/05/16 14:43:14
Done.
|
| + // having a class like SharedWorkerInstance instead of the pair. |
| + bool ServiceWorkerCreated( |
| + int worker_process_id, |
| + int worker_route_id, |
| + const ServiceWorkerContextCore* const service_worker_context_core, |
| + int64 service_worker_version_id); |
| void WorkerContextStarted(int worker_process_id, int worker_route_id); |
| void WorkerDestroyed(int worker_process_id, int worker_route_id); |
| @@ -70,8 +70,8 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager { |
| // Creates WorkerInfo for SharedWorker. |
| explicit WorkerInfo(const SharedWorkerInstance& instance); |
| // Creates WorkerInfo for ServiceWorker. |
| - WorkerInfo(const base::FilePath& storage_partition_path, |
| - const GURL& service_worker_scope); |
| + WorkerInfo(const ServiceWorkerContextCore* const service_worker_context, |
| + int64 service_worker_version_id); |
| ~WorkerInfo(); |
| WorkerState state() { return state_; } |
| @@ -81,13 +81,13 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager { |
| agent_host_ = agent_host; |
| } |
| bool Matches(const SharedWorkerInstance& other); |
| - bool Matches(const base::FilePath& other_storage_partition_path, |
| - const GURL& other_service_worker_scope); |
| + bool Matches(const ServiceWorkerContextCore* const service_worker_context, |
| + int64 other_service_worker_version_id); |
| private: |
| scoped_ptr<SharedWorkerInstance> shared_worker_instance_; |
| - scoped_ptr<base::FilePath> storage_partition_path_; |
| - scoped_ptr<GURL> service_worker_scope_; |
| + const ServiceWorkerContextCore* const service_worker_context_; |
|
yurys
2014/05/16 13:27:05
Could you educate me on what the lifetime of Servi
horo
2014/05/16 14:43:14
ServiceWorkerContextCore is deleted after Profile
|
| + const int64 service_worker_version_id_; |
| WorkerState state_; |
| EmbeddedWorkerDevToolsAgentHost* agent_host_; |
| }; |
| @@ -102,8 +102,8 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager { |
| WorkerInfoMap::iterator FindExistingSharedWorkerInfo( |
| const SharedWorkerInstance& instance); |
| WorkerInfoMap::iterator FindExistingServiceWorkerInfo( |
| - const base::FilePath& storage_partition_path, |
| - const GURL& service_worker_scope); |
| + const ServiceWorkerContextCore* const service_worker_context, |
| + int64 service_worker_version_id); |
| void MoveToPausedState(const WorkerId& id, const WorkerInfoMap::iterator& it); |