| 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 <stdint.h> |
| 9 |
| 8 #include <map> | 10 #include <map> |
| 9 | 11 |
| 12 #include "base/macros.h" |
| 10 #include "content/browser/devtools/protocol/network_handler.h" | 13 #include "content/browser/devtools/protocol/network_handler.h" |
| 11 #include "content/browser/devtools/service_worker_devtools_manager.h" | 14 #include "content/browser/devtools/service_worker_devtools_manager.h" |
| 12 #include "content/browser/devtools/worker_devtools_agent_host.h" | 15 #include "content/browser/devtools/worker_devtools_agent_host.h" |
| 13 | 16 |
| 14 namespace content { | 17 namespace content { |
| 15 | 18 |
| 16 class ServiceWorkerDevToolsAgentHost : public WorkerDevToolsAgentHost { | 19 class ServiceWorkerDevToolsAgentHost : public WorkerDevToolsAgentHost { |
| 17 public: | 20 public: |
| 18 using List = std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>; | 21 using List = std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>; |
| 19 using Map = std::map<std::string, | 22 using Map = std::map<std::string, |
| 20 scoped_refptr<ServiceWorkerDevToolsAgentHost>>; | 23 scoped_refptr<ServiceWorkerDevToolsAgentHost>>; |
| 21 using ServiceWorkerIdentifier = | 24 using ServiceWorkerIdentifier = |
| 22 ServiceWorkerDevToolsManager::ServiceWorkerIdentifier; | 25 ServiceWorkerDevToolsManager::ServiceWorkerIdentifier; |
| 23 | 26 |
| 24 ServiceWorkerDevToolsAgentHost(WorkerId worker_id, | 27 ServiceWorkerDevToolsAgentHost(WorkerId worker_id, |
| 25 const ServiceWorkerIdentifier& service_worker); | 28 const ServiceWorkerIdentifier& service_worker); |
| 26 | 29 |
| 27 void UnregisterWorker(); | 30 void UnregisterWorker(); |
| 28 | 31 |
| 29 // DevToolsAgentHost overrides. | 32 // DevToolsAgentHost overrides. |
| 30 Type GetType() override; | 33 Type GetType() override; |
| 31 std::string GetTitle() override; | 34 std::string GetTitle() override; |
| 32 GURL GetURL() override; | 35 GURL GetURL() override; |
| 33 bool Activate() override; | 36 bool Activate() override; |
| 34 bool Close() override; | 37 bool Close() override; |
| 35 | 38 |
| 36 // WorkerDevToolsAgentHost overrides. | 39 // WorkerDevToolsAgentHost overrides. |
| 37 void OnAttachedStateChanged(bool attached) override; | 40 void OnAttachedStateChanged(bool attached) override; |
| 38 | 41 |
| 39 int64 service_worker_version_id() const; | 42 int64_t service_worker_version_id() const; |
| 40 | 43 |
| 41 bool Matches(const ServiceWorkerIdentifier& other); | 44 bool Matches(const ServiceWorkerIdentifier& other); |
| 42 | 45 |
| 43 private: | 46 private: |
| 44 ~ServiceWorkerDevToolsAgentHost() override; | 47 ~ServiceWorkerDevToolsAgentHost() override; |
| 45 scoped_ptr<ServiceWorkerIdentifier> service_worker_; | 48 scoped_ptr<ServiceWorkerIdentifier> service_worker_; |
| 46 scoped_ptr<devtools::network::NetworkHandler> network_handler_; | 49 scoped_ptr<devtools::network::NetworkHandler> network_handler_; |
| 47 | 50 |
| 48 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDevToolsAgentHost); | 51 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDevToolsAgentHost); |
| 49 }; | 52 }; |
| 50 | 53 |
| 51 } // namespace content | 54 } // namespace content |
| 52 | 55 |
| 53 #endif // CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_ | 56 #endif // CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_AGENT_HOST_H_ |
| OLD | NEW |