| 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 DevToolsProtocolHandler; |
| 16 |
| 15 class ServiceWorkerDevToolsAgentHost : public WorkerDevToolsAgentHost { | 17 class ServiceWorkerDevToolsAgentHost : public WorkerDevToolsAgentHost { |
| 16 public: | 18 public: |
| 17 using List = std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>; | 19 using List = std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>; |
| 18 using Map = std::map<std::string, | 20 using Map = std::map<std::string, |
| 19 scoped_refptr<ServiceWorkerDevToolsAgentHost>>; | 21 scoped_refptr<ServiceWorkerDevToolsAgentHost>>; |
| 20 using ServiceWorkerIdentifier = | 22 using ServiceWorkerIdentifier = |
| 21 ServiceWorkerDevToolsManager::ServiceWorkerIdentifier; | 23 ServiceWorkerDevToolsManager::ServiceWorkerIdentifier; |
| 22 | 24 |
| 23 ServiceWorkerDevToolsAgentHost(WorkerId worker_id, | 25 ServiceWorkerDevToolsAgentHost(WorkerId worker_id, |
| 24 const ServiceWorkerIdentifier& service_worker); | 26 const ServiceWorkerIdentifier& service_worker); |
| 25 | 27 |
| 26 void UnregisterWorker(); | 28 void UnregisterWorker(); |
| 27 | 29 |
| 28 // DevToolsAgentHost override. | 30 // DevToolsAgentHost override. |
| 29 Type GetType() override; | 31 Type GetType() override; |
| 30 std::string GetTitle() override; | 32 std::string GetTitle() override; |
| 31 GURL GetURL() override; | 33 GURL GetURL() override; |
| 32 bool Activate() override; | 34 bool Activate() override; |
| 33 bool Close() override; | 35 bool Close() override; |
| 34 | 36 |
| 35 // IPCDevToolsAgentHost override. | 37 // IPCDevToolsAgentHost override. |
| 38 void DispatchProtocolMessage(const std::string& message) override; |
| 36 void OnClientAttached() override; | 39 void OnClientAttached() override; |
| 37 void OnClientDetached() override; | 40 void OnClientDetached() override; |
| 38 | 41 |
| 39 bool Matches(const ServiceWorkerIdentifier& other); | 42 bool Matches(const ServiceWorkerIdentifier& other); |
| 40 | 43 |
| 41 private: | 44 private: |
| 42 ~ServiceWorkerDevToolsAgentHost() override; | 45 ~ServiceWorkerDevToolsAgentHost() override; |
| 43 scoped_ptr<ServiceWorkerIdentifier> service_worker_; | 46 scoped_ptr<ServiceWorkerIdentifier> service_worker_; |
| 47 scoped_ptr<DevToolsProtocolHandler> protocol_handler_; |
| 48 |
| 49 void DispatchOnInspectorFrontend(const std::string& message); |
| 44 | 50 |
| 45 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDevToolsAgentHost); | 51 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDevToolsAgentHost); |
| 46 }; | 52 }; |
| 47 | 53 |
| 48 } // namespace content | 54 } // namespace content |
| 49 | 55 |
| 50 #endif // CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_ | 56 #endif // CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_ |
| OLD | NEW |