Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: content/child/service_worker/service_worker_dispatcher.h

Issue 63253002: Rename WebKit namespace to blink (part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/WebServiceWorkerProvider.h" 11 #include "third_party/WebKit/public/platform/WebServiceWorkerProvider.h"
12 #include "webkit/child/worker_task_runner.h" 12 #include "webkit/child/worker_task_runner.h"
13 13
14 class GURL; 14 class GURL;
15 15
16 namespace WebKit { 16 namespace blink {
17 class WebURL; 17 class WebURL;
18 } 18 }
19 19
20 namespace IPC { 20 namespace IPC {
21 class Message; 21 class Message;
22 } 22 }
23 23
24 namespace content { 24 namespace content {
25 class ServiceWorkerMessageFilter; 25 class ServiceWorkerMessageFilter;
26 class ThreadSafeSender; 26 class ThreadSafeSender;
27 class WebServiceWorkerImpl; 27 class WebServiceWorkerImpl;
28 28
29 // This class manages communication with the browser process about 29 // This class manages communication with the browser process about
30 // registration of the service worker, exposed to renderer and worker 30 // registration of the service worker, exposed to renderer and worker
31 // scripts through methods like navigator.registerServiceWorker(). 31 // scripts through methods like navigator.registerServiceWorker().
32 class ServiceWorkerDispatcher : public webkit_glue::WorkerTaskRunner::Observer { 32 class ServiceWorkerDispatcher : public webkit_glue::WorkerTaskRunner::Observer {
33 public: 33 public:
34 explicit ServiceWorkerDispatcher(ThreadSafeSender* thread_safe_sender); 34 explicit ServiceWorkerDispatcher(ThreadSafeSender* thread_safe_sender);
35 virtual ~ServiceWorkerDispatcher(); 35 virtual ~ServiceWorkerDispatcher();
36 36
37 void OnMessageReceived(const IPC::Message& msg); 37 void OnMessageReceived(const IPC::Message& msg);
38 bool Send(IPC::Message* msg); 38 bool Send(IPC::Message* msg);
39 39
40 // Corresponds to navigator.registerServiceWorker() 40 // Corresponds to navigator.registerServiceWorker()
41 void RegisterServiceWorker( 41 void RegisterServiceWorker(
42 const GURL& pattern, 42 const GURL& pattern,
43 const GURL& script_url, 43 const GURL& script_url,
44 WebKit::WebServiceWorkerProvider::WebServiceWorkerCallbacks* callbacks); 44 blink::WebServiceWorkerProvider::WebServiceWorkerCallbacks* callbacks);
45 // Corresponds to navigator.unregisterServiceWorker() 45 // Corresponds to navigator.unregisterServiceWorker()
46 void UnregisterServiceWorker( 46 void UnregisterServiceWorker(
47 const GURL& pattern, 47 const GURL& pattern,
48 WebKit::WebServiceWorkerProvider::WebServiceWorkerCallbacks* callbacks); 48 blink::WebServiceWorkerProvider::WebServiceWorkerCallbacks* callbacks);
49 49
50 // |thread_safe_sender| needs to be passed in because if the call leads to 50 // |thread_safe_sender| needs to be passed in because if the call leads to
51 // construction it will be needed. 51 // construction it will be needed.
52 static ServiceWorkerDispatcher* ThreadSpecificInstance( 52 static ServiceWorkerDispatcher* ThreadSpecificInstance(
53 ThreadSafeSender* thread_safe_sender); 53 ThreadSafeSender* thread_safe_sender);
54 54
55 private: 55 private:
56 // webkit_glue::WorkerTaskRunner::Observer implementation. 56 // webkit_glue::WorkerTaskRunner::Observer implementation.
57 virtual void OnWorkerRunLoopStopped() OVERRIDE; 57 virtual void OnWorkerRunLoopStopped() OVERRIDE;
58 58
59 // The asynchronous success response to RegisterServiceWorker. 59 // The asynchronous success response to RegisterServiceWorker.
60 void OnServiceWorkerRegistered(int32 thread_id, 60 void OnServiceWorkerRegistered(int32 thread_id,
61 int32 request_id, 61 int32 request_id,
62 int64 service_worker_id); 62 int64 service_worker_id);
63 // The asynchronous success response to UregisterServiceWorker. 63 // The asynchronous success response to UregisterServiceWorker.
64 void OnServiceWorkerUnregistered(int32 thread_id, int32 request_id); 64 void OnServiceWorkerUnregistered(int32 thread_id, int32 request_id);
65 65
66 IDMap<WebKit::WebServiceWorkerProvider::WebServiceWorkerCallbacks, 66 IDMap<blink::WebServiceWorkerProvider::WebServiceWorkerCallbacks,
67 IDMapOwnPointer> pending_callbacks_; 67 IDMapOwnPointer> pending_callbacks_;
68 68
69 scoped_refptr<ThreadSafeSender> thread_safe_sender_; 69 scoped_refptr<ThreadSafeSender> thread_safe_sender_;
70 70
71 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); 71 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher);
72 }; 72 };
73 73
74 } // namespace content 74 } // namespace content
75 75
76 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ 76 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_
OLDNEW
« no previous file with comments | « content/child/runtime_features.cc ('k') | content/child/service_worker/service_worker_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698