| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 class ChildSharedBitmapManager; | 57 class ChildSharedBitmapManager; |
| 58 class FileSystemDispatcher; | 58 class FileSystemDispatcher; |
| 59 class InProcessChildThreadParams; | 59 class InProcessChildThreadParams; |
| 60 class NotificationDispatcher; | 60 class NotificationDispatcher; |
| 61 class PushDispatcher; | 61 class PushDispatcher; |
| 62 class ServiceWorkerMessageFilter; | 62 class ServiceWorkerMessageFilter; |
| 63 class QuotaDispatcher; | 63 class QuotaDispatcher; |
| 64 class QuotaMessageFilter; | 64 class QuotaMessageFilter; |
| 65 class ResourceDispatcher; | 65 class ResourceDispatcher; |
| 66 class ThreadSafeSender; | 66 class ThreadSafeSender; |
| 67 class WebSocketDispatcher; | |
| 68 class WebSocketMessageFilter; | |
| 69 struct RequestInfo; | 67 struct RequestInfo; |
| 70 | 68 |
| 71 // The main thread of a child process derives from this class. | 69 // The main thread of a child process derives from this class. |
| 72 class CONTENT_EXPORT ChildThreadImpl | 70 class CONTENT_EXPORT ChildThreadImpl |
| 73 : public IPC::Listener, | 71 : public IPC::Listener, |
| 74 virtual public ChildThread { | 72 virtual public ChildThread { |
| 75 public: | 73 public: |
| 76 struct CONTENT_EXPORT Options; | 74 struct CONTENT_EXPORT Options; |
| 77 | 75 |
| 78 // Creates the thread. | 76 // Creates the thread. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 130 |
| 133 ChildDiscardableSharedMemoryManager* discardable_shared_memory_manager() | 131 ChildDiscardableSharedMemoryManager* discardable_shared_memory_manager() |
| 134 const { | 132 const { |
| 135 return discardable_shared_memory_manager_.get(); | 133 return discardable_shared_memory_manager_.get(); |
| 136 } | 134 } |
| 137 | 135 |
| 138 ResourceDispatcher* resource_dispatcher() const { | 136 ResourceDispatcher* resource_dispatcher() const { |
| 139 return resource_dispatcher_.get(); | 137 return resource_dispatcher_.get(); |
| 140 } | 138 } |
| 141 | 139 |
| 142 WebSocketDispatcher* websocket_dispatcher() const { | |
| 143 return websocket_dispatcher_.get(); | |
| 144 } | |
| 145 | |
| 146 FileSystemDispatcher* file_system_dispatcher() const { | 140 FileSystemDispatcher* file_system_dispatcher() const { |
| 147 return file_system_dispatcher_.get(); | 141 return file_system_dispatcher_.get(); |
| 148 } | 142 } |
| 149 | 143 |
| 150 QuotaDispatcher* quota_dispatcher() const { | 144 QuotaDispatcher* quota_dispatcher() const { |
| 151 return quota_dispatcher_.get(); | 145 return quota_dispatcher_.get(); |
| 152 } | 146 } |
| 153 | 147 |
| 154 NotificationDispatcher* notification_dispatcher() const { | 148 NotificationDispatcher* notification_dispatcher() const { |
| 155 return notification_dispatcher_.get(); | 149 return notification_dispatcher_.get(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 179 } | 173 } |
| 180 | 174 |
| 181 QuotaMessageFilter* quota_message_filter() const { | 175 QuotaMessageFilter* quota_message_filter() const { |
| 182 return quota_message_filter_.get(); | 176 return quota_message_filter_.get(); |
| 183 } | 177 } |
| 184 | 178 |
| 185 ChildResourceMessageFilter* child_resource_message_filter() const { | 179 ChildResourceMessageFilter* child_resource_message_filter() const { |
| 186 return resource_message_filter_.get(); | 180 return resource_message_filter_.get(); |
| 187 } | 181 } |
| 188 | 182 |
| 189 WebSocketMessageFilter* websocket_message_filter() const { | |
| 190 return websocket_message_filter_.get(); | |
| 191 } | |
| 192 | |
| 193 base::MessageLoop* message_loop() const { return message_loop_; } | 183 base::MessageLoop* message_loop() const { return message_loop_; } |
| 194 | 184 |
| 195 // Returns the one child thread. Can only be called on the main thread. | 185 // Returns the one child thread. Can only be called on the main thread. |
| 196 static ChildThreadImpl* current(); | 186 static ChildThreadImpl* current(); |
| 197 | 187 |
| 198 #if defined(OS_ANDROID) | 188 #if defined(OS_ANDROID) |
| 199 // Called on Android's service thread to shutdown the main thread of this | 189 // Called on Android's service thread to shutdown the main thread of this |
| 200 // process. | 190 // process. |
| 201 static void ShutdownThread(); | 191 static void ShutdownThread(); |
| 202 #endif | 192 #endif |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 | 259 |
| 270 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 260 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 271 | 261 |
| 272 // Implements message routing functionality to the consumers of | 262 // Implements message routing functionality to the consumers of |
| 273 // ChildThreadImpl. | 263 // ChildThreadImpl. |
| 274 ChildThreadMessageRouter router_; | 264 ChildThreadMessageRouter router_; |
| 275 | 265 |
| 276 // Handles resource loads for this process. | 266 // Handles resource loads for this process. |
| 277 std::unique_ptr<ResourceDispatcher> resource_dispatcher_; | 267 std::unique_ptr<ResourceDispatcher> resource_dispatcher_; |
| 278 | 268 |
| 279 std::unique_ptr<WebSocketDispatcher> websocket_dispatcher_; | |
| 280 | |
| 281 // The OnChannelError() callback was invoked - the channel is dead, don't | 269 // The OnChannelError() callback was invoked - the channel is dead, don't |
| 282 // attempt to communicate. | 270 // attempt to communicate. |
| 283 bool on_channel_error_called_; | 271 bool on_channel_error_called_; |
| 284 | 272 |
| 285 base::MessageLoop* message_loop_; | 273 base::MessageLoop* message_loop_; |
| 286 | 274 |
| 287 std::unique_ptr<FileSystemDispatcher> file_system_dispatcher_; | 275 std::unique_ptr<FileSystemDispatcher> file_system_dispatcher_; |
| 288 | 276 |
| 289 std::unique_ptr<QuotaDispatcher> quota_dispatcher_; | 277 std::unique_ptr<QuotaDispatcher> quota_dispatcher_; |
| 290 | 278 |
| 291 scoped_refptr<ChildHistogramMessageFilter> histogram_message_filter_; | 279 scoped_refptr<ChildHistogramMessageFilter> histogram_message_filter_; |
| 292 | 280 |
| 293 scoped_refptr<ChildResourceMessageFilter> resource_message_filter_; | 281 scoped_refptr<ChildResourceMessageFilter> resource_message_filter_; |
| 294 | 282 |
| 295 scoped_refptr<ServiceWorkerMessageFilter> service_worker_message_filter_; | 283 scoped_refptr<ServiceWorkerMessageFilter> service_worker_message_filter_; |
| 296 | 284 |
| 297 scoped_refptr<QuotaMessageFilter> quota_message_filter_; | 285 scoped_refptr<QuotaMessageFilter> quota_message_filter_; |
| 298 | 286 |
| 299 scoped_refptr<WebSocketMessageFilter> websocket_message_filter_; | |
| 300 | |
| 301 scoped_refptr<NotificationDispatcher> notification_dispatcher_; | 287 scoped_refptr<NotificationDispatcher> notification_dispatcher_; |
| 302 | 288 |
| 303 scoped_refptr<PushDispatcher> push_dispatcher_; | 289 scoped_refptr<PushDispatcher> push_dispatcher_; |
| 304 | 290 |
| 305 std::unique_ptr<ChildSharedBitmapManager> shared_bitmap_manager_; | 291 std::unique_ptr<ChildSharedBitmapManager> shared_bitmap_manager_; |
| 306 | 292 |
| 307 std::unique_ptr<ChildGpuMemoryBufferManager> gpu_memory_buffer_manager_; | 293 std::unique_ptr<ChildGpuMemoryBufferManager> gpu_memory_buffer_manager_; |
| 308 | 294 |
| 309 std::unique_ptr<ChildDiscardableSharedMemoryManager> | 295 std::unique_ptr<ChildDiscardableSharedMemoryManager> |
| 310 discardable_shared_memory_manager_; | 296 discardable_shared_memory_manager_; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 | 341 |
| 356 private: | 342 private: |
| 357 struct Options options_; | 343 struct Options options_; |
| 358 | 344 |
| 359 DISALLOW_COPY_AND_ASSIGN(Builder); | 345 DISALLOW_COPY_AND_ASSIGN(Builder); |
| 360 }; | 346 }; |
| 361 | 347 |
| 362 } // namespace content | 348 } // namespace content |
| 363 | 349 |
| 364 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 350 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
| OLD | NEW |