| 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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 #endif | 690 #endif |
| 691 mojo_shell_channel_init_.Init( | 691 mojo_shell_channel_init_.Init( |
| 692 handle, GetIOTaskRunner(), | 692 handle, GetIOTaskRunner(), |
| 693 base::Bind(&MojoShellConnectionImpl::BindToMessagePipe, | 693 base::Bind(&MojoShellConnectionImpl::BindToMessagePipe, |
| 694 base::Unretained(MojoShellConnectionImpl::Get()))); | 694 base::Unretained(MojoShellConnectionImpl::Get()))); |
| 695 #endif // defined(MOJO_SHELL_CLIENT) | 695 #endif // defined(MOJO_SHELL_CLIENT) |
| 696 } | 696 } |
| 697 | 697 |
| 698 void ChildThreadImpl::OnSetMojoParentPipeHandle( | 698 void ChildThreadImpl::OnSetMojoParentPipeHandle( |
| 699 const IPC::PlatformFileForTransit& file) { | 699 const IPC::PlatformFileForTransit& file) { |
| 700 mojo::embedder::SetParentPipeHandle( | 700 mojo::edk::SetParentPipeHandle( |
| 701 mojo::embedder::ScopedPlatformHandle(mojo::embedder::PlatformHandle( | 701 mojo::edk::ScopedPlatformHandle(mojo::edk::PlatformHandle( |
| 702 IPC::PlatformFileForTransitToPlatformFile(file)))); | 702 IPC::PlatformFileForTransitToPlatformFile(file)))); |
| 703 } | 703 } |
| 704 | 704 |
| 705 ChildThreadImpl* ChildThreadImpl::current() { | 705 ChildThreadImpl* ChildThreadImpl::current() { |
| 706 return g_lazy_tls.Pointer()->Get(); | 706 return g_lazy_tls.Pointer()->Get(); |
| 707 } | 707 } |
| 708 | 708 |
| 709 #if defined(OS_ANDROID) | 709 #if defined(OS_ANDROID) |
| 710 // The method must NOT be called on the child thread itself. | 710 // The method must NOT be called on the child thread itself. |
| 711 // It may block the child thread if so. | 711 // It may block the child thread if so. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 732 void ChildThreadImpl::EnsureConnected() { | 732 void ChildThreadImpl::EnsureConnected() { |
| 733 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; | 733 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; |
| 734 base::Process::Current().Terminate(0, false); | 734 base::Process::Current().Terminate(0, false); |
| 735 } | 735 } |
| 736 | 736 |
| 737 bool ChildThreadImpl::IsInBrowserProcess() const { | 737 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 738 return browser_process_io_runner_; | 738 return browser_process_io_runner_; |
| 739 } | 739 } |
| 740 | 740 |
| 741 } // namespace content | 741 } // namespace content |
| OLD | NEW |