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

Side by Side Diff: content/browser/mojo/mojo_application_host.cc

Issue 563373002: Always activate MojoApplicationHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-landing Created 6 years, 2 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/mojo/mojo_application_host.h" 5 #include "content/browser/mojo/mojo_application_host.h"
6 6
7 #include "content/common/mojo/mojo_messages.h" 7 #include "content/common/mojo/mojo_messages.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "ipc/ipc_sender.h" 9 #include "ipc/ipc_sender.h"
10 #include "mojo/edk/embedder/platform_channel_pair.h" 10 #include "mojo/edk/embedder/platform_channel_pair.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 if (!message_pipe.is_valid()) 44 if (!message_pipe.is_valid())
45 return false; 45 return false;
46 46
47 // Forward this to the client once we know its process handle. 47 // Forward this to the client once we know its process handle.
48 client_handle_ = channel_pair.PassClientHandle(); 48 client_handle_ = channel_pair.PassClientHandle();
49 49
50 service_registry_.BindRemoteServiceProvider(message_pipe.Pass()); 50 service_registry_.BindRemoteServiceProvider(message_pipe.Pass());
51 return true; 51 return true;
52 } 52 }
53 53
54 bool MojoApplicationHost::Activate(IPC::Sender* sender, 54 void MojoApplicationHost::Activate(IPC::Sender* sender,
55 base::ProcessHandle process_handle) { 55 base::ProcessHandle process_handle) {
56 DCHECK(!did_activate_); 56 DCHECK(!did_activate_);
57 DCHECK(client_handle_.is_valid()); 57 DCHECK(client_handle_.is_valid());
58 58
59 base::PlatformFile client_file = 59 base::PlatformFile client_file =
60 PlatformFileFromScopedPlatformHandle(client_handle_.Pass()); 60 PlatformFileFromScopedPlatformHandle(client_handle_.Pass());
61 did_activate_ = sender->Send(new MojoMsg_Activate( 61 did_activate_ = sender->Send(new MojoMsg_Activate(
62 IPC::GetFileHandleForProcess(client_file, process_handle, true))); 62 IPC::GetFileHandleForProcess(client_file, process_handle, true)));
63 return did_activate_;
64 } 63 }
65 64
66 void MojoApplicationHost::WillDestroySoon() { 65 void MojoApplicationHost::WillDestroySoon() {
67 channel_init_.WillDestroySoon(); 66 channel_init_.WillDestroySoon();
68 } 67 }
69 68
70 } // namespace content 69 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/mojo/mojo_application_host.h ('k') | content/browser/renderer_host/render_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698