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_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 "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
12 #include "base/tracked_objects.h" | 12 #include "base/tracked_objects.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 #include "content/common/message_router.h" | 14 #include "content/common/message_router.h" |
15 #include "webkit/glue/resource_loader_bridge.h" | 15 #include "webkit/glue/resource_loader_bridge.h" |
16 | 16 |
17 class FileSystemDispatcher; | 17 class FileSystemDispatcher; |
18 class MessageLoop; | 18 class MessageLoop; |
19 class QuotaDispatcher; | 19 class QuotaDispatcher; |
20 class ResourceDispatcher; | 20 class ResourceDispatcher; |
21 class SocketStreamDispatcher; | 21 class SocketStreamDispatcher; |
22 | 22 |
| 23 namespace content { |
| 24 class ChildHistogramMessageFilter; |
| 25 } |
| 26 |
23 namespace IPC { | 27 namespace IPC { |
24 class SyncChannel; | 28 class SyncChannel; |
25 class SyncMessageFilter; | 29 class SyncMessageFilter; |
26 } | 30 } |
27 | 31 |
28 namespace WebKit { | 32 namespace WebKit { |
29 class WebFrame; | 33 class WebFrame; |
30 } | 34 } |
31 | 35 |
32 // The main thread of a child process derives from this class. | 36 // The main thread of a child process derives from this class. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 } | 76 } |
73 | 77 |
74 QuotaDispatcher* quota_dispatcher() const { | 78 QuotaDispatcher* quota_dispatcher() const { |
75 return quota_dispatcher_.get(); | 79 return quota_dispatcher_.get(); |
76 } | 80 } |
77 | 81 |
78 // Safe to call on any thread, as long as it's guaranteed that the thread's | 82 // Safe to call on any thread, as long as it's guaranteed that the thread's |
79 // lifetime is less than the main thread. | 83 // lifetime is less than the main thread. |
80 IPC::SyncMessageFilter* sync_message_filter(); | 84 IPC::SyncMessageFilter* sync_message_filter(); |
81 | 85 |
| 86 content::ChildHistogramMessageFilter* child_histogram_message_filter() const { |
| 87 return histogram_message_filter_.get(); |
| 88 } |
| 89 |
82 MessageLoop* message_loop(); | 90 MessageLoop* message_loop(); |
83 | 91 |
84 // Returns the one child thread. | 92 // Returns the one child thread. |
85 static ChildThread* current(); | 93 static ChildThread* current(); |
86 | 94 |
87 virtual bool IsWebFrameValid(WebKit::WebFrame* frame); | 95 virtual bool IsWebFrameValid(WebKit::WebFrame* frame); |
88 | 96 |
89 protected: | 97 protected: |
90 friend class ChildProcess; | 98 friend class ChildProcess; |
91 | 99 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // The OnChannelError() callback was invoked - the channel is dead, don't | 145 // The OnChannelError() callback was invoked - the channel is dead, don't |
138 // attempt to communicate. | 146 // attempt to communicate. |
139 bool on_channel_error_called_; | 147 bool on_channel_error_called_; |
140 | 148 |
141 MessageLoop* message_loop_; | 149 MessageLoop* message_loop_; |
142 | 150 |
143 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; | 151 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; |
144 | 152 |
145 scoped_ptr<QuotaDispatcher> quota_dispatcher_; | 153 scoped_ptr<QuotaDispatcher> quota_dispatcher_; |
146 | 154 |
| 155 scoped_refptr<content::ChildHistogramMessageFilter> histogram_message_filter_; |
| 156 |
147 DISALLOW_COPY_AND_ASSIGN(ChildThread); | 157 DISALLOW_COPY_AND_ASSIGN(ChildThread); |
148 }; | 158 }; |
149 | 159 |
150 #endif // CONTENT_COMMON_CHILD_THREAD_H_ | 160 #endif // CONTENT_COMMON_CHILD_THREAD_H_ |
OLD | NEW |