Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: content/child/child_thread_impl.cc

Issue 1387963004: Create a broker interface for the new Mojo EDK so that the browser can create and duplicate messa... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: presubmit whitespace error Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 8
9 #include <string> 9 #include <string>
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "content/common/in_process_child_thread_params.h" 54 #include "content/common/in_process_child_thread_params.h"
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_switches.h" 60 #include "ipc/ipc_switches.h"
61 #include "ipc/ipc_sync_channel.h" 61 #include "ipc/ipc_sync_channel.h"
62 #include "ipc/ipc_sync_message_filter.h" 62 #include "ipc/ipc_sync_message_filter.h"
63 #include "ipc/mojo/ipc_channel_mojo.h" 63 #include "ipc/mojo/ipc_channel_mojo.h"
64 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
64 65
65 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) 66 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED)
66 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" 67 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h"
67 #endif 68 #endif
68 69
69 #if defined(OS_MACOSX) 70 #if defined(OS_MACOSX)
70 #include "content/child/child_io_surface_manager_mac.h" 71 #include "content/child/child_io_surface_manager_mac.h"
71 #endif 72 #endif
72 73
73 #if defined(USE_OZONE) 74 #if defined(USE_OZONE)
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProfilerStatus, 652 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProfilerStatus,
652 OnSetProfilerStatus) 653 OnSetProfilerStatus)
653 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetChildProfilerData, 654 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetChildProfilerData,
654 OnGetChildProfilerData) 655 OnGetChildProfilerData)
655 IPC_MESSAGE_HANDLER(ChildProcessMsg_ProfilingPhaseCompleted, 656 IPC_MESSAGE_HANDLER(ChildProcessMsg_ProfilingPhaseCompleted,
656 OnProfilingPhaseCompleted) 657 OnProfilingPhaseCompleted)
657 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProcessBackgrounded, 658 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetProcessBackgrounded,
658 OnProcessBackgrounded) 659 OnProcessBackgrounded)
659 IPC_MESSAGE_HANDLER(MojoMsg_BindExternalMojoShellHandle, 660 IPC_MESSAGE_HANDLER(MojoMsg_BindExternalMojoShellHandle,
660 OnBindExternalMojoShellHandle) 661 OnBindExternalMojoShellHandle)
662 #if defined(OS_WIN)
663 IPC_MESSAGE_HANDLER(ChildProcessMsg_SetMojoParentPipeHandle,
664 OnSetMojoParentPipeHandle)
665 #endif
661 #if defined(USE_TCMALLOC) 666 #if defined(USE_TCMALLOC)
662 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetTcmallocStats, OnGetTcmallocStats) 667 IPC_MESSAGE_HANDLER(ChildProcessMsg_GetTcmallocStats, OnGetTcmallocStats)
663 #endif 668 #endif
664 IPC_MESSAGE_UNHANDLED(handled = false) 669 IPC_MESSAGE_UNHANDLED(handled = false)
665 IPC_END_MESSAGE_MAP() 670 IPC_END_MESSAGE_MAP()
666 671
667 if (handled) 672 if (handled)
668 return true; 673 return true;
669 674
670 if (msg.routing_id() == MSG_ROUTING_CONTROL) 675 if (msg.routing_id() == MSG_ROUTING_CONTROL)
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 #elif defined(OS_WIN) 728 #elif defined(OS_WIN)
724 base::PlatformFile handle = file; 729 base::PlatformFile handle = file;
725 #endif 730 #endif
726 mojo::ScopedMessagePipeHandle message_pipe = 731 mojo::ScopedMessagePipeHandle message_pipe =
727 mojo_shell_channel_init_.Init(handle, GetIOTaskRunner()); 732 mojo_shell_channel_init_.Init(handle, GetIOTaskRunner());
728 DCHECK(message_pipe.is_valid()); 733 DCHECK(message_pipe.is_valid());
729 MojoShellConnectionImpl::CreateWithMessagePipe(message_pipe.Pass()); 734 MojoShellConnectionImpl::CreateWithMessagePipe(message_pipe.Pass());
730 #endif // defined(MOJO_SHELL_CLIENT) 735 #endif // defined(MOJO_SHELL_CLIENT)
731 } 736 }
732 737
738 #if defined(OS_WIN)
739 void ChildThreadImpl::OnSetMojoParentPipeHandle(
740 const IPC::PlatformFileForTransit& file) {
741 mojo::embedder::SetParentPipeHandle(file);
742 }
743 #endif
744
733 #if defined(USE_TCMALLOC) 745 #if defined(USE_TCMALLOC)
734 void ChildThreadImpl::OnGetTcmallocStats() { 746 void ChildThreadImpl::OnGetTcmallocStats() {
735 std::string result; 747 std::string result;
736 char buffer[1024 * 32]; 748 char buffer[1024 * 32];
737 base::allocator::GetStats(buffer, sizeof(buffer)); 749 base::allocator::GetStats(buffer, sizeof(buffer));
738 result.append(buffer); 750 result.append(buffer);
739 Send(new ChildProcessHostMsg_TcmallocStats(result)); 751 Send(new ChildProcessHostMsg_TcmallocStats(result));
740 } 752 }
741 #endif 753 #endif
742 754
(...skipping 29 matching lines...) Expand all
772 void ChildThreadImpl::EnsureConnected() { 784 void ChildThreadImpl::EnsureConnected() {
773 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; 785 VLOG(0) << "ChildThreadImpl::EnsureConnected()";
774 base::Process::Current().Terminate(0, false); 786 base::Process::Current().Terminate(0, false);
775 } 787 }
776 788
777 bool ChildThreadImpl::IsInBrowserProcess() const { 789 bool ChildThreadImpl::IsInBrowserProcess() const {
778 return browser_process_io_runner_; 790 return browser_process_io_runner_;
779 } 791 }
780 792
781 } // namespace content 793 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698