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 24 matching lines...) Expand all Loading... |
35 explicit ServiceWorkerDispatcher(ThreadSafeSender* thread_safe_sender); | 35 explicit ServiceWorkerDispatcher(ThreadSafeSender* thread_safe_sender); |
36 virtual ~ServiceWorkerDispatcher(); | 36 virtual ~ServiceWorkerDispatcher(); |
37 | 37 |
38 void OnMessageReceived(const IPC::Message& msg); | 38 void OnMessageReceived(const IPC::Message& msg); |
39 bool Send(IPC::Message* msg); | 39 bool Send(IPC::Message* msg); |
40 | 40 |
41 // Corresponds to navigator.registerServiceWorker() | 41 // Corresponds to navigator.registerServiceWorker() |
42 void RegisterServiceWorker( | 42 void RegisterServiceWorker( |
43 const GURL& pattern, | 43 const GURL& pattern, |
44 const GURL& script_url, | 44 const GURL& script_url, |
| 45 int provider_id, |
45 blink::WebServiceWorkerProvider::WebServiceWorkerCallbacks* callbacks); | 46 blink::WebServiceWorkerProvider::WebServiceWorkerCallbacks* callbacks); |
46 // Corresponds to navigator.unregisterServiceWorker() | 47 // Corresponds to navigator.unregisterServiceWorker() |
47 void UnregisterServiceWorker( | 48 void UnregisterServiceWorker( |
48 const GURL& pattern, | 49 const GURL& pattern, |
| 50 int provider_id, |
49 blink::WebServiceWorkerProvider::WebServiceWorkerCallbacks* callbacks); | 51 blink::WebServiceWorkerProvider::WebServiceWorkerCallbacks* callbacks); |
50 | 52 |
51 // |thread_safe_sender| needs to be passed in because if the call leads to | 53 // |thread_safe_sender| needs to be passed in because if the call leads to |
52 // construction it will be needed. | 54 // construction it will be needed. |
53 static ServiceWorkerDispatcher* ThreadSpecificInstance( | 55 static ServiceWorkerDispatcher* ThreadSpecificInstance( |
54 ThreadSafeSender* thread_safe_sender); | 56 ThreadSafeSender* thread_safe_sender); |
55 | 57 |
56 private: | 58 private: |
57 // webkit_glue::WorkerTaskRunner::Observer implementation. | 59 // webkit_glue::WorkerTaskRunner::Observer implementation. |
58 virtual void OnWorkerRunLoopStopped() OVERRIDE; | 60 virtual void OnWorkerRunLoopStopped() OVERRIDE; |
(...skipping 12 matching lines...) Expand all Loading... |
71 IDMapOwnPointer> pending_callbacks_; | 73 IDMapOwnPointer> pending_callbacks_; |
72 | 74 |
73 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 75 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
74 | 76 |
75 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); | 77 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); |
76 }; | 78 }; |
77 | 79 |
78 } // namespace content | 80 } // namespace content |
79 | 81 |
80 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ | 82 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ |
OLD | NEW |