| 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 <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.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" | |
| 22 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
| 23 #include "content/public/child/child_thread.h" | 22 #include "content/public/child/child_thread.h" |
| 24 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. | 23 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. |
| 25 #include "ipc/ipc_platform_file.h" | 24 #include "ipc/ipc_platform_file.h" |
| 26 #include "ipc/message_router.h" | 25 #include "ipc/message_router.h" |
| 27 #include "services/shell/public/cpp/shell_client.h" | 26 #include "services/shell/public/cpp/shell_client.h" |
| 28 | 27 |
| 29 namespace base { | 28 namespace base { |
| 30 class MessageLoop; | 29 class MessageLoop; |
| 31 } // namespace base | 30 } // namespace base |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); | 246 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); |
| 248 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); | 247 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); |
| 249 void OnProfilingPhaseCompleted(int profiling_phase); | 248 void OnProfilingPhaseCompleted(int profiling_phase); |
| 250 #ifdef IPC_MESSAGE_LOG_ENABLED | 249 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 251 void OnSetIPCLoggingEnabled(bool enable); | 250 void OnSetIPCLoggingEnabled(bool enable); |
| 252 #endif | 251 #endif |
| 253 | 252 |
| 254 void EnsureConnected(); | 253 void EnsureConnected(); |
| 255 | 254 |
| 256 std::unique_ptr<mojo::edk::ScopedIPCSupport> mojo_ipc_support_; | 255 std::unique_ptr<mojo::edk::ScopedIPCSupport> mojo_ipc_support_; |
| 257 bool use_mojo_shell_connection_ = false; | |
| 258 std::unique_ptr<MojoApplication> mojo_application_; | |
| 259 std::unique_ptr<MojoShellConnection> mojo_shell_connection_; | 256 std::unique_ptr<MojoShellConnection> mojo_shell_connection_; |
| 260 std::unique_ptr<shell::InterfaceRegistry> interface_registry_; | 257 std::unique_ptr<shell::InterfaceRegistry> interface_registry_; |
| 261 std::unique_ptr<shell::InterfaceProvider> remote_interfaces_; | 258 std::unique_ptr<shell::InterfaceProvider> remote_interfaces_; |
| 262 | 259 |
| 263 std::string channel_name_; | 260 std::string channel_name_; |
| 264 std::unique_ptr<IPC::SyncChannel> channel_; | 261 std::unique_ptr<IPC::SyncChannel> channel_; |
| 265 | 262 |
| 266 // Allows threads other than the main thread to send sync messages. | 263 // Allows threads other than the main thread to send sync messages. |
| 267 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; | 264 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; |
| 268 | 265 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 ~Options(); | 319 ~Options(); |
| 323 | 320 |
| 324 class Builder; | 321 class Builder; |
| 325 | 322 |
| 326 std::string channel_name; | 323 std::string channel_name; |
| 327 bool use_mojo_channel; | 324 bool use_mojo_channel; |
| 328 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner; | 325 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner; |
| 329 std::vector<IPC::MessageFilter*> startup_filters; | 326 std::vector<IPC::MessageFilter*> startup_filters; |
| 330 std::string in_process_ipc_token; | 327 std::string in_process_ipc_token; |
| 331 std::string in_process_application_token; | 328 std::string in_process_application_token; |
| 332 bool use_mojo_shell_connection = false; | |
| 333 | 329 |
| 334 private: | 330 private: |
| 335 Options(); | 331 Options(); |
| 336 }; | 332 }; |
| 337 | 333 |
| 338 class ChildThreadImpl::Options::Builder { | 334 class ChildThreadImpl::Options::Builder { |
| 339 public: | 335 public: |
| 340 Builder(); | 336 Builder(); |
| 341 | 337 |
| 342 Builder& InBrowserProcess(const InProcessChildThreadParams& params); | 338 Builder& InBrowserProcess(const InProcessChildThreadParams& params); |
| 343 Builder& UseMojoChannel(bool use_mojo_channel); | 339 Builder& UseMojoChannel(bool use_mojo_channel); |
| 344 Builder& WithChannelName(const std::string& channel_name); | 340 Builder& WithChannelName(const std::string& channel_name); |
| 345 Builder& AddStartupFilter(IPC::MessageFilter* filter); | 341 Builder& AddStartupFilter(IPC::MessageFilter* filter); |
| 346 Builder& UseMojoShellConnection(bool use_mojo_shell_connection); | |
| 347 | 342 |
| 348 Options Build(); | 343 Options Build(); |
| 349 | 344 |
| 350 private: | 345 private: |
| 351 struct Options options_; | 346 struct Options options_; |
| 352 | 347 |
| 353 DISALLOW_COPY_AND_ASSIGN(Builder); | 348 DISALLOW_COPY_AND_ASSIGN(Builder); |
| 354 }; | 349 }; |
| 355 | 350 |
| 356 } // namespace content | 351 } // namespace content |
| 357 | 352 |
| 358 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 353 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
| OLD | NEW |