| 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 #include "content/child/child_thread_impl.h" | 5 #include "content/child/child_thread_impl.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 #include "content/public/common/content_switches.h" | 58 #include "content/public/common/content_switches.h" |
| 59 #include "content/public/common/mojo_channel_switches.h" | 59 #include "content/public/common/mojo_channel_switches.h" |
| 60 #include "ipc/attachment_broker.h" | 60 #include "ipc/attachment_broker.h" |
| 61 #include "ipc/attachment_broker_unprivileged.h" | 61 #include "ipc/attachment_broker_unprivileged.h" |
| 62 #include "ipc/ipc_logging.h" | 62 #include "ipc/ipc_logging.h" |
| 63 #include "ipc/ipc_platform_file.h" | 63 #include "ipc/ipc_platform_file.h" |
| 64 #include "ipc/ipc_switches.h" | 64 #include "ipc/ipc_switches.h" |
| 65 #include "ipc/ipc_sync_channel.h" | 65 #include "ipc/ipc_sync_channel.h" |
| 66 #include "ipc/ipc_sync_message_filter.h" | 66 #include "ipc/ipc_sync_message_filter.h" |
| 67 #include "ipc/mojo/ipc_channel_mojo.h" | 67 #include "ipc/mojo/ipc_channel_mojo.h" |
| 68 #include "ipc/mojo/scoped_ipc_support.h" | |
| 69 #include "mojo/edk/embedder/embedder.h" | 68 #include "mojo/edk/embedder/embedder.h" |
| 70 #include "mojo/edk/embedder/named_platform_channel_pair.h" | 69 #include "mojo/edk/embedder/named_platform_channel_pair.h" |
| 71 #include "mojo/edk/embedder/platform_channel_pair.h" | 70 #include "mojo/edk/embedder/platform_channel_pair.h" |
| 71 #include "mojo/edk/embedder/scoped_ipc_support.h" |
| 72 #include "services/shell/runner/common/client_util.h" | 72 #include "services/shell/runner/common/client_util.h" |
| 73 | 73 |
| 74 #if defined(OS_POSIX) | 74 #if defined(OS_POSIX) |
| 75 #include "base/posix/global_descriptors.h" | 75 #include "base/posix/global_descriptors.h" |
| 76 #include "content/public/common/content_descriptors.h" | 76 #include "content/public/common/content_descriptors.h" |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 79 using tracked_objects::ThreadData; | 79 using tracked_objects::ThreadData; |
| 80 | 80 |
| 81 namespace content { | 81 namespace content { |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 channel_ = | 391 channel_ = |
| 392 IPC::SyncChannel::Create(this, ChildProcess::current()->io_task_runner(), | 392 IPC::SyncChannel::Create(this, ChildProcess::current()->io_task_runner(), |
| 393 ChildProcess::current()->GetShutDownEvent()); | 393 ChildProcess::current()->GetShutDownEvent()); |
| 394 #ifdef IPC_MESSAGE_LOG_ENABLED | 394 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 395 if (!IsInBrowserProcess()) | 395 if (!IsInBrowserProcess()) |
| 396 IPC::Logging::GetInstance()->SetIPCSender(this); | 396 IPC::Logging::GetInstance()->SetIPCSender(this); |
| 397 #endif | 397 #endif |
| 398 | 398 |
| 399 if (!IsInBrowserProcess()) { | 399 if (!IsInBrowserProcess()) { |
| 400 // Don't double-initialize IPC support in single-process mode. | 400 // Don't double-initialize IPC support in single-process mode. |
| 401 mojo_ipc_support_.reset(new IPC::ScopedIPCSupport(GetIOTaskRunner())); | 401 mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport(GetIOTaskRunner())); |
| 402 InitializeMojoIPCChannel(); | 402 InitializeMojoIPCChannel(); |
| 403 } | 403 } |
| 404 if (shell::ShellIsRemote()) { | 404 if (shell::ShellIsRemote()) { |
| 405 MojoShellConnection::SetForProcess( | 405 MojoShellConnection::SetForProcess( |
| 406 MojoShellConnection::Create( | 406 MojoShellConnection::Create( |
| 407 shell::GetShellClientRequestFromCommandLine())); | 407 shell::GetShellClientRequestFromCommandLine())); |
| 408 } | 408 } |
| 409 mojo_application_.reset(new MojoApplication()); | 409 mojo_application_.reset(new MojoApplication()); |
| 410 std::string mojo_application_token; | 410 std::string mojo_application_token; |
| 411 if (!IsInBrowserProcess()) { | 411 if (!IsInBrowserProcess()) { |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 void ChildThreadImpl::EnsureConnected() { | 743 void ChildThreadImpl::EnsureConnected() { |
| 744 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; | 744 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; |
| 745 base::Process::Current().Terminate(0, false); | 745 base::Process::Current().Terminate(0, false); |
| 746 } | 746 } |
| 747 | 747 |
| 748 bool ChildThreadImpl::IsInBrowserProcess() const { | 748 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 749 return static_cast<bool>(browser_process_io_runner_); | 749 return static_cast<bool>(browser_process_io_runner_); |
| 750 } | 750 } |
| 751 | 751 |
| 752 } // namespace content | 752 } // namespace content |
| OLD | NEW |