| 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 3b15c8f209967344375d3a70ca3325de225fb4e2..09e191bb5e574f85c00ab2eb651d65d4ba255741 100644
|
| --- a/content/browser/devtools/embedded_worker_devtools_manager.h
|
| +++ b/content/browser/devtools/embedded_worker_devtools_manager.h
|
| @@ -5,6 +5,8 @@
|
| #ifndef CONTENT_BROWSER_DEVTOOLS_EMBEDDED_WORKER_DEVTOOLS_MANAGER_H_
|
| #define CONTENT_BROWSER_DEVTOOLS_EMBEDDED_WORKER_DEVTOOLS_MANAGER_H_
|
|
|
| +#include <map>
|
| +
|
| #include "base/basictypes.h"
|
| #include "base/containers/scoped_ptr_hash_map.h"
|
| #include "base/gtest_prod_util.h"
|
| @@ -17,6 +19,7 @@
|
| namespace content {
|
|
|
| class DevToolsAgentHost;
|
| +class DevToolsTarget;
|
| class ServiceWorkerContextCore;
|
|
|
| // EmbeddedWorkerDevToolsManager is used instead of WorkerDevToolsManager when
|
| @@ -25,20 +28,20 @@ class ServiceWorkerContextCore;
|
| class CONTENT_EXPORT EmbeddedWorkerDevToolsManager {
|
| public:
|
| typedef std::pair<int, int> WorkerId;
|
| - class EmbeddedWorkerDevToolsAgentHost;
|
|
|
| class ServiceWorkerIdentifier {
|
| public:
|
| ServiceWorkerIdentifier(
|
| - const ServiceWorkerContextCore* const service_worker_context,
|
| + ServiceWorkerContextCore* const service_worker_context,
|
| int64 service_worker_version_id);
|
| - explicit ServiceWorkerIdentifier(const ServiceWorkerIdentifier& other);
|
| + ServiceWorkerIdentifier(const ServiceWorkerIdentifier& other);
|
| ~ServiceWorkerIdentifier() {}
|
|
|
| bool Matches(const ServiceWorkerIdentifier& other) const;
|
|
|
| private:
|
| - const ServiceWorkerContextCore* const service_worker_context_;
|
| + friend class EmbeddedWorkerDevToolsManager;
|
| + ServiceWorkerContextCore* const service_worker_context_;
|
| const int64 service_worker_version_id_;
|
| };
|
|
|
| @@ -50,6 +53,10 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager {
|
| DevToolsAgentHost* GetDevToolsAgentHostForServiceWorker(
|
| const ServiceWorkerIdentifier& service_worker_id);
|
|
|
| + typedef base::Callback<void(const std::vector<DevToolsTarget*>&)>
|
| + TargetCallback;
|
| + void GetAllServiceWorkerTargets(const TargetCallback& callback);
|
| +
|
| // 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,
|
| @@ -85,6 +92,8 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager {
|
| WORKER_PAUSED_FOR_REATTACH,
|
| };
|
|
|
| + class EmbeddedWorkerDevToolsAgentHost;
|
| +
|
| class WorkerInfo {
|
| public:
|
| // Creates WorkerInfo for SharedWorker.
|
| @@ -101,6 +110,9 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager {
|
| }
|
| bool Matches(const SharedWorkerInstance& other);
|
| bool Matches(const ServiceWorkerIdentifier& other);
|
| + ServiceWorkerIdentifier* service_worker_id() {
|
| + return service_worker_id_.get();
|
| + }
|
|
|
| private:
|
| scoped_ptr<SharedWorkerInstance> shared_worker_instance_;
|
| @@ -109,6 +121,8 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager {
|
| EmbeddedWorkerDevToolsAgentHost* agent_host_;
|
| };
|
|
|
| + class ServiceWorkerTarget;
|
| +
|
| typedef base::ScopedPtrHashMap<WorkerId, WorkerInfo> WorkerInfoMap;
|
|
|
| EmbeddedWorkerDevToolsManager();
|
| @@ -123,6 +137,16 @@ class CONTENT_EXPORT EmbeddedWorkerDevToolsManager {
|
|
|
| void MoveToPausedState(const WorkerId& id, const WorkerInfoMap::iterator& it);
|
|
|
| + EmbeddedWorkerDevToolsAgentHost* GetOrCreateAgentHost(int worker_process_id,
|
| + int worker_route_id);
|
| + static void GetServiceWorkerUrlsOnIO(
|
| + const std::map<WorkerId, ServiceWorkerIdentifier>& ids,
|
| + const TargetCallback& callback);
|
| + static void CreateTargets(const std::map<WorkerId, GURL> url_map,
|
| + const TargetCallback& callback);
|
| +
|
| + bool CloseServiceWorker(const WorkerId& id);
|
| +
|
| // Resets to its initial state as if newly created.
|
| void ResetForTesting();
|
|
|
|
|