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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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); |
56 Response StartWorker(const std::string& scope_url); | 56 Response StartWorker(const std::string& scope_url); |
57 Response StopWorker(const std::string& version_id); | 57 Response StopWorker(const std::string& version_id); |
58 Response UpdateRegistration(const std::string& scope_url); | 58 Response UpdateRegistration(const std::string& scope_url); |
59 Response InspectWorker(const std::string& version_id); | 59 Response InspectWorker(const std::string& version_id); |
60 Response SetDebugOnStart(bool debug_on_start); | 60 Response SetForceUpdateOnPageLoad(bool force_update_on_page_load); |
61 Response SetForceUpdateOnPageLoad(const std::string& registration_id, | |
62 bool force_update_on_page_load); | |
63 Response DeliverPushMessage(const std::string& origin, | 61 Response DeliverPushMessage(const std::string& origin, |
64 const std::string& registration_id, | 62 const std::string& registration_id, |
65 const std::string& data); | 63 const std::string& data); |
66 Response GetTargetInfo(const std::string& target_id, | 64 Response GetTargetInfo(const std::string& target_id, |
67 scoped_refptr<TargetInfo>* target_info); | 65 scoped_refptr<TargetInfo>* target_info); |
68 Response ActivateTarget(const std::string& target_id); | 66 Response ActivateTarget(const std::string& target_id); |
69 | 67 |
70 // WorkerDevToolsManager::Observer implementation. | 68 // WorkerDevToolsManager::Observer implementation. |
71 void WorkerCreated(ServiceWorkerDevToolsAgentHost* host) override; | 69 void WorkerCreated(ServiceWorkerDevToolsAgentHost* host) override; |
72 void WorkerReadyForInspection(ServiceWorkerDevToolsAgentHost* host) override; | 70 void WorkerReadyForInspection(ServiceWorkerDevToolsAgentHost* host) override; |
73 void WorkerDestroyed(ServiceWorkerDevToolsAgentHost* host) override; | 71 void WorkerDestroyed(ServiceWorkerDevToolsAgentHost* host) override; |
74 void DebugOnStartUpdated(bool debug_on_start) override; | |
75 | 72 |
76 private: | 73 private: |
77 // DevToolsAgentHostClient overrides. | 74 // DevToolsAgentHostClient overrides. |
78 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, | 75 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, |
79 const std::string& message) override; | 76 const std::string& message) override; |
80 void AgentHostClosed(DevToolsAgentHost* agent_host, | 77 void AgentHostClosed(DevToolsAgentHost* agent_host, |
81 bool replaced_with_another_client) override; | 78 bool replaced_with_another_client) override; |
82 | 79 |
83 void ReportWorkerCreated(ServiceWorkerDevToolsAgentHost* host); | 80 void ReportWorkerCreated(ServiceWorkerDevToolsAgentHost* host); |
84 void ReportWorkerTerminated(ServiceWorkerDevToolsAgentHost* host); | 81 void ReportWorkerTerminated(ServiceWorkerDevToolsAgentHost* host); |
85 | 82 |
86 void OnWorkerRegistrationUpdated( | 83 void OnWorkerRegistrationUpdated( |
87 const std::vector<ServiceWorkerRegistrationInfo>& registrations); | 84 const std::vector<ServiceWorkerRegistrationInfo>& registrations); |
88 void OnWorkerVersionUpdated( | 85 void OnWorkerVersionUpdated( |
89 const std::vector<ServiceWorkerVersionInfo>& registrations); | 86 const std::vector<ServiceWorkerVersionInfo>& registrations); |
90 void OnErrorReported(int64_t registration_id, | 87 void OnErrorReported(int64_t registration_id, |
91 int64_t version_id, | 88 int64_t version_id, |
92 const ServiceWorkerContextObserver::ErrorInfo& info); | 89 const ServiceWorkerContextObserver::ErrorInfo& info); |
93 | 90 |
94 void OpenNewDevToolsWindow(int process_id, int devtools_agent_route_id); | 91 void OpenNewDevToolsWindow(int process_id, int devtools_agent_route_id); |
95 void ClearForceUpdate(); | 92 void ClearForceUpdate(); |
96 | 93 |
97 scoped_refptr<ServiceWorkerContextWrapper> context_; | 94 scoped_refptr<ServiceWorkerContextWrapper> context_; |
98 scoped_ptr<Client> client_; | 95 scoped_ptr<Client> client_; |
99 ServiceWorkerDevToolsAgentHost::Map attached_hosts_; | 96 ServiceWorkerDevToolsAgentHost::Map attached_hosts_; |
100 bool enabled_; | 97 bool enabled_; |
101 std::set<GURL> urls_; | 98 std::set<GURL> urls_; |
102 scoped_refptr<ServiceWorkerContextWatcher> context_watcher_; | 99 scoped_refptr<ServiceWorkerContextWatcher> context_watcher_; |
103 RenderFrameHostImpl* render_frame_host_; | 100 RenderFrameHostImpl* render_frame_host_; |
104 std::set<int> force_update_enabled_registrations_; | |
105 | 101 |
106 base::WeakPtrFactory<ServiceWorkerHandler> weak_factory_; | 102 base::WeakPtrFactory<ServiceWorkerHandler> weak_factory_; |
107 | 103 |
108 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandler); | 104 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandler); |
109 }; | 105 }; |
110 | 106 |
111 } // namespace service_worker | 107 } // namespace service_worker |
112 } // namespace devtools | 108 } // namespace devtools |
113 } // namespace content | 109 } // namespace content |
114 | 110 |
115 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_ | 111 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_SERVICE_WORKER_HANDLER_H_ |
OLD | NEW |