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_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include "base/callback.h" | |
8 #include "base/id_map.h" | 9 #include "base/id_map.h" |
9 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
10 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
11 #include "content/browser/service_worker/service_worker_registration_status.h" | 12 #include "content/browser/service_worker/service_worker_registration_status.h" |
12 #include "content/public/browser/browser_message_filter.h" | 13 #include "content/public/browser/browser_message_filter.h" |
13 | 14 |
14 class GURL; | 15 class GURL; |
15 struct EmbeddedWorkerHostMsg_ReportConsoleMessage_Params; | 16 struct EmbeddedWorkerHostMsg_ReportConsoleMessage_Params; |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 | 19 |
19 class MessagePortMessageFilter; | 20 class MessagePortMessageFilter; |
20 class ServiceWorkerContextCore; | 21 class ServiceWorkerContextCore; |
21 class ServiceWorkerContextWrapper; | 22 class ServiceWorkerContextWrapper; |
22 class ServiceWorkerHandle; | 23 class ServiceWorkerHandle; |
23 class ServiceWorkerProviderHost; | 24 class ServiceWorkerProviderHost; |
24 class ServiceWorkerRegistration; | 25 class ServiceWorkerRegistration; |
25 | 26 |
26 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { | 27 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { |
27 public: | 28 public: |
28 ServiceWorkerDispatcherHost( | 29 ServiceWorkerDispatcherHost( |
29 int render_process_id, | 30 int render_process_id, |
30 MessagePortMessageFilter* message_port_message_filter); | 31 MessagePortMessageFilter* message_port_message_filter); |
31 | 32 |
32 void Init(ServiceWorkerContextWrapper* context_wrapper); | 33 void Init(ServiceWorkerContextWrapper* context_wrapper, |
34 const base::Callback<int(void)>& next_routing_id_callback); | |
kinuko
2014/04/25 13:56:57
The new parameter needs a descriptive comment.
michaeln
2014/04/25 19:29:50
descriptive name would be even better
| |
33 | 35 |
34 // BrowserIOMessageFilter implementation | 36 // BrowserIOMessageFilter implementation |
35 virtual void OnDestruct() const OVERRIDE; | 37 virtual void OnDestruct() const OVERRIDE; |
36 virtual bool OnMessageReceived(const IPC::Message& message, | 38 virtual bool OnMessageReceived(const IPC::Message& message, |
37 bool* message_was_ok) OVERRIDE; | 39 bool* message_was_ok) OVERRIDE; |
38 | 40 |
39 void RegisterServiceWorkerHandle(scoped_ptr<ServiceWorkerHandle> handle); | 41 void RegisterServiceWorkerHandle(scoped_ptr<ServiceWorkerHandle> handle); |
40 | 42 |
41 protected: | 43 protected: |
42 virtual ~ServiceWorkerDispatcherHost(); | 44 virtual ~ServiceWorkerDispatcherHost(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 base::WeakPtr<ServiceWorkerContextCore> context_; | 99 base::WeakPtr<ServiceWorkerContextCore> context_; |
98 | 100 |
99 IDMap<ServiceWorkerHandle, IDMapOwnPointer> handles_; | 101 IDMap<ServiceWorkerHandle, IDMapOwnPointer> handles_; |
100 | 102 |
101 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); | 103 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); |
102 }; | 104 }; |
103 | 105 |
104 } // namespace content | 106 } // namespace content |
105 | 107 |
106 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 108 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
OLD | NEW |