| 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 29 matching lines...) Expand all Loading... |
| 50 // |thread_safe_sender| needs to be passed in because if the call leads to | 51 // |thread_safe_sender| needs to be passed in because if the call leads to |
| 51 // construction it will be needed. | 52 // construction it will be needed. |
| 52 static ServiceWorkerDispatcher* ThreadSpecificInstance( | 53 static ServiceWorkerDispatcher* ThreadSpecificInstance( |
| 53 ThreadSafeSender* thread_safe_sender); | 54 ThreadSafeSender* thread_safe_sender); |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 // webkit_glue::WorkerTaskRunner::Observer implementation. | 57 // webkit_glue::WorkerTaskRunner::Observer implementation. |
| 57 virtual void OnWorkerRunLoopStopped() OVERRIDE; | 58 virtual void OnWorkerRunLoopStopped() OVERRIDE; |
| 58 | 59 |
| 59 // The asynchronous success response to RegisterServiceWorker. | 60 // The asynchronous success response to RegisterServiceWorker. |
| 60 void OnServiceWorkerRegistered(int32 thread_id, | 61 void OnRegistered(int32 thread_id, int32 request_id, int64 service_worker_id); |
| 61 int32 request_id, | |
| 62 int64 service_worker_id); | |
| 63 // The asynchronous success response to UregisterServiceWorker. | 62 // The asynchronous success response to UregisterServiceWorker. |
| 64 void OnServiceWorkerUnregistered(int32 thread_id, int32 request_id); | 63 void OnUnregistered(int32 thread_id, |
| 64 int32 request_id); |
| 65 void OnRegistrationError(int32 thread_id, |
| 66 int32 request_id, |
| 67 WebKit::WebServiceWorkerError::ErrorType error_type, |
| 68 const string16& message); |
| 65 | 69 |
| 66 IDMap<WebKit::WebServiceWorkerProvider::WebServiceWorkerCallbacks, | 70 IDMap<WebKit::WebServiceWorkerProvider::WebServiceWorkerCallbacks, |
| 67 IDMapOwnPointer> pending_callbacks_; | 71 IDMapOwnPointer> pending_callbacks_; |
| 68 | 72 |
| 69 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 73 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 70 | 74 |
| 71 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); | 75 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); |
| 72 }; | 76 }; |
| 73 | 77 |
| 74 } // namespace content | 78 } // namespace content |
| 75 | 79 |
| 76 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ | 80 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ |
| OLD | NEW |