| 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" |
| 11 #include "third_party/WebKit/public/platform/WebServiceWorkerError.h" |
| 11 #include "third_party/WebKit/public/platform/WebServiceWorkerProvider.h" | 12 #include "third_party/WebKit/public/platform/WebServiceWorkerProvider.h" |
| 12 #include "webkit/child/worker_task_runner.h" | 13 #include "webkit/child/worker_task_runner.h" |
| 13 | 14 |
| 14 class GURL; | 15 class GURL; |
| 15 | 16 |
| 16 namespace WebKit { | 17 namespace WebKit { |
| 17 class WebURL; | 18 class WebURL; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace IPC { | 21 namespace IPC { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 44 | 45 |
| 45 // |thread_safe_sender| needs to be passed in because if the call leads to | 46 // |thread_safe_sender| needs to be passed in because if the call leads to |
| 46 // construction it will be needed. | 47 // construction it will be needed. |
| 47 static ServiceWorkerDispatcher* ThreadSpecificInstance( | 48 static ServiceWorkerDispatcher* ThreadSpecificInstance( |
| 48 ThreadSafeSender* thread_safe_sender); | 49 ThreadSafeSender* thread_safe_sender); |
| 49 | 50 |
| 50 private: | 51 private: |
| 51 // webkit_glue::WorkerTaskRunner::Observer implementation. | 52 // webkit_glue::WorkerTaskRunner::Observer implementation. |
| 52 virtual void OnWorkerRunLoopStopped() OVERRIDE; | 53 virtual void OnWorkerRunLoopStopped() OVERRIDE; |
| 53 | 54 |
| 54 void OnServiceWorkerRegistered(int32 thread_id, | 55 void OnRegistered(int32 thread_id, int32 request_id, int64 service_worker_id); |
| 55 int32 request_id, | 56 void OnUnregistered(int32 thread_id, |
| 56 int64 service_worker_id); | 57 int32 request_id); |
| 57 void OnServiceWorkerUnregistered(int32 thread_id, | 58 void OnRegistrationError(int32 thread_id, |
| 58 int32 request_id); | 59 int32 request_id, |
| 60 WebKit::WebServiceWorkerError::ErrorType error_type, |
| 61 const string16& message); |
| 59 | 62 |
| 60 IDMap<WebKit::WebServiceWorkerProvider::WebServiceWorkerCallbacks, | 63 IDMap<WebKit::WebServiceWorkerProvider::WebServiceWorkerCallbacks, |
| 61 IDMapOwnPointer> pending_callbacks_; | 64 IDMapOwnPointer> pending_callbacks_; |
| 62 | 65 |
| 63 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 66 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 64 | 67 |
| 65 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); | 68 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); |
| 66 }; | 69 }; |
| 67 | 70 |
| 68 } // namespace content | 71 } // namespace content |
| 69 | 72 |
| 70 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ | 73 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ |
| OLD | NEW |