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 <set> | 8 #include <set> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 void Detached(); | 44 void Detached(); |
45 | 45 |
46 // Protocol 'service worker' domain implementation. | 46 // Protocol 'service worker' domain implementation. |
47 Response Enable(); | 47 Response Enable(); |
48 Response Disable(); | 48 Response Disable(); |
49 Response SendMessage(const std::string& worker_id, | 49 Response SendMessage(const std::string& worker_id, |
50 const std::string& message); | 50 const std::string& message); |
51 Response Stop(const std::string& worker_id); | 51 Response Stop(const std::string& worker_id); |
52 Response Unregister(const std::string& scope_url); | 52 Response Unregister(const std::string& scope_url); |
53 Response StartWorker(const std::string& scope_url); | 53 Response StartWorker(const std::string& scope_url); |
54 Response StopWorker(const std::string& version_id); | 54 Response StopWorker(const std::string& version_uuid); |
55 Response UpdateRegistration(const std::string& scope_url); | 55 Response UpdateRegistration(const std::string& scope_url); |
56 Response InspectWorker(const std::string& version_id); | 56 Response InspectWorker(const std::string& version_uuid); |
57 Response SkipWaiting(const std::string& version_id); | 57 Response SkipWaiting(const std::string& version_uuid); |
58 Response SetDebugOnStart(bool debug_on_start); | 58 Response SetDebugOnStart(bool debug_on_start); |
59 Response DeliverPushMessage(const std::string& origin, | 59 Response DeliverPushMessage(const std::string& origin, |
60 const std::string& registration_id, | 60 const std::string& registration_id, |
61 const std::string& data); | 61 const std::string& data); |
62 Response GetTargetInfo(const std::string& target_id, | 62 Response GetTargetInfo(const std::string& target_id, |
63 scoped_refptr<TargetInfo>* target_info); | 63 scoped_refptr<TargetInfo>* target_info); |
64 Response ActivateTarget(const std::string& target_id); | 64 Response ActivateTarget(const std::string& target_id); |
65 | 65 |
66 // WorkerDevToolsManager::Observer implementation. | 66 // WorkerDevToolsManager::Observer implementation. |
67 void WorkerCreated(ServiceWorkerDevToolsAgentHost* host) override; | 67 void WorkerCreated(ServiceWorkerDevToolsAgentHost* host) override; |
68 void WorkerReadyForInspection(ServiceWorkerDevToolsAgentHost* host) override; | 68 void WorkerReadyForInspection(ServiceWorkerDevToolsAgentHost* host) override; |
69 void WorkerDestroyed(ServiceWorkerDevToolsAgentHost* host) override; | 69 void WorkerDestroyed(ServiceWorkerDevToolsAgentHost* host) override; |
70 void DebugOnStartUpdated(bool debug_on_start) override; | 70 void DebugOnStartUpdated(bool debug_on_start) override; |
71 | 71 |
72 private: | 72 private: |
73 // DevToolsAgentHostClient overrides. | 73 // DevToolsAgentHostClient overrides. |
74 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, | 74 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, |
75 const std::string& message) override; | 75 const std::string& message) override; |
76 void AgentHostClosed(DevToolsAgentHost* agent_host, | 76 void AgentHostClosed(DevToolsAgentHost* agent_host, |
77 bool replaced_with_another_client) override; | 77 bool replaced_with_another_client) override; |
78 | 78 |
79 void ReportWorkerCreated(ServiceWorkerDevToolsAgentHost* host); | 79 void ReportWorkerCreated(ServiceWorkerDevToolsAgentHost* host); |
80 void ReportWorkerTerminated(ServiceWorkerDevToolsAgentHost* host); | 80 void ReportWorkerTerminated(ServiceWorkerDevToolsAgentHost* host); |
81 | 81 |
82 void OnWorkerRegistrationUpdated( | 82 void OnWorkerRegistrationUpdated( |
83 const std::vector<ServiceWorkerRegistrationInfo>& registrations); | 83 const std::vector<ServiceWorkerRegistrationInfo>& registrations); |
84 void OnWorkerVersionUpdated( | 84 void OnWorkerVersionUpdated( |
85 const std::vector<ServiceWorkerVersionInfo>& registrations); | 85 const std::vector<ServiceWorkerVersionInfo>& registrations); |
86 void OnErrorReported(int64 registration_id, | 86 void OnErrorReported(int64 registration_id, |
87 int64 version_id, | 87 std::string version_uuid, |
88 const ServiceWorkerContextObserver::ErrorInfo& info); | 88 const ServiceWorkerContextObserver::ErrorInfo& info); |
89 | 89 |
90 void OpenNewDevToolsWindow(int process_id, int devtools_agent_route_id); | 90 void OpenNewDevToolsWindow(int process_id, int devtools_agent_route_id); |
91 | 91 |
92 scoped_refptr<ServiceWorkerContextWrapper> context_; | 92 scoped_refptr<ServiceWorkerContextWrapper> context_; |
93 scoped_ptr<Client> client_; | 93 scoped_ptr<Client> client_; |
94 ServiceWorkerDevToolsAgentHost::Map attached_hosts_; | 94 ServiceWorkerDevToolsAgentHost::Map attached_hosts_; |
95 bool enabled_; | 95 bool enabled_; |
96 std::set<GURL> urls_; | 96 std::set<GURL> urls_; |
97 scoped_refptr<ServiceWorkerContextWatcher> context_watcher_; | 97 scoped_refptr<ServiceWorkerContextWatcher> context_watcher_; |
98 RenderFrameHostImpl* render_frame_host_; | 98 RenderFrameHostImpl* render_frame_host_; |
99 | 99 |
100 base::WeakPtrFactory<ServiceWorkerHandler> weak_factory_; | 100 base::WeakPtrFactory<ServiceWorkerHandler> weak_factory_; |
101 | 101 |
102 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandler); | 102 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandler); |
103 }; | 103 }; |
104 | 104 |
105 } // namespace service_worker | 105 } // namespace service_worker |
106 } // namespace devtools | 106 } // namespace devtools |
107 } // namespace content | 107 } // namespace content |
108 | 108 |
109 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_ | 109 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_ |
OLD | NEW |