| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 55 #include "content/common/mojo/mojo_messages.h" | 55 #include "content/common/mojo/mojo_messages.h" | 
| 56 #include "content/public/common/content_switches.h" | 56 #include "content/public/common/content_switches.h" | 
| 57 #include "ipc/attachment_broker.h" | 57 #include "ipc/attachment_broker.h" | 
| 58 #include "ipc/attachment_broker_unprivileged.h" | 58 #include "ipc/attachment_broker_unprivileged.h" | 
| 59 #include "ipc/ipc_logging.h" | 59 #include "ipc/ipc_logging.h" | 
| 60 #include "ipc/ipc_platform_file.h" | 60 #include "ipc/ipc_platform_file.h" | 
| 61 #include "ipc/ipc_switches.h" | 61 #include "ipc/ipc_switches.h" | 
| 62 #include "ipc/ipc_sync_channel.h" | 62 #include "ipc/ipc_sync_channel.h" | 
| 63 #include "ipc/ipc_sync_message_filter.h" | 63 #include "ipc/ipc_sync_message_filter.h" | 
| 64 #include "ipc/mojo/ipc_channel_mojo.h" | 64 #include "ipc/mojo/ipc_channel_mojo.h" | 
| 65 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" | 65 #include "mojo/edk/embedder/embedder.h" | 
| 66 | 66 | 
| 67 #if defined(USE_OZONE) | 67 #if defined(USE_OZONE) | 
| 68 #include "ui/ozone/public/client_native_pixmap_factory.h" | 68 #include "ui/ozone/public/client_native_pixmap_factory.h" | 
| 69 #endif | 69 #endif | 
| 70 | 70 | 
| 71 #if defined(MOJO_SHELL_CLIENT) | 71 #if defined(MOJO_SHELL_CLIENT) | 
| 72 #include "content/common/mojo/mojo_shell_connection_impl.h" | 72 #include "content/common/mojo/mojo_shell_connection_impl.h" | 
| 73 #endif | 73 #endif | 
| 74 | 74 | 
| 75 using tracked_objects::ThreadData; | 75 using tracked_objects::ThreadData; | 
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 689   base::PlatformFile handle = file; | 689   base::PlatformFile handle = file; | 
| 690 #endif | 690 #endif | 
| 691   mojo::ScopedMessagePipeHandle pipe = | 691   mojo::ScopedMessagePipeHandle pipe = | 
| 692       mojo_shell_channel_init_.Init(handle, GetIOTaskRunner()); | 692       mojo_shell_channel_init_.Init(handle, GetIOTaskRunner()); | 
| 693   MojoShellConnectionImpl::Get()->BindToMessagePipe(std::move(pipe)); | 693   MojoShellConnectionImpl::Get()->BindToMessagePipe(std::move(pipe)); | 
| 694 #endif  // defined(MOJO_SHELL_CLIENT) | 694 #endif  // defined(MOJO_SHELL_CLIENT) | 
| 695 } | 695 } | 
| 696 | 696 | 
| 697 void ChildThreadImpl::OnSetMojoParentPipeHandle( | 697 void ChildThreadImpl::OnSetMojoParentPipeHandle( | 
| 698     const IPC::PlatformFileForTransit& file) { | 698     const IPC::PlatformFileForTransit& file) { | 
| 699   mojo::embedder::SetParentPipeHandle( | 699   mojo::edk::SetParentPipeHandle( | 
| 700       mojo::embedder::ScopedPlatformHandle(mojo::embedder::PlatformHandle( | 700       mojo::edk::ScopedPlatformHandle(mojo::edk::PlatformHandle( | 
| 701           IPC::PlatformFileForTransitToPlatformFile(file)))); | 701           IPC::PlatformFileForTransitToPlatformFile(file)))); | 
| 702 } | 702 } | 
| 703 | 703 | 
| 704 ChildThreadImpl* ChildThreadImpl::current() { | 704 ChildThreadImpl* ChildThreadImpl::current() { | 
| 705   return g_lazy_tls.Pointer()->Get(); | 705   return g_lazy_tls.Pointer()->Get(); | 
| 706 } | 706 } | 
| 707 | 707 | 
| 708 #if defined(OS_ANDROID) | 708 #if defined(OS_ANDROID) | 
| 709 // The method must NOT be called on the child thread itself. | 709 // The method must NOT be called on the child thread itself. | 
| 710 // It may block the child thread if so. | 710 // It may block the child thread if so. | 
| (...skipping 20 matching lines...) Expand all  Loading... | 
| 731 void ChildThreadImpl::EnsureConnected() { | 731 void ChildThreadImpl::EnsureConnected() { | 
| 732   VLOG(0) << "ChildThreadImpl::EnsureConnected()"; | 732   VLOG(0) << "ChildThreadImpl::EnsureConnected()"; | 
| 733   base::Process::Current().Terminate(0, false); | 733   base::Process::Current().Terminate(0, false); | 
| 734 } | 734 } | 
| 735 | 735 | 
| 736 bool ChildThreadImpl::IsInBrowserProcess() const { | 736 bool ChildThreadImpl::IsInBrowserProcess() const { | 
| 737   return browser_process_io_runner_; | 737   return browser_process_io_runner_; | 
| 738 } | 738 } | 
| 739 | 739 | 
| 740 }  // namespace content | 740 }  // namespace content | 
| OLD | NEW | 
|---|