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

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

Issue 2099423002: Convert UtilityProcess to use MojoChild/ShellConnection for the shell handshake. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gpu
Patch Set: . Created 4 years, 5 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
« no previous file with comments | « content/browser/mojo/constants.cc ('k') | content/browser/mojo/mojo_shell_context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_child_connection.h" 5 #include "content/browser/mojo/mojo_child_connection.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "content/public/common/mojo_shell_connection.h" 10 #include "content/public/common/mojo_shell_connection.h"
(...skipping 17 matching lines...) Expand all
28 client.Bind(mojo::InterfacePtrInfo<shell::mojom::ShellClient>( 28 client.Bind(mojo::InterfacePtrInfo<shell::mojom::ShellClient>(
29 std::move(shell_client_pipe), 0u)); 29 std::move(shell_client_pipe), 0u));
30 shell::mojom::PIDReceiverRequest pid_receiver_request = 30 shell::mojom::PIDReceiverRequest pid_receiver_request =
31 GetProxy(&pid_receiver_); 31 GetProxy(&pid_receiver_);
32 32
33 shell::Identity target(application_name, shell::mojom::kInheritUserID, 33 shell::Identity target(application_name, shell::mojom::kInheritUserID,
34 instance_id); 34 instance_id);
35 shell::Connector::ConnectParams params(target); 35 shell::Connector::ConnectParams params(target);
36 params.set_client_process_connection(std::move(client), 36 params.set_client_process_connection(std::move(client),
37 std::move(pid_receiver_request)); 37 std::move(pid_receiver_request));
38
39 // In some unit testing scenarios a null connector is passed.
40 if (!connector)
41 return;
42
38 connection_ = connector->Connect(&params); 43 connection_ = connector->Connect(&params);
39 #if defined(OS_ANDROID) 44 #if defined(OS_ANDROID)
40 service_registry_android_ = ServiceRegistryAndroid::Create( 45 service_registry_android_ = ServiceRegistryAndroid::Create(
41 connection_->GetInterfaceRegistry(), connection_->GetRemoteInterfaces()); 46 connection_->GetInterfaceRegistry(), connection_->GetRemoteInterfaces());
42 #endif 47 #endif
43 } 48 }
44 49
45 MojoChildConnection::~MojoChildConnection() {} 50 MojoChildConnection::~MojoChildConnection() {}
46 51
47 void MojoChildConnection::SetProcessHandle(base::ProcessHandle handle) { 52 void MojoChildConnection::SetProcessHandle(base::ProcessHandle handle) {
48 DCHECK(pid_receiver_.is_bound()); 53 DCHECK(pid_receiver_.is_bound());
49 pid_receiver_->SetPID(base::GetProcId(handle)); 54 pid_receiver_->SetPID(base::GetProcId(handle));
50 pid_receiver_.reset(); 55 pid_receiver_.reset();
51 } 56 }
52 57
53 } // namespace content 58 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/mojo/constants.cc ('k') | content/browser/mojo/mojo_shell_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698