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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { | 31 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { |
32 public: | 32 public: |
33 ServiceWorkerDispatcherHost( | 33 ServiceWorkerDispatcherHost( |
34 int render_process_id, | 34 int render_process_id, |
35 MessagePortMessageFilter* message_port_message_filter); | 35 MessagePortMessageFilter* message_port_message_filter); |
36 | 36 |
37 void Init(ServiceWorkerContextWrapper* context_wrapper); | 37 void Init(ServiceWorkerContextWrapper* context_wrapper); |
38 | 38 |
39 // BrowserMessageFilter implementation | 39 // BrowserMessageFilter implementation |
40 virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; | 40 virtual void OnFilterAdded(IPC::Sender* sender) override; |
41 virtual void OnDestruct() const OVERRIDE; | 41 virtual void OnDestruct() const override; |
42 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 42 virtual bool OnMessageReceived(const IPC::Message& message) override; |
43 | 43 |
44 // IPC::Sender implementation | 44 // IPC::Sender implementation |
45 | 45 |
46 // Send() queues the message until the underlying sender is ready. This | 46 // Send() queues the message until the underlying sender is ready. This |
47 // class assumes that Send() can only fail after that when the renderer | 47 // class assumes that Send() can only fail after that when the renderer |
48 // process has terminated, at which point the whole instance will eventually | 48 // process has terminated, at which point the whole instance will eventually |
49 // be destroyed. | 49 // be destroyed. |
50 virtual bool Send(IPC::Message* message) OVERRIDE; | 50 virtual bool Send(IPC::Message* message) override; |
51 | 51 |
52 // Returns the existing registration handle whose reference count is | 52 // Returns the existing registration handle whose reference count is |
53 // incremented or newly created one if it doesn't exist. | 53 // incremented or newly created one if it doesn't exist. |
54 ServiceWorkerRegistrationHandle* GetOrCreateRegistrationHandle( | 54 ServiceWorkerRegistrationHandle* GetOrCreateRegistrationHandle( |
55 int provider_id, | 55 int provider_id, |
56 ServiceWorkerRegistration* registration); | 56 ServiceWorkerRegistration* registration); |
57 | 57 |
58 void RegisterServiceWorkerHandle(scoped_ptr<ServiceWorkerHandle> handle); | 58 void RegisterServiceWorkerHandle(scoped_ptr<ServiceWorkerHandle> handle); |
59 void RegisterServiceWorkerRegistrationHandle( | 59 void RegisterServiceWorkerRegistrationHandle( |
60 scoped_ptr<ServiceWorkerRegistrationHandle> handle); | 60 scoped_ptr<ServiceWorkerRegistrationHandle> handle); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 165 |
166 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. | 166 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. |
167 ScopedVector<IPC::Message> pending_messages_; | 167 ScopedVector<IPC::Message> pending_messages_; |
168 | 168 |
169 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); | 169 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); |
170 }; | 170 }; |
171 | 171 |
172 } // namespace content | 172 } // namespace content |
173 | 173 |
174 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 174 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
OLD | NEW |