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

Side by Side Diff: mojo/shell/standalone/context.cc

Issue 1728083002: Extract a Connector interface from Shell that can be cloned & passed to other threads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@12uid
Patch Set: . Created 4 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "mojo/shell/standalone/context.h" 5 #include "mojo/shell/standalone/context.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 application_manager_.reset(new ApplicationManager( 150 application_manager_.reset(new ApplicationManager(
151 std::move(runner_factory), blocking_pool_.get(), true)); 151 std::move(runner_factory), blocking_pool_.get(), true));
152 152
153 shell::mojom::InterfaceProviderPtr tracing_remote_interfaces; 153 shell::mojom::InterfaceProviderPtr tracing_remote_interfaces;
154 shell::mojom::InterfaceProviderPtr tracing_local_interfaces; 154 shell::mojom::InterfaceProviderPtr tracing_local_interfaces;
155 new TracingInterfaceProvider(&tracer_, GetProxy(&tracing_local_interfaces)); 155 new TracingInterfaceProvider(&tracer_, GetProxy(&tracing_local_interfaces));
156 156
157 scoped_ptr<ConnectParams> params(new ConnectParams); 157 scoped_ptr<ConnectParams> params(new ConnectParams);
158 params->set_source(CreateShellIdentity()); 158 params->set_source(CreateShellIdentity());
159 params->set_target(Identity(GURL("mojo:tracing"), std::string(), 159 params->set_target(Identity(GURL("mojo:tracing"), std::string(),
160 mojom::Shell::kUserInherit, 160 mojom::Connector::kUserInherit,
161 GetPermissiveCapabilityFilter())); 161 GetPermissiveCapabilityFilter()));
162 params->set_remote_interfaces(GetProxy(&tracing_remote_interfaces)); 162 params->set_remote_interfaces(GetProxy(&tracing_remote_interfaces));
163 params->set_local_interfaces(std::move(tracing_local_interfaces)); 163 params->set_local_interfaces(std::move(tracing_local_interfaces));
164 application_manager_->Connect(std::move(params)); 164 application_manager_->Connect(std::move(params));
165 165
166 if (command_line.HasSwitch(tracing::kTraceStartup)) { 166 if (command_line.HasSwitch(tracing::kTraceStartup)) {
167 tracing::TraceCollectorPtr coordinator; 167 tracing::TraceCollectorPtr coordinator;
168 auto coordinator_request = GetProxy(&coordinator); 168 auto coordinator_request = GetProxy(&coordinator);
169 tracing_remote_interfaces->GetInterface( 169 tracing_remote_interfaces->GetInterface(
170 tracing::TraceCollector::Name_, coordinator_request.PassMessagePipe()); 170 tracing::TraceCollector::Name_, coordinator_request.PassMessagePipe());
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 void Context::Run(const GURL& url) { 222 void Context::Run(const GURL& url) {
223 application_manager_->SetInstanceQuitCallback( 223 application_manager_->SetInstanceQuitCallback(
224 base::Bind(&OnInstanceQuit, url)); 224 base::Bind(&OnInstanceQuit, url));
225 225
226 shell::mojom::InterfaceProviderPtr remote_interfaces; 226 shell::mojom::InterfaceProviderPtr remote_interfaces;
227 shell::mojom::InterfaceProviderPtr local_interfaces; 227 shell::mojom::InterfaceProviderPtr local_interfaces;
228 228
229 scoped_ptr<ConnectParams> params(new ConnectParams); 229 scoped_ptr<ConnectParams> params(new ConnectParams);
230 params->set_source(CreateShellIdentity()); 230 params->set_source(CreateShellIdentity());
231 params->set_target( 231 params->set_target(
232 Identity(url, std::string(), mojom::Shell::kUserRoot, 232 Identity(url, std::string(), mojom::Connector::kUserRoot,
233 GetPermissiveCapabilityFilter())); 233 GetPermissiveCapabilityFilter()));
234 params->set_remote_interfaces(GetProxy(&remote_interfaces)); 234 params->set_remote_interfaces(GetProxy(&remote_interfaces));
235 params->set_local_interfaces(std::move(local_interfaces)); 235 params->set_local_interfaces(std::move(local_interfaces));
236 application_manager_->Connect(std::move(params)); 236 application_manager_->Connect(std::move(params));
237 } 237 }
238 238
239 } // namespace shell 239 } // namespace shell
240 } // namespace mojo 240 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/runner/child/test_native_main.cc ('k') | mojo/shell/tests/application_manager_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698