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

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

Issue 1844233003: Always allow ServiceRegistry to be used with UtilityProcessHosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove scoped_ptr usage. Created 4 years, 8 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 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_shell_context.h" 5 #include "content/browser/mojo/mojo_shell_context.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 void StartUtilityProcessOnIOThread( 51 void StartUtilityProcessOnIOThread(
52 mojo::InterfaceRequest<mojom::ProcessControl> request, 52 mojo::InterfaceRequest<mojom::ProcessControl> request,
53 const base::string16& process_name, 53 const base::string16& process_name,
54 bool use_sandbox) { 54 bool use_sandbox) {
55 UtilityProcessHost* process_host = 55 UtilityProcessHost* process_host =
56 UtilityProcessHost::Create(nullptr, nullptr); 56 UtilityProcessHost::Create(nullptr, nullptr);
57 process_host->SetName(process_name); 57 process_host->SetName(process_name);
58 if (!use_sandbox) 58 if (!use_sandbox)
59 process_host->DisableSandbox(); 59 process_host->DisableSandbox();
60 process_host->StartMojoMode(); 60 process_host->Start();
61 61
62 ServiceRegistry* services = process_host->GetServiceRegistry(); 62 ServiceRegistry* services = process_host->GetServiceRegistry();
63 services->ConnectToRemoteService(std::move(request)); 63 services->ConnectToRemoteService(std::move(request));
64 } 64 }
65 65
66 void OnApplicationLoaded(const std::string& name, bool success) { 66 void OnApplicationLoaded(const std::string& name, bool success) {
67 if (!success) 67 if (!success)
68 LOG(ERROR) << "Failed to launch Mojo application for " << name; 68 LOG(ERROR) << "Failed to launch Mojo application for " << name;
69 } 69 }
70 70
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 mojo::Identity source_id(requestor_name, user_id); 308 mojo::Identity source_id(requestor_name, user_id);
309 params->set_source(source_id); 309 params->set_source(source_id);
310 params->set_target(mojo::Identity(name, user_id)); 310 params->set_target(mojo::Identity(name, user_id));
311 params->set_remote_interfaces(std::move(request)); 311 params->set_remote_interfaces(std::move(request));
312 params->set_local_interfaces(std::move(exposed_services)); 312 params->set_local_interfaces(std::move(exposed_services));
313 params->set_connect_callback(callback); 313 params->set_connect_callback(callback);
314 shell_->Connect(std::move(params)); 314 shell_->Connect(std::move(params));
315 } 315 }
316 316
317 } // namespace content 317 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698