OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHILD_THREAD_IMPL_H_ | 5 #ifndef CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
6 #define CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 6 #define CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 class ChildSharedBitmapManager; | 53 class ChildSharedBitmapManager; |
54 class FileSystemDispatcher; | 54 class FileSystemDispatcher; |
55 class InProcessChildThreadParams; | 55 class InProcessChildThreadParams; |
56 class NotificationDispatcher; | 56 class NotificationDispatcher; |
57 class PushDispatcher; | 57 class PushDispatcher; |
58 class ServiceWorkerMessageFilter; | 58 class ServiceWorkerMessageFilter; |
59 class QuotaDispatcher; | 59 class QuotaDispatcher; |
60 class QuotaMessageFilter; | 60 class QuotaMessageFilter; |
61 class ResourceDispatcher; | 61 class ResourceDispatcher; |
62 class ThreadSafeSender; | 62 class ThreadSafeSender; |
63 class WebSocketDispatcher; | |
64 class WebSocketMessageFilter; | |
65 struct RequestInfo; | 63 struct RequestInfo; |
66 | 64 |
67 // The main thread of a child process derives from this class. | 65 // The main thread of a child process derives from this class. |
68 class CONTENT_EXPORT ChildThreadImpl | 66 class CONTENT_EXPORT ChildThreadImpl |
69 : public IPC::Listener, | 67 : public IPC::Listener, |
70 virtual public ChildThread { | 68 virtual public ChildThread { |
71 public: | 69 public: |
72 struct CONTENT_EXPORT Options; | 70 struct CONTENT_EXPORT Options; |
73 | 71 |
74 // Creates the thread. | 72 // Creates the thread. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 126 |
129 ChildDiscardableSharedMemoryManager* discardable_shared_memory_manager() | 127 ChildDiscardableSharedMemoryManager* discardable_shared_memory_manager() |
130 const { | 128 const { |
131 return discardable_shared_memory_manager_.get(); | 129 return discardable_shared_memory_manager_.get(); |
132 } | 130 } |
133 | 131 |
134 ResourceDispatcher* resource_dispatcher() const { | 132 ResourceDispatcher* resource_dispatcher() const { |
135 return resource_dispatcher_.get(); | 133 return resource_dispatcher_.get(); |
136 } | 134 } |
137 | 135 |
138 WebSocketDispatcher* websocket_dispatcher() const { | |
139 return websocket_dispatcher_.get(); | |
140 } | |
141 | |
142 FileSystemDispatcher* file_system_dispatcher() const { | 136 FileSystemDispatcher* file_system_dispatcher() const { |
143 return file_system_dispatcher_.get(); | 137 return file_system_dispatcher_.get(); |
144 } | 138 } |
145 | 139 |
146 QuotaDispatcher* quota_dispatcher() const { | 140 QuotaDispatcher* quota_dispatcher() const { |
147 return quota_dispatcher_.get(); | 141 return quota_dispatcher_.get(); |
148 } | 142 } |
149 | 143 |
150 NotificationDispatcher* notification_dispatcher() const { | 144 NotificationDispatcher* notification_dispatcher() const { |
151 return notification_dispatcher_.get(); | 145 return notification_dispatcher_.get(); |
(...skipping 23 matching lines...) Expand all Loading... |
175 } | 169 } |
176 | 170 |
177 QuotaMessageFilter* quota_message_filter() const { | 171 QuotaMessageFilter* quota_message_filter() const { |
178 return quota_message_filter_.get(); | 172 return quota_message_filter_.get(); |
179 } | 173 } |
180 | 174 |
181 ChildResourceMessageFilter* child_resource_message_filter() const { | 175 ChildResourceMessageFilter* child_resource_message_filter() const { |
182 return resource_message_filter_.get(); | 176 return resource_message_filter_.get(); |
183 } | 177 } |
184 | 178 |
185 WebSocketMessageFilter* websocket_message_filter() const { | |
186 return websocket_message_filter_.get(); | |
187 } | |
188 | |
189 base::MessageLoop* message_loop() const { return message_loop_; } | 179 base::MessageLoop* message_loop() const { return message_loop_; } |
190 | 180 |
191 // Returns the one child thread. Can only be called on the main thread. | 181 // Returns the one child thread. Can only be called on the main thread. |
192 static ChildThreadImpl* current(); | 182 static ChildThreadImpl* current(); |
193 | 183 |
194 #if defined(OS_ANDROID) | 184 #if defined(OS_ANDROID) |
195 // Called on Android's service thread to shutdown the main thread of this | 185 // Called on Android's service thread to shutdown the main thread of this |
196 // process. | 186 // process. |
197 static void ShutdownThread(); | 187 static void ShutdownThread(); |
198 #endif | 188 #endif |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 254 |
265 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 255 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
266 | 256 |
267 // Implements message routing functionality to the consumers of | 257 // Implements message routing functionality to the consumers of |
268 // ChildThreadImpl. | 258 // ChildThreadImpl. |
269 ChildThreadMessageRouter router_; | 259 ChildThreadMessageRouter router_; |
270 | 260 |
271 // Handles resource loads for this process. | 261 // Handles resource loads for this process. |
272 std::unique_ptr<ResourceDispatcher> resource_dispatcher_; | 262 std::unique_ptr<ResourceDispatcher> resource_dispatcher_; |
273 | 263 |
274 std::unique_ptr<WebSocketDispatcher> websocket_dispatcher_; | |
275 | |
276 // The OnChannelError() callback was invoked - the channel is dead, don't | 264 // The OnChannelError() callback was invoked - the channel is dead, don't |
277 // attempt to communicate. | 265 // attempt to communicate. |
278 bool on_channel_error_called_; | 266 bool on_channel_error_called_; |
279 | 267 |
280 base::MessageLoop* message_loop_; | 268 base::MessageLoop* message_loop_; |
281 | 269 |
282 std::unique_ptr<FileSystemDispatcher> file_system_dispatcher_; | 270 std::unique_ptr<FileSystemDispatcher> file_system_dispatcher_; |
283 | 271 |
284 std::unique_ptr<QuotaDispatcher> quota_dispatcher_; | 272 std::unique_ptr<QuotaDispatcher> quota_dispatcher_; |
285 | 273 |
286 scoped_refptr<ChildHistogramMessageFilter> histogram_message_filter_; | 274 scoped_refptr<ChildHistogramMessageFilter> histogram_message_filter_; |
287 | 275 |
288 scoped_refptr<ChildResourceMessageFilter> resource_message_filter_; | 276 scoped_refptr<ChildResourceMessageFilter> resource_message_filter_; |
289 | 277 |
290 scoped_refptr<ServiceWorkerMessageFilter> service_worker_message_filter_; | 278 scoped_refptr<ServiceWorkerMessageFilter> service_worker_message_filter_; |
291 | 279 |
292 scoped_refptr<QuotaMessageFilter> quota_message_filter_; | 280 scoped_refptr<QuotaMessageFilter> quota_message_filter_; |
293 | 281 |
294 scoped_refptr<WebSocketMessageFilter> websocket_message_filter_; | |
295 | |
296 scoped_refptr<NotificationDispatcher> notification_dispatcher_; | 282 scoped_refptr<NotificationDispatcher> notification_dispatcher_; |
297 | 283 |
298 scoped_refptr<PushDispatcher> push_dispatcher_; | 284 scoped_refptr<PushDispatcher> push_dispatcher_; |
299 | 285 |
300 std::unique_ptr<ChildSharedBitmapManager> shared_bitmap_manager_; | 286 std::unique_ptr<ChildSharedBitmapManager> shared_bitmap_manager_; |
301 | 287 |
302 std::unique_ptr<ChildGpuMemoryBufferManager> gpu_memory_buffer_manager_; | 288 std::unique_ptr<ChildGpuMemoryBufferManager> gpu_memory_buffer_manager_; |
303 | 289 |
304 std::unique_ptr<ChildDiscardableSharedMemoryManager> | 290 std::unique_ptr<ChildDiscardableSharedMemoryManager> |
305 discardable_shared_memory_manager_; | 291 discardable_shared_memory_manager_; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 | 334 |
349 private: | 335 private: |
350 struct Options options_; | 336 struct Options options_; |
351 | 337 |
352 DISALLOW_COPY_AND_ASSIGN(Builder); | 338 DISALLOW_COPY_AND_ASSIGN(Builder); |
353 }; | 339 }; |
354 | 340 |
355 } // namespace content | 341 } // namespace content |
356 | 342 |
357 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 343 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
OLD | NEW |