| 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 "base/id_map.h" | 8 #include "base/id_map.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 // |thread_safe_sender| needs to be passed in because if the call leads to | 47 // |thread_safe_sender| needs to be passed in because if the call leads to |
| 48 // construction it will be needed. | 48 // construction it will be needed. |
| 49 static ServiceWorkerDispatcher* ThreadSpecificInstance( | 49 static ServiceWorkerDispatcher* ThreadSpecificInstance( |
| 50 ThreadSafeSender* thread_safe_sender); | 50 ThreadSafeSender* thread_safe_sender); |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 // webkit_glue::WorkerTaskRunner::Observer implementation. | 53 // webkit_glue::WorkerTaskRunner::Observer implementation. |
| 54 virtual void OnWorkerRunLoopStopped() OVERRIDE; | 54 virtual void OnWorkerRunLoopStopped() OVERRIDE; |
| 55 | 55 |
| 56 void OnServiceWorkerRegistered(int32 thread_id, | 56 void OnRegistered(int32 thread_id, int32 request_id, int32 service_worker_id); |
| 57 int32 request_id, | 57 void OnUnregistered(int32 thread_id, |
| 58 int32 service_worker_id); | 58 int32 request_id, |
| 59 void OnServiceWorkerUnregistered(int32 thread_id, | 59 int32 service_worker_id); |
| 60 int32 request_id, | 60 void OnRegistrationError(int32 thread_id, int32 request_id); |
| 61 int32 service_worker_id); | |
| 62 | 61 |
| 63 IDMap<WebKit::WebServiceWorkerProvider::WebServiceWorkerCallbacks, | 62 IDMap<WebKit::WebServiceWorkerProvider::WebServiceWorkerCallbacks, |
| 64 IDMapOwnPointer> pending_callbacks_; | 63 IDMapOwnPointer> pending_callbacks_; |
| 65 | 64 |
| 66 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 65 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 67 | 66 |
| 68 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); | 67 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); |
| 69 }; | 68 }; |
| 70 | 69 |
| 71 } // namespace content | 70 } // namespace content |
| 72 | 71 |
| 73 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ | 72 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ |
| OLD | NEW |