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

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

Issue 261753008: Call EmbeddedWorkerDevToolsManager::ServiceWorkerCreated, WorkerContextStarted and WorkerDestroyed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pass scope in StartWorker() 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 | « no previous file | content/browser/devtools/embedded_worker_devtools_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | content/browser/devtools/embedded_worker_devtools_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698