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 <set> |
| 9 |
8 #include "content/browser/devtools/service_worker_devtools_manager.h" | 10 #include "content/browser/devtools/service_worker_devtools_manager.h" |
9 #include "content/browser/devtools/worker_devtools_agent_host.h" | 11 #include "content/browser/devtools/worker_devtools_agent_host.h" |
10 | 12 |
11 namespace content { | 13 namespace content { |
12 | 14 |
13 class ServiceWorkerDevToolsAgentHost : public WorkerDevToolsAgentHost { | 15 class ServiceWorkerDevToolsAgentHost : public WorkerDevToolsAgentHost { |
14 public: | 16 public: |
15 using List = std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>; | 17 using List = std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>; |
| 18 using Set = std::set<scoped_refptr<ServiceWorkerDevToolsAgentHost>>; |
16 using ServiceWorkerIdentifier = | 19 using ServiceWorkerIdentifier = |
17 ServiceWorkerDevToolsManager::ServiceWorkerIdentifier; | 20 ServiceWorkerDevToolsManager::ServiceWorkerIdentifier; |
18 | 21 |
19 ServiceWorkerDevToolsAgentHost(WorkerId worker_id, | 22 ServiceWorkerDevToolsAgentHost(WorkerId worker_id, |
20 const ServiceWorkerIdentifier& service_worker); | 23 const ServiceWorkerIdentifier& service_worker); |
21 | 24 |
22 // DevToolsAgentHost override. | 25 // DevToolsAgentHost override. |
23 Type GetType() override; | 26 Type GetType() override; |
24 std::string GetTitle() override; | 27 std::string GetTitle() override; |
25 GURL GetURL() override; | 28 GURL GetURL() override; |
26 bool Activate() override; | 29 bool Activate() override; |
27 bool Close() override; | 30 bool Close() override; |
28 | 31 |
29 // IPCDevToolsAgentHost override. | 32 // IPCDevToolsAgentHost override. |
30 void OnClientAttached() override; | 33 void OnClientAttached() override; |
31 void OnClientDetached() override; | 34 void OnClientDetached() override; |
32 | 35 |
33 bool Matches(const ServiceWorkerIdentifier& other); | 36 bool Matches(const ServiceWorkerIdentifier& other); |
34 | 37 |
35 private: | 38 private: |
36 ~ServiceWorkerDevToolsAgentHost() override; | 39 ~ServiceWorkerDevToolsAgentHost() override; |
37 scoped_ptr<ServiceWorkerIdentifier> service_worker_; | 40 scoped_ptr<ServiceWorkerIdentifier> service_worker_; |
38 | 41 |
39 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDevToolsAgentHost); | 42 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDevToolsAgentHost); |
40 }; | 43 }; |
41 | 44 |
42 } // namespace content | 45 } // namespace content |
43 | 46 |
44 #endif // CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_ | 47 #endif // CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_ |
OLD | NEW |