| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "content/browser/devtools/service_worker_devtools_manager.h" | 10 #include "content/browser/devtools/service_worker_devtools_manager.h" |
| 11 #include "content/browser/devtools/worker_devtools_agent_host.h" | 11 #include "content/browser/devtools/worker_devtools_agent_host.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 class ServiceWorkerDevToolsAgentHost : public WorkerDevToolsAgentHost { | 15 class ServiceWorkerDevToolsAgentHost : public WorkerDevToolsAgentHost { |
| 16 public: | 16 public: |
| 17 using List = std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>; | 17 using List = std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>; |
| 18 using Map = std::map<std::string, | 18 using Map = std::map<std::string, |
| 19 scoped_refptr<ServiceWorkerDevToolsAgentHost>>; | 19 scoped_refptr<ServiceWorkerDevToolsAgentHost>>; |
| 20 using ServiceWorkerIdentifier = | 20 using ServiceWorkerIdentifier = |
| 21 ServiceWorkerDevToolsManager::ServiceWorkerIdentifier; | 21 ServiceWorkerDevToolsManager::ServiceWorkerIdentifier; |
| 22 | 22 |
| 23 ServiceWorkerDevToolsAgentHost(WorkerId worker_id, | 23 ServiceWorkerDevToolsAgentHost(WorkerId worker_id, |
| 24 const ServiceWorkerIdentifier& service_worker); | 24 const ServiceWorkerIdentifier& service_worker); |
| 25 | 25 |
| 26 void UnregisterWorker(); | 26 void UnregisterWorker(); |
| 27 | 27 |
| 28 // DevToolsAgentHost override. | 28 // DevToolsAgentHost overrides. |
| 29 Type GetType() override; | 29 Type GetType() override; |
| 30 std::string GetTitle() override; | 30 std::string GetTitle() override; |
| 31 GURL GetURL() override; | 31 GURL GetURL() override; |
| 32 bool Activate() override; | 32 bool Activate() override; |
| 33 bool Close() override; | 33 bool Close() override; |
| 34 | 34 |
| 35 // IPCDevToolsAgentHost override. | 35 // WorkerDevToolsAgentHost overrides. |
| 36 void OnClientAttached(bool reattached) override; | 36 void OnAttachedStateChanged(bool attached) override; |
| 37 void OnClientDetached() override; | |
| 38 | 37 |
| 39 bool Matches(const ServiceWorkerIdentifier& other); | 38 bool Matches(const ServiceWorkerIdentifier& other); |
| 40 | 39 |
| 41 private: | 40 private: |
| 42 ~ServiceWorkerDevToolsAgentHost() override; | 41 ~ServiceWorkerDevToolsAgentHost() override; |
| 43 scoped_ptr<ServiceWorkerIdentifier> service_worker_; | 42 scoped_ptr<ServiceWorkerIdentifier> service_worker_; |
| 44 | 43 |
| 45 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDevToolsAgentHost); | 44 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDevToolsAgentHost); |
| 46 }; | 45 }; |
| 47 | 46 |
| 48 } // namespace content | 47 } // namespace content |
| 49 | 48 |
| 50 #endif // CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_ | 49 #endif // CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_ |
| OLD | NEW |