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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/shared_memory.h" | 12 #include "base/memory/shared_memory.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/power_monitor/power_monitor.h" | 14 #include "base/power_monitor/power_monitor.h" |
15 #include "base/sequenced_task_runner.h" | 15 #include "base/sequenced_task_runner.h" |
16 #include "base/tracked_objects.h" | 16 #include "base/tracked_objects.h" |
17 #include "content/child/mojo/mojo_application.h" | 17 #include "content/child/mojo/mojo_application.h" |
18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
19 #include "content/common/message_router.h" | 19 #include "content/common/message_router.h" |
20 #include "content/public/child/child_thread.h" | 20 #include "content/public/child/child_thread.h" |
21 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. | 21 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. |
22 | 22 |
23 #if defined(MOJO_SHELL_CLIENT) | |
24 #include "content/common/mojo/channel_init.h" | |
25 #include "ipc/ipc_platform_file.h" | |
26 #endif | |
27 | |
28 namespace base { | 23 namespace base { |
29 class MessageLoop; | 24 class MessageLoop; |
30 | 25 |
31 namespace trace_event { | 26 namespace trace_event { |
32 class TraceMemoryController; | 27 class TraceMemoryController; |
33 } // namespace trace_event | 28 } // namespace trace_event |
34 } // namespace base | 29 } // namespace base |
35 | 30 |
36 namespace IPC { | 31 namespace IPC { |
37 class AttachmentBrokerUnprivileged; | 32 class AttachmentBrokerUnprivileged; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 void OnShutdown(); | 228 void OnShutdown(); |
234 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); | 229 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); |
235 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); | 230 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); |
236 void OnProfilingPhaseCompleted(int profiling_phase); | 231 void OnProfilingPhaseCompleted(int profiling_phase); |
237 #ifdef IPC_MESSAGE_LOG_ENABLED | 232 #ifdef IPC_MESSAGE_LOG_ENABLED |
238 void OnSetIPCLoggingEnabled(bool enable); | 233 void OnSetIPCLoggingEnabled(bool enable); |
239 #endif | 234 #endif |
240 #if defined(USE_TCMALLOC) | 235 #if defined(USE_TCMALLOC) |
241 void OnGetTcmallocStats(); | 236 void OnGetTcmallocStats(); |
242 #endif | 237 #endif |
243 #if defined(MOJO_SHELL_CLIENT) | |
244 void OnBindControllerHandle(const IPC::PlatformFileForTransit& file); | |
245 #endif | |
246 | 238 |
247 void EnsureConnected(); | 239 void EnsureConnected(); |
248 | 240 |
249 scoped_ptr<MojoApplication> mojo_application_; | 241 scoped_ptr<MojoApplication> mojo_application_; |
250 | 242 |
251 std::string channel_name_; | 243 std::string channel_name_; |
252 scoped_ptr<IPC::AttachmentBrokerUnprivileged> attachment_broker_; | 244 scoped_ptr<IPC::AttachmentBrokerUnprivileged> attachment_broker_; |
253 scoped_ptr<IPC::SyncChannel> channel_; | 245 scoped_ptr<IPC::SyncChannel> channel_; |
254 | 246 |
255 // Allows threads other than the main thread to send sync messages. | 247 // Allows threads other than the main thread to send sync messages. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 // Observes the trace event system. When tracing is enabled, optionally | 290 // Observes the trace event system. When tracing is enabled, optionally |
299 // starts profiling the tcmalloc heap. | 291 // starts profiling the tcmalloc heap. |
300 scoped_ptr<base::trace_event::TraceMemoryController> trace_memory_controller_; | 292 scoped_ptr<base::trace_event::TraceMemoryController> trace_memory_controller_; |
301 | 293 |
302 scoped_ptr<base::PowerMonitor> power_monitor_; | 294 scoped_ptr<base::PowerMonitor> power_monitor_; |
303 | 295 |
304 scoped_refptr<ChildMessageFilter> geofencing_message_filter_; | 296 scoped_refptr<ChildMessageFilter> geofencing_message_filter_; |
305 | 297 |
306 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner_; | 298 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner_; |
307 | 299 |
308 #if defined(MOJO_SHELL_CLIENT) | |
309 ChannelInit mojo_shell_channel_init_; | |
310 #endif | |
311 | |
312 base::WeakPtrFactory<ChildThreadImpl> channel_connected_factory_; | 300 base::WeakPtrFactory<ChildThreadImpl> channel_connected_factory_; |
313 | 301 |
314 DISALLOW_COPY_AND_ASSIGN(ChildThreadImpl); | 302 DISALLOW_COPY_AND_ASSIGN(ChildThreadImpl); |
315 }; | 303 }; |
316 | 304 |
317 struct ChildThreadImpl::Options { | 305 struct ChildThreadImpl::Options { |
318 ~Options(); | 306 ~Options(); |
319 | 307 |
320 class Builder; | 308 class Builder; |
321 | 309 |
(...skipping 19 matching lines...) Expand all Loading... |
341 | 329 |
342 private: | 330 private: |
343 struct Options options_; | 331 struct Options options_; |
344 | 332 |
345 DISALLOW_COPY_AND_ASSIGN(Builder); | 333 DISALLOW_COPY_AND_ASSIGN(Builder); |
346 }; | 334 }; |
347 | 335 |
348 } // namespace content | 336 } // namespace content |
349 | 337 |
350 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 338 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
OLD | NEW |