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 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/shared_memory.h" | 15 #include "base/memory/shared_memory.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/power_monitor/power_monitor.h" | 17 #include "base/power_monitor/power_monitor.h" |
18 #include "base/sequenced_task_runner.h" | 18 #include "base/sequenced_task_runner.h" |
19 #include "base/tracked_objects.h" | 19 #include "base/tracked_objects.h" |
20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
21 #include "content/child/mojo/mojo_application.h" | 21 #include "content/child/mojo/mojo_application.h" |
22 #include "content/common/content_export.h" | 22 #include "content/common/content_export.h" |
| 23 #include "content/common/mojo/channel_init.h" |
23 #include "content/public/child/child_thread.h" | 24 #include "content/public/child/child_thread.h" |
24 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. | 25 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. |
25 #include "ipc/ipc_platform_file.h" | 26 #include "ipc/ipc_platform_file.h" |
26 #include "ipc/message_router.h" | 27 #include "ipc/message_router.h" |
27 | 28 |
28 namespace base { | 29 namespace base { |
29 class MessageLoop; | 30 class MessageLoop; |
30 } // namespace base | 31 } // namespace base |
31 | 32 |
32 namespace IPC { | 33 namespace IPC { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 222 |
222 // We create the channel first without connecting it so we can add filters | 223 // We create the channel first without connecting it so we can add filters |
223 // prior to any messages being received, then connect it afterwards. | 224 // prior to any messages being received, then connect it afterwards. |
224 void ConnectChannel(bool use_mojo_channel); | 225 void ConnectChannel(bool use_mojo_channel); |
225 | 226 |
226 // IPC message handlers. | 227 // IPC message handlers. |
227 void OnShutdown(); | 228 void OnShutdown(); |
228 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); | 229 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); |
229 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); | 230 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); |
230 void OnProfilingPhaseCompleted(int profiling_phase); | 231 void OnProfilingPhaseCompleted(int profiling_phase); |
| 232 void OnBindExternalMojoShellHandle(const IPC::PlatformFileForTransit& file); |
| 233 void OnSetMojoParentPipeHandle(const IPC::PlatformFileForTransit& file); |
231 #ifdef IPC_MESSAGE_LOG_ENABLED | 234 #ifdef IPC_MESSAGE_LOG_ENABLED |
232 void OnSetIPCLoggingEnabled(bool enable); | 235 void OnSetIPCLoggingEnabled(bool enable); |
233 #endif | 236 #endif |
234 | 237 |
235 void EnsureConnected(); | 238 void EnsureConnected(); |
236 | 239 |
237 scoped_ptr<IPC::ScopedIPCSupport> mojo_ipc_support_; | 240 scoped_ptr<IPC::ScopedIPCSupport> mojo_ipc_support_; |
238 scoped_ptr<MojoApplication> mojo_application_; | 241 scoped_ptr<MojoApplication> mojo_application_; |
239 | 242 |
240 std::string channel_name_; | 243 std::string channel_name_; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 285 |
283 scoped_ptr<ChildDiscardableSharedMemoryManager> | 286 scoped_ptr<ChildDiscardableSharedMemoryManager> |
284 discardable_shared_memory_manager_; | 287 discardable_shared_memory_manager_; |
285 | 288 |
286 scoped_ptr<base::PowerMonitor> power_monitor_; | 289 scoped_ptr<base::PowerMonitor> power_monitor_; |
287 | 290 |
288 scoped_refptr<ChildMessageFilter> geofencing_message_filter_; | 291 scoped_refptr<ChildMessageFilter> geofencing_message_filter_; |
289 | 292 |
290 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner_; | 293 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner_; |
291 | 294 |
| 295 ChannelInit mojo_shell_channel_init_; |
| 296 |
292 base::WeakPtrFactory<ChildThreadImpl> channel_connected_factory_; | 297 base::WeakPtrFactory<ChildThreadImpl> channel_connected_factory_; |
293 | 298 |
294 DISALLOW_COPY_AND_ASSIGN(ChildThreadImpl); | 299 DISALLOW_COPY_AND_ASSIGN(ChildThreadImpl); |
295 }; | 300 }; |
296 | 301 |
297 struct ChildThreadImpl::Options { | 302 struct ChildThreadImpl::Options { |
298 Options(const Options& other); | 303 Options(const Options& other); |
299 ~Options(); | 304 ~Options(); |
300 | 305 |
301 class Builder; | 306 class Builder; |
(...skipping 20 matching lines...) Expand all Loading... |
322 | 327 |
323 private: | 328 private: |
324 struct Options options_; | 329 struct Options options_; |
325 | 330 |
326 DISALLOW_COPY_AND_ASSIGN(Builder); | 331 DISALLOW_COPY_AND_ASSIGN(Builder); |
327 }; | 332 }; |
328 | 333 |
329 } // namespace content | 334 } // namespace content |
330 | 335 |
331 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 336 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
OLD | NEW |