| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ | 5 #ifndef CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ |
| 6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ | 6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 void RegisterServiceWorker( | 55 void RegisterServiceWorker( |
| 56 int provider_id, | 56 int provider_id, |
| 57 const GURL& pattern, | 57 const GURL& pattern, |
| 58 const GURL& script_url, | 58 const GURL& script_url, |
| 59 WebServiceWorkerRegistrationCallbacks* callbacks); | 59 WebServiceWorkerRegistrationCallbacks* callbacks); |
| 60 // Corresponds to navigator.serviceWorker.unregister() | 60 // Corresponds to navigator.serviceWorker.unregister() |
| 61 void UnregisterServiceWorker( | 61 void UnregisterServiceWorker( |
| 62 int provider_id, | 62 int provider_id, |
| 63 const GURL& pattern, | 63 const GURL& pattern, |
| 64 WebServiceWorkerRegistrationCallbacks* callbacks); | 64 WebServiceWorkerRegistrationCallbacks* callbacks); |
| 65 // Corresponds to navigator.serviceWorker.getRegistration() |
| 66 void GetRegistration( |
| 67 int provider_id, |
| 68 const GURL& document_url, |
| 69 WebServiceWorkerRegistrationCallbacks* callbacks); |
| 65 | 70 |
| 66 // Called when a new provider context for a document is created. Usually | 71 // Called when a new provider context for a document is created. Usually |
| 67 // this happens when a new document is being loaded, and is called much | 72 // this happens when a new document is being loaded, and is called much |
| 68 // earlier than AddScriptClient. | 73 // earlier than AddScriptClient. |
| 69 // (This is attached only to the document thread's ServiceWorkerDispatcher) | 74 // (This is attached only to the document thread's ServiceWorkerDispatcher) |
| 70 void AddProviderContext(ServiceWorkerProviderContext* provider_context); | 75 void AddProviderContext(ServiceWorkerProviderContext* provider_context); |
| 71 void RemoveProviderContext(ServiceWorkerProviderContext* provider_context); | 76 void RemoveProviderContext(ServiceWorkerProviderContext* provider_context); |
| 72 | 77 |
| 73 // Called when navigator.serviceWorker is instantiated or detached | 78 // Called when navigator.serviceWorker is instantiated or detached |
| 74 // for a document whose provider can be identified by |provider_id|. | 79 // for a document whose provider can be identified by |provider_id|. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 131 |
| 127 // WorkerTaskRunner::Observer implementation. | 132 // WorkerTaskRunner::Observer implementation. |
| 128 virtual void OnWorkerRunLoopStopped() OVERRIDE; | 133 virtual void OnWorkerRunLoopStopped() OVERRIDE; |
| 129 | 134 |
| 130 void OnRegistered(int thread_id, | 135 void OnRegistered(int thread_id, |
| 131 int request_id, | 136 int request_id, |
| 132 const ServiceWorkerRegistrationObjectInfo& info, | 137 const ServiceWorkerRegistrationObjectInfo& info, |
| 133 const ServiceWorkerVersionAttributes& attrs); | 138 const ServiceWorkerVersionAttributes& attrs); |
| 134 void OnUnregistered(int thread_id, | 139 void OnUnregistered(int thread_id, |
| 135 int request_id); | 140 int request_id); |
| 141 void OnDidGetRegistration(int thread_id, |
| 142 int request_id, |
| 143 const ServiceWorkerRegistrationObjectInfo& info, |
| 144 const ServiceWorkerVersionAttributes& attrs); |
| 136 void OnRegistrationError(int thread_id, | 145 void OnRegistrationError(int thread_id, |
| 137 int request_id, | 146 int request_id, |
| 138 blink::WebServiceWorkerError::ErrorType error_type, | 147 blink::WebServiceWorkerError::ErrorType error_type, |
| 139 const base::string16& message); | 148 const base::string16& message); |
| 140 void OnServiceWorkerStateChanged(int thread_id, | 149 void OnServiceWorkerStateChanged(int thread_id, |
| 141 int handle_id, | 150 int handle_id, |
| 142 blink::WebServiceWorkerState state); | 151 blink::WebServiceWorkerState state); |
| 143 void OnSetVersionAttributes(int thread_id, | 152 void OnSetVersionAttributes(int thread_id, |
| 144 int provider_id, | 153 int provider_id, |
| 145 int registration_handle_id, | 154 int registration_handle_id, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 WorkerToProviderMap worker_to_provider_; | 200 WorkerToProviderMap worker_to_provider_; |
| 192 | 201 |
| 193 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 202 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 194 | 203 |
| 195 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); | 204 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); |
| 196 }; | 205 }; |
| 197 | 206 |
| 198 } // namespace content | 207 } // namespace content |
| 199 | 208 |
| 200 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ | 209 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ |
| OLD | NEW |