| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 void InitializeMojoIPCChannel() { | 229 void InitializeMojoIPCChannel() { |
| 230 mojo::edk::ScopedPlatformHandle platform_channel; | 230 mojo::edk::ScopedPlatformHandle platform_channel; |
| 231 #if defined(OS_WIN) | 231 #if defined(OS_WIN) |
| 232 platform_channel = | 232 platform_channel = |
| 233 mojo::edk::PlatformChannelPair::PassClientHandleFromParentProcess( | 233 mojo::edk::PlatformChannelPair::PassClientHandleFromParentProcess( |
| 234 *base::CommandLine::ForCurrentProcess()); | 234 *base::CommandLine::ForCurrentProcess()); |
| 235 #elif defined(OS_POSIX) | 235 #elif defined(OS_POSIX) |
| 236 platform_channel.reset(mojo::edk::PlatformHandle( | 236 platform_channel.reset(mojo::edk::PlatformHandle( |
| 237 base::GlobalDescriptors::GetInstance()->Get(kMojoIPCChannel))); | 237 base::GlobalDescriptors::GetInstance()->Get(kMojoIPCChannel))); |
| 238 #endif | 238 #endif |
| 239 CHECK(platform_channel.is_valid()); | 239 // Mojo isn't supported on all child process types. |
| 240 // TODO(crbug.com/604282): Support Mojo in the remaining processes. |
| 241 if (!platform_channel.is_valid()) |
| 242 return; |
| 240 mojo::edk::SetParentPipeHandle(std::move(platform_channel)); | 243 mojo::edk::SetParentPipeHandle(std::move(platform_channel)); |
| 241 } | 244 } |
| 242 | 245 |
| 243 } // namespace | 246 } // namespace |
| 244 | 247 |
| 245 ChildThread* ChildThread::Get() { | 248 ChildThread* ChildThread::Get() { |
| 246 return ChildThreadImpl::current(); | 249 return ChildThreadImpl::current(); |
| 247 } | 250 } |
| 248 | 251 |
| 249 ChildThreadImpl::Options::Options() | 252 ChildThreadImpl::Options::Options() |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 void ChildThreadImpl::EnsureConnected() { | 723 void ChildThreadImpl::EnsureConnected() { |
| 721 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; | 724 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; |
| 722 base::Process::Current().Terminate(0, false); | 725 base::Process::Current().Terminate(0, false); |
| 723 } | 726 } |
| 724 | 727 |
| 725 bool ChildThreadImpl::IsInBrowserProcess() const { | 728 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 726 return browser_process_io_runner_; | 729 return browser_process_io_runner_; |
| 727 } | 730 } |
| 728 | 731 |
| 729 } // namespace content | 732 } // namespace content |
| OLD | NEW |