| 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_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ | 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ |
| 6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ | 6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Unless otherwise noted, all methods are called on the worker thread. | 54 // Unless otherwise noted, all methods are called on the worker thread. |
| 55 class ServiceWorkerContextClient | 55 class ServiceWorkerContextClient |
| 56 : public blink::WebServiceWorkerContextClient { | 56 : public blink::WebServiceWorkerContextClient { |
| 57 public: | 57 public: |
| 58 // Returns a thread-specific client instance. This does NOT create a | 58 // Returns a thread-specific client instance. This does NOT create a |
| 59 // new instance. | 59 // new instance. |
| 60 static ServiceWorkerContextClient* ThreadSpecificInstance(); | 60 static ServiceWorkerContextClient* ThreadSpecificInstance(); |
| 61 | 61 |
| 62 // Called on the main thread. | 62 // Called on the main thread. |
| 63 ServiceWorkerContextClient(int embedded_worker_id, | 63 ServiceWorkerContextClient(int embedded_worker_id, |
| 64 int64 service_worker_version_id, | 64 std::string service_worker_version_uuid, |
| 65 const GURL& service_worker_scope, | 65 const GURL& service_worker_scope, |
| 66 const GURL& script_url, | 66 const GURL& script_url, |
| 67 int worker_devtools_agent_route_id); | 67 int worker_devtools_agent_route_id); |
| 68 ~ServiceWorkerContextClient() override; | 68 ~ServiceWorkerContextClient() override; |
| 69 | 69 |
| 70 void OnMessageReceived(int thread_id, | 70 void OnMessageReceived(int thread_id, |
| 71 int embedded_worker_id, | 71 int embedded_worker_id, |
| 72 const IPC::Message& message); | 72 const IPC::Message& message); |
| 73 | 73 |
| 74 // WebServiceWorkerContextClient overrides. | 74 // WebServiceWorkerContextClient overrides. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 void OnDidSkipWaiting(int request_id); | 191 void OnDidSkipWaiting(int request_id); |
| 192 void OnDidClaimClients(int request_id); | 192 void OnDidClaimClients(int request_id); |
| 193 void OnClaimClientsError(int request_id, | 193 void OnClaimClientsError(int request_id, |
| 194 blink::WebServiceWorkerError::ErrorType error_type, | 194 blink::WebServiceWorkerError::ErrorType error_type, |
| 195 const base::string16& message); | 195 const base::string16& message); |
| 196 void OnPing(); | 196 void OnPing(); |
| 197 | 197 |
| 198 base::WeakPtr<ServiceWorkerContextClient> GetWeakPtr(); | 198 base::WeakPtr<ServiceWorkerContextClient> GetWeakPtr(); |
| 199 | 199 |
| 200 const int embedded_worker_id_; | 200 const int embedded_worker_id_; |
| 201 const int64 service_worker_version_id_; | 201 const std::string service_worker_version_uuid_; |
| 202 const GURL service_worker_scope_; | 202 const GURL service_worker_scope_; |
| 203 const GURL script_url_; | 203 const GURL script_url_; |
| 204 const int worker_devtools_agent_route_id_; | 204 const int worker_devtools_agent_route_id_; |
| 205 scoped_refptr<ThreadSafeSender> sender_; | 205 scoped_refptr<ThreadSafeSender> sender_; |
| 206 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 206 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 207 scoped_refptr<base::TaskRunner> worker_task_runner_; | 207 scoped_refptr<base::TaskRunner> worker_task_runner_; |
| 208 | 208 |
| 209 scoped_refptr<ServiceWorkerProviderContext> provider_context_; | 209 scoped_refptr<ServiceWorkerProviderContext> provider_context_; |
| 210 | 210 |
| 211 // Not owned; this object is destroyed when proxy_ becomes invalid. | 211 // Not owned; this object is destroyed when proxy_ becomes invalid. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 226 std::map<int, base::TimeTicks> install_start_timings_; | 226 std::map<int, base::TimeTicks> install_start_timings_; |
| 227 std::map<int, base::TimeTicks> notification_click_start_timings_; | 227 std::map<int, base::TimeTicks> notification_click_start_timings_; |
| 228 std::map<int, base::TimeTicks> push_start_timings_; | 228 std::map<int, base::TimeTicks> push_start_timings_; |
| 229 | 229 |
| 230 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); | 230 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); |
| 231 }; | 231 }; |
| 232 | 232 |
| 233 } // namespace content | 233 } // namespace content |
| 234 | 234 |
| 235 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ | 235 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ |
| OLD | NEW |