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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 class ChildSharedBitmapManager; | 54 class ChildSharedBitmapManager; |
55 class FileSystemDispatcher; | 55 class FileSystemDispatcher; |
56 class InProcessChildThreadParams; | 56 class InProcessChildThreadParams; |
57 class NotificationDispatcher; | 57 class NotificationDispatcher; |
58 class PushDispatcher; | 58 class PushDispatcher; |
59 class ServiceWorkerMessageFilter; | 59 class ServiceWorkerMessageFilter; |
60 class QuotaDispatcher; | 60 class QuotaDispatcher; |
61 class QuotaMessageFilter; | 61 class QuotaMessageFilter; |
62 class ResourceDispatcher; | 62 class ResourceDispatcher; |
63 class ThreadSafeSender; | 63 class ThreadSafeSender; |
64 class WebSocketDispatcher; | |
65 class WebSocketMessageFilter; | |
66 struct RequestInfo; | 64 struct RequestInfo; |
67 | 65 |
68 // The main thread of a child process derives from this class. | 66 // The main thread of a child process derives from this class. |
69 class CONTENT_EXPORT ChildThreadImpl | 67 class CONTENT_EXPORT ChildThreadImpl |
70 : public IPC::Listener, | 68 : public IPC::Listener, |
71 virtual public ChildThread { | 69 virtual public ChildThread { |
72 public: | 70 public: |
73 struct CONTENT_EXPORT Options; | 71 struct CONTENT_EXPORT Options; |
74 | 72 |
75 // Creates the thread. | 73 // Creates the thread. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 124 |
127 ChildDiscardableSharedMemoryManager* discardable_shared_memory_manager() | 125 ChildDiscardableSharedMemoryManager* discardable_shared_memory_manager() |
128 const { | 126 const { |
129 return discardable_shared_memory_manager_.get(); | 127 return discardable_shared_memory_manager_.get(); |
130 } | 128 } |
131 | 129 |
132 ResourceDispatcher* resource_dispatcher() const { | 130 ResourceDispatcher* resource_dispatcher() const { |
133 return resource_dispatcher_.get(); | 131 return resource_dispatcher_.get(); |
134 } | 132 } |
135 | 133 |
136 WebSocketDispatcher* websocket_dispatcher() const { | |
137 return websocket_dispatcher_.get(); | |
138 } | |
139 | |
140 FileSystemDispatcher* file_system_dispatcher() const { | 134 FileSystemDispatcher* file_system_dispatcher() const { |
141 return file_system_dispatcher_.get(); | 135 return file_system_dispatcher_.get(); |
142 } | 136 } |
143 | 137 |
144 QuotaDispatcher* quota_dispatcher() const { | 138 QuotaDispatcher* quota_dispatcher() const { |
145 return quota_dispatcher_.get(); | 139 return quota_dispatcher_.get(); |
146 } | 140 } |
147 | 141 |
148 NotificationDispatcher* notification_dispatcher() const { | 142 NotificationDispatcher* notification_dispatcher() const { |
149 return notification_dispatcher_.get(); | 143 return notification_dispatcher_.get(); |
(...skipping 23 matching lines...) Expand all Loading... |
173 } | 167 } |
174 | 168 |
175 QuotaMessageFilter* quota_message_filter() const { | 169 QuotaMessageFilter* quota_message_filter() const { |
176 return quota_message_filter_.get(); | 170 return quota_message_filter_.get(); |
177 } | 171 } |
178 | 172 |
179 ChildResourceMessageFilter* child_resource_message_filter() const { | 173 ChildResourceMessageFilter* child_resource_message_filter() const { |
180 return resource_message_filter_.get(); | 174 return resource_message_filter_.get(); |
181 } | 175 } |
182 | 176 |
183 WebSocketMessageFilter* websocket_message_filter() const { | |
184 return websocket_message_filter_.get(); | |
185 } | |
186 | |
187 base::MessageLoop* message_loop() const { return message_loop_; } | 177 base::MessageLoop* message_loop() const { return message_loop_; } |
188 | 178 |
189 // Returns the one child thread. Can only be called on the main thread. | 179 // Returns the one child thread. Can only be called on the main thread. |
190 static ChildThreadImpl* current(); | 180 static ChildThreadImpl* current(); |
191 | 181 |
192 #if defined(OS_ANDROID) | 182 #if defined(OS_ANDROID) |
193 // Called on Android's service thread to shutdown the main thread of this | 183 // Called on Android's service thread to shutdown the main thread of this |
194 // process. | 184 // process. |
195 static void ShutdownThread(); | 185 static void ShutdownThread(); |
196 #endif | 186 #endif |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 249 |
260 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 250 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
261 | 251 |
262 // Implements message routing functionality to the consumers of | 252 // Implements message routing functionality to the consumers of |
263 // ChildThreadImpl. | 253 // ChildThreadImpl. |
264 ChildThreadMessageRouter router_; | 254 ChildThreadMessageRouter router_; |
265 | 255 |
266 // Handles resource loads for this process. | 256 // Handles resource loads for this process. |
267 std::unique_ptr<ResourceDispatcher> resource_dispatcher_; | 257 std::unique_ptr<ResourceDispatcher> resource_dispatcher_; |
268 | 258 |
269 std::unique_ptr<WebSocketDispatcher> websocket_dispatcher_; | |
270 | |
271 // The OnChannelError() callback was invoked - the channel is dead, don't | 259 // The OnChannelError() callback was invoked - the channel is dead, don't |
272 // attempt to communicate. | 260 // attempt to communicate. |
273 bool on_channel_error_called_; | 261 bool on_channel_error_called_; |
274 | 262 |
275 base::MessageLoop* message_loop_; | 263 base::MessageLoop* message_loop_; |
276 | 264 |
277 std::unique_ptr<FileSystemDispatcher> file_system_dispatcher_; | 265 std::unique_ptr<FileSystemDispatcher> file_system_dispatcher_; |
278 | 266 |
279 std::unique_ptr<QuotaDispatcher> quota_dispatcher_; | 267 std::unique_ptr<QuotaDispatcher> quota_dispatcher_; |
280 | 268 |
281 scoped_refptr<ChildHistogramMessageFilter> histogram_message_filter_; | 269 scoped_refptr<ChildHistogramMessageFilter> histogram_message_filter_; |
282 | 270 |
283 scoped_refptr<ChildResourceMessageFilter> resource_message_filter_; | 271 scoped_refptr<ChildResourceMessageFilter> resource_message_filter_; |
284 | 272 |
285 scoped_refptr<ServiceWorkerMessageFilter> service_worker_message_filter_; | 273 scoped_refptr<ServiceWorkerMessageFilter> service_worker_message_filter_; |
286 | 274 |
287 scoped_refptr<QuotaMessageFilter> quota_message_filter_; | 275 scoped_refptr<QuotaMessageFilter> quota_message_filter_; |
288 | 276 |
289 scoped_refptr<WebSocketMessageFilter> websocket_message_filter_; | |
290 | |
291 scoped_refptr<NotificationDispatcher> notification_dispatcher_; | 277 scoped_refptr<NotificationDispatcher> notification_dispatcher_; |
292 | 278 |
293 scoped_refptr<PushDispatcher> push_dispatcher_; | 279 scoped_refptr<PushDispatcher> push_dispatcher_; |
294 | 280 |
295 std::unique_ptr<ChildSharedBitmapManager> shared_bitmap_manager_; | 281 std::unique_ptr<ChildSharedBitmapManager> shared_bitmap_manager_; |
296 | 282 |
297 std::unique_ptr<ChildGpuMemoryBufferManager> gpu_memory_buffer_manager_; | 283 std::unique_ptr<ChildGpuMemoryBufferManager> gpu_memory_buffer_manager_; |
298 | 284 |
299 std::unique_ptr<ChildDiscardableSharedMemoryManager> | 285 std::unique_ptr<ChildDiscardableSharedMemoryManager> |
300 discardable_shared_memory_manager_; | 286 discardable_shared_memory_manager_; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 | 324 |
339 private: | 325 private: |
340 struct Options options_; | 326 struct Options options_; |
341 | 327 |
342 DISALLOW_COPY_AND_ASSIGN(Builder); | 328 DISALLOW_COPY_AND_ASSIGN(Builder); |
343 }; | 329 }; |
344 | 330 |
345 } // namespace content | 331 } // namespace content |
346 | 332 |
347 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 333 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
OLD | NEW |