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/common/mojo/channel_init.h" |
20 #include "content/public/child/child_thread.h" | 21 #include "content/public/child/child_thread.h" |
21 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. | 22 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. |
| 23 #include "ipc/ipc_platform_file.h" |
22 | 24 |
23 namespace base { | 25 namespace base { |
24 class MessageLoop; | 26 class MessageLoop; |
25 | 27 |
26 namespace trace_event { | 28 namespace trace_event { |
27 class TraceMemoryController; | 29 class TraceMemoryController; |
28 } // namespace trace_event | 30 } // namespace trace_event |
29 } // namespace base | 31 } // namespace base |
30 | 32 |
31 namespace IPC { | 33 namespace IPC { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 224 |
223 // We create the channel first without connecting it so we can add filters | 225 // We create the channel first without connecting it so we can add filters |
224 // prior to any messages being received, then connect it afterwards. | 226 // prior to any messages being received, then connect it afterwards. |
225 void ConnectChannel(bool use_mojo_channel); | 227 void ConnectChannel(bool use_mojo_channel); |
226 | 228 |
227 // IPC message handlers. | 229 // IPC message handlers. |
228 void OnShutdown(); | 230 void OnShutdown(); |
229 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); | 231 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); |
230 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); | 232 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); |
231 void OnProfilingPhaseCompleted(int profiling_phase); | 233 void OnProfilingPhaseCompleted(int profiling_phase); |
| 234 void OnBindExternalMojoShellHandle(const IPC::PlatformFileForTransit& file); |
232 #ifdef IPC_MESSAGE_LOG_ENABLED | 235 #ifdef IPC_MESSAGE_LOG_ENABLED |
233 void OnSetIPCLoggingEnabled(bool enable); | 236 void OnSetIPCLoggingEnabled(bool enable); |
234 #endif | 237 #endif |
235 #if defined(USE_TCMALLOC) | 238 #if defined(USE_TCMALLOC) |
236 void OnGetTcmallocStats(); | 239 void OnGetTcmallocStats(); |
237 #endif | 240 #endif |
238 | 241 |
239 void EnsureConnected(); | 242 void EnsureConnected(); |
240 | 243 |
241 scoped_ptr<MojoApplication> mojo_application_; | 244 scoped_ptr<MojoApplication> mojo_application_; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 // Observes the trace event system. When tracing is enabled, optionally | 293 // Observes the trace event system. When tracing is enabled, optionally |
291 // starts profiling the tcmalloc heap. | 294 // starts profiling the tcmalloc heap. |
292 scoped_ptr<base::trace_event::TraceMemoryController> trace_memory_controller_; | 295 scoped_ptr<base::trace_event::TraceMemoryController> trace_memory_controller_; |
293 | 296 |
294 scoped_ptr<base::PowerMonitor> power_monitor_; | 297 scoped_ptr<base::PowerMonitor> power_monitor_; |
295 | 298 |
296 scoped_refptr<ChildMessageFilter> geofencing_message_filter_; | 299 scoped_refptr<ChildMessageFilter> geofencing_message_filter_; |
297 | 300 |
298 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner_; | 301 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner_; |
299 | 302 |
| 303 ChannelInit mojo_shell_channel_init_; |
| 304 |
300 base::WeakPtrFactory<ChildThreadImpl> channel_connected_factory_; | 305 base::WeakPtrFactory<ChildThreadImpl> channel_connected_factory_; |
301 | 306 |
302 DISALLOW_COPY_AND_ASSIGN(ChildThreadImpl); | 307 DISALLOW_COPY_AND_ASSIGN(ChildThreadImpl); |
303 }; | 308 }; |
304 | 309 |
305 struct ChildThreadImpl::Options { | 310 struct ChildThreadImpl::Options { |
306 ~Options(); | 311 ~Options(); |
307 | 312 |
308 class Builder; | 313 class Builder; |
309 | 314 |
(...skipping 19 matching lines...) Expand all Loading... |
329 | 334 |
330 private: | 335 private: |
331 struct Options options_; | 336 struct Options options_; |
332 | 337 |
333 DISALLOW_COPY_AND_ASSIGN(Builder); | 338 DISALLOW_COPY_AND_ASSIGN(Builder); |
334 }; | 339 }; |
335 | 340 |
336 } // namespace content | 341 } // namespace content |
337 | 342 |
338 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 343 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
OLD | NEW |