OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_COMMON_CHILD_THREAD_H_ | 5 #ifndef CONTENT_COMMON_CHILD_THREAD_H_ |
6 #define CONTENT_COMMON_CHILD_THREAD_H_ | 6 #define CONTENT_COMMON_CHILD_THREAD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "content/common/message_router.h" | 11 #include "content/common/message_router.h" |
12 #include "webkit/glue/resource_loader_bridge.h" | 12 #include "webkit/glue/resource_loader_bridge.h" |
13 | 13 |
14 class FileSystemDispatcher; | 14 class FileSystemDispatcher; |
15 class MessageLoop; | 15 class MessageLoop; |
16 class NotificationService; | 16 class NotificationService; |
| 17 class QuotaDispatcher; |
17 class ResourceDispatcher; | 18 class ResourceDispatcher; |
18 class SocketStreamDispatcher; | 19 class SocketStreamDispatcher; |
19 | 20 |
20 namespace IPC { | 21 namespace IPC { |
21 class SyncChannel; | 22 class SyncChannel; |
22 class SyncMessageFilter; | 23 class SyncMessageFilter; |
23 } | 24 } |
24 | 25 |
25 // The main thread of a child process derives from this class. | 26 // The main thread of a child process derives from this class. |
26 class ChildThread : public IPC::Channel::Listener, | 27 class ChildThread : public IPC::Channel::Listener, |
(...skipping 22 matching lines...) Expand all Loading... |
49 ResourceDispatcher* resource_dispatcher(); | 50 ResourceDispatcher* resource_dispatcher(); |
50 | 51 |
51 SocketStreamDispatcher* socket_stream_dispatcher() { | 52 SocketStreamDispatcher* socket_stream_dispatcher() { |
52 return socket_stream_dispatcher_.get(); | 53 return socket_stream_dispatcher_.get(); |
53 } | 54 } |
54 | 55 |
55 FileSystemDispatcher* file_system_dispatcher() const { | 56 FileSystemDispatcher* file_system_dispatcher() const { |
56 return file_system_dispatcher_.get(); | 57 return file_system_dispatcher_.get(); |
57 } | 58 } |
58 | 59 |
| 60 QuotaDispatcher* quota_dispatcher() const { |
| 61 return quota_dispatcher_.get(); |
| 62 } |
| 63 |
59 // Safe to call on any thread, as long as it's guaranteed that the thread's | 64 // Safe to call on any thread, as long as it's guaranteed that the thread's |
60 // lifetime is less than the main thread. | 65 // lifetime is less than the main thread. |
61 IPC::SyncMessageFilter* sync_message_filter(); | 66 IPC::SyncMessageFilter* sync_message_filter(); |
62 | 67 |
63 MessageLoop* message_loop(); | 68 MessageLoop* message_loop(); |
64 | 69 |
65 // Returns the one child thread. | 70 // Returns the one child thread. |
66 static ChildThread* current(); | 71 static ChildThread* current(); |
67 | 72 |
68 protected: | 73 protected: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // The OnChannelError() callback was invoked - the channel is dead, don't | 120 // The OnChannelError() callback was invoked - the channel is dead, don't |
116 // attempt to communicate. | 121 // attempt to communicate. |
117 bool on_channel_error_called_; | 122 bool on_channel_error_called_; |
118 | 123 |
119 MessageLoop* message_loop_; | 124 MessageLoop* message_loop_; |
120 | 125 |
121 scoped_ptr<NotificationService> notification_service_; | 126 scoped_ptr<NotificationService> notification_service_; |
122 | 127 |
123 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; | 128 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; |
124 | 129 |
| 130 scoped_ptr<QuotaDispatcher> quota_dispatcher_; |
| 131 |
125 DISALLOW_COPY_AND_ASSIGN(ChildThread); | 132 DISALLOW_COPY_AND_ASSIGN(ChildThread); |
126 }; | 133 }; |
127 | 134 |
128 #endif // CONTENT_COMMON_CHILD_THREAD_H_ | 135 #endif // CONTENT_COMMON_CHILD_THREAD_H_ |
OLD | NEW |