OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PROTOCOL_SERVICE_WORKER_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_ |
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 class ServiceWorkerHandler : public DevToolsAgentHostClient, | 36 class ServiceWorkerHandler : public DevToolsAgentHostClient, |
37 public ServiceWorkerDevToolsManager::Observer { | 37 public ServiceWorkerDevToolsManager::Observer { |
38 public: | 38 public: |
39 typedef DevToolsProtocolClient::Response Response; | 39 typedef DevToolsProtocolClient::Response Response; |
40 | 40 |
41 ServiceWorkerHandler(); | 41 ServiceWorkerHandler(); |
42 ~ServiceWorkerHandler() override; | 42 ~ServiceWorkerHandler() override; |
43 | 43 |
44 void SetRenderFrameHost(RenderFrameHostImpl* render_frame_host); | 44 void SetRenderFrameHost(RenderFrameHostImpl* render_frame_host); |
45 void SetClient(scoped_ptr<Client> client); | 45 void SetClient(std::unique_ptr<Client> client); |
46 void UpdateHosts(); | 46 void UpdateHosts(); |
47 void Detached(); | 47 void Detached(); |
48 | 48 |
49 // Protocol 'service worker' domain implementation. | 49 // Protocol 'service worker' domain implementation. |
50 Response Enable(); | 50 Response Enable(); |
51 Response Disable(); | 51 Response Disable(); |
52 Response SendMessage(const std::string& worker_id, | 52 Response SendMessage(const std::string& worker_id, |
53 const std::string& message); | 53 const std::string& message); |
54 Response Stop(const std::string& worker_id); | 54 Response Stop(const std::string& worker_id); |
55 Response Unregister(const std::string& scope_url); | 55 Response Unregister(const std::string& scope_url); |
(...skipping 29 matching lines...) Expand all Loading... |
85 void OnWorkerVersionUpdated( | 85 void OnWorkerVersionUpdated( |
86 const std::vector<ServiceWorkerVersionInfo>& registrations); | 86 const std::vector<ServiceWorkerVersionInfo>& registrations); |
87 void OnErrorReported(int64_t registration_id, | 87 void OnErrorReported(int64_t registration_id, |
88 int64_t version_id, | 88 int64_t version_id, |
89 const ServiceWorkerContextObserver::ErrorInfo& info); | 89 const ServiceWorkerContextObserver::ErrorInfo& info); |
90 | 90 |
91 void OpenNewDevToolsWindow(int process_id, int devtools_agent_route_id); | 91 void OpenNewDevToolsWindow(int process_id, int devtools_agent_route_id); |
92 void ClearForceUpdate(); | 92 void ClearForceUpdate(); |
93 | 93 |
94 scoped_refptr<ServiceWorkerContextWrapper> context_; | 94 scoped_refptr<ServiceWorkerContextWrapper> context_; |
95 scoped_ptr<Client> client_; | 95 std::unique_ptr<Client> client_; |
96 ServiceWorkerDevToolsAgentHost::Map attached_hosts_; | 96 ServiceWorkerDevToolsAgentHost::Map attached_hosts_; |
97 bool enabled_; | 97 bool enabled_; |
98 std::set<GURL> urls_; | 98 std::set<GURL> urls_; |
99 scoped_refptr<ServiceWorkerContextWatcher> context_watcher_; | 99 scoped_refptr<ServiceWorkerContextWatcher> context_watcher_; |
100 RenderFrameHostImpl* render_frame_host_; | 100 RenderFrameHostImpl* render_frame_host_; |
101 | 101 |
102 base::WeakPtrFactory<ServiceWorkerHandler> weak_factory_; | 102 base::WeakPtrFactory<ServiceWorkerHandler> weak_factory_; |
103 | 103 |
104 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandler); | 104 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandler); |
105 }; | 105 }; |
106 | 106 |
107 } // namespace service_worker | 107 } // namespace service_worker |
108 } // namespace devtools | 108 } // namespace devtools |
109 } // namespace content | 109 } // namespace content |
110 | 110 |
111 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_ | 111 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_ |
OLD | NEW |