| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 class ThreadSafeSender; | 59 class ThreadSafeSender; |
| 60 class WebServiceWorkerRegistrationImpl; | 60 class WebServiceWorkerRegistrationImpl; |
| 61 | 61 |
| 62 // This class provides access to/from an ServiceWorker's WorkerGlobalScope. | 62 // This class provides access to/from an ServiceWorker's WorkerGlobalScope. |
| 63 // Unless otherwise noted, all methods are called on the worker thread. | 63 // Unless otherwise noted, all methods are called on the worker thread. |
| 64 class ServiceWorkerContextClient | 64 class ServiceWorkerContextClient |
| 65 : public blink::WebServiceWorkerContextClient { | 65 : public blink::WebServiceWorkerContextClient { |
| 66 public: | 66 public: |
| 67 using SyncCallback = | 67 using SyncCallback = |
| 68 base::Callback<void(blink::mojom::ServiceWorkerEventStatus, | 68 base::Callback<void(blink::mojom::ServiceWorkerEventStatus, |
| 69 double /* dispatch_event_time */)>; | 69 base::Time /* dispatch_event_time */)>; |
| 70 | 70 |
| 71 // Returns a thread-specific client instance. This does NOT create a | 71 // Returns a thread-specific client instance. This does NOT create a |
| 72 // new instance. | 72 // new instance. |
| 73 static ServiceWorkerContextClient* ThreadSpecificInstance(); | 73 static ServiceWorkerContextClient* ThreadSpecificInstance(); |
| 74 | 74 |
| 75 // Called on the main thread. | 75 // Called on the main thread. |
| 76 ServiceWorkerContextClient(int embedded_worker_id, | 76 ServiceWorkerContextClient(int embedded_worker_id, |
| 77 int64_t service_worker_version_id, | 77 int64_t service_worker_version_id, |
| 78 const GURL& service_worker_scope, | 78 const GURL& service_worker_scope, |
| 79 const GURL& script_url, | 79 const GURL& script_url, |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 // Initialized on the worker thread in workerContextStarted and | 261 // Initialized on the worker thread in workerContextStarted and |
| 262 // destructed on the worker thread in willDestroyWorkerContext. | 262 // destructed on the worker thread in willDestroyWorkerContext. |
| 263 std::unique_ptr<WorkerContextData> context_; | 263 std::unique_ptr<WorkerContextData> context_; |
| 264 | 264 |
| 265 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); | 265 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextClient); |
| 266 }; | 266 }; |
| 267 | 267 |
| 268 } // namespace content | 268 } // namespace content |
| 269 | 269 |
| 270 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ | 270 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CLIENT_H_ |
| OLD | NEW |