| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 #include "content/public/common/content_switches.h" | 57 #include "content/public/common/content_switches.h" |
| 58 #include "ipc/attachment_broker.h" | 58 #include "ipc/attachment_broker.h" |
| 59 #include "ipc/attachment_broker_unprivileged.h" | 59 #include "ipc/attachment_broker_unprivileged.h" |
| 60 #include "ipc/ipc_channel.h" | 60 #include "ipc/ipc_channel.h" |
| 61 #include "ipc/ipc_logging.h" | 61 #include "ipc/ipc_logging.h" |
| 62 #include "ipc/ipc_platform_file.h" | 62 #include "ipc/ipc_platform_file.h" |
| 63 #include "ipc/ipc_switches.h" | 63 #include "ipc/ipc_switches.h" |
| 64 #include "ipc/ipc_sync_channel.h" | 64 #include "ipc/ipc_sync_channel.h" |
| 65 #include "ipc/ipc_sync_message_filter.h" | 65 #include "ipc/ipc_sync_message_filter.h" |
| 66 #include "ipc/mojo/ipc_channel_mojo.h" | 66 #include "ipc/mojo/ipc_channel_mojo.h" |
| 67 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" | 67 #include "mojo/edk/embedder/embedder.h" |
| 68 | 68 |
| 69 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) | 69 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) |
| 70 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" | 70 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" |
| 71 #endif | 71 #endif |
| 72 | 72 |
| 73 #if defined(USE_OZONE) | 73 #if defined(USE_OZONE) |
| 74 #include "ui/ozone/public/client_native_pixmap_factory.h" | 74 #include "ui/ozone/public/client_native_pixmap_factory.h" |
| 75 #endif | 75 #endif |
| 76 | 76 |
| 77 #if defined(MOJO_SHELL_CLIENT) | 77 #if defined(MOJO_SHELL_CLIENT) |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 #endif | 694 #endif |
| 695 mojo::ScopedMessagePipeHandle message_pipe = | 695 mojo::ScopedMessagePipeHandle message_pipe = |
| 696 mojo_shell_channel_init_.Init(handle, GetIOTaskRunner()); | 696 mojo_shell_channel_init_.Init(handle, GetIOTaskRunner()); |
| 697 DCHECK(message_pipe.is_valid()); | 697 DCHECK(message_pipe.is_valid()); |
| 698 MojoShellConnectionImpl::Get()->BindToMessagePipe(std::move(message_pipe)); | 698 MojoShellConnectionImpl::Get()->BindToMessagePipe(std::move(message_pipe)); |
| 699 #endif // defined(MOJO_SHELL_CLIENT) | 699 #endif // defined(MOJO_SHELL_CLIENT) |
| 700 } | 700 } |
| 701 | 701 |
| 702 void ChildThreadImpl::OnSetMojoParentPipeHandle( | 702 void ChildThreadImpl::OnSetMojoParentPipeHandle( |
| 703 const IPC::PlatformFileForTransit& file) { | 703 const IPC::PlatformFileForTransit& file) { |
| 704 mojo::embedder::SetParentPipeHandle( | 704 mojo::edk::SetParentPipeHandle( |
| 705 mojo::embedder::ScopedPlatformHandle(mojo::embedder::PlatformHandle( | 705 mojo::edk::ScopedPlatformHandle(mojo::edk::PlatformHandle( |
| 706 IPC::PlatformFileForTransitToPlatformFile(file)))); | 706 IPC::PlatformFileForTransitToPlatformFile(file)))); |
| 707 } | 707 } |
| 708 | 708 |
| 709 ChildThreadImpl* ChildThreadImpl::current() { | 709 ChildThreadImpl* ChildThreadImpl::current() { |
| 710 return g_lazy_tls.Pointer()->Get(); | 710 return g_lazy_tls.Pointer()->Get(); |
| 711 } | 711 } |
| 712 | 712 |
| 713 #if defined(OS_ANDROID) | 713 #if defined(OS_ANDROID) |
| 714 // The method must NOT be called on the child thread itself. | 714 // The method must NOT be called on the child thread itself. |
| 715 // It may block the child thread if so. | 715 // It may block the child thread if so. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 736 void ChildThreadImpl::EnsureConnected() { | 736 void ChildThreadImpl::EnsureConnected() { |
| 737 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; | 737 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; |
| 738 base::Process::Current().Terminate(0, false); | 738 base::Process::Current().Terminate(0, false); |
| 739 } | 739 } |
| 740 | 740 |
| 741 bool ChildThreadImpl::IsInBrowserProcess() const { | 741 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 742 return browser_process_io_runner_; | 742 return browser_process_io_runner_; |
| 743 } | 743 } |
| 744 | 744 |
| 745 } // namespace content | 745 } // namespace content |
| OLD | NEW |