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

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

Issue 1455833005: Convert ConnectToApplication to take a params class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 1 month 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/mojo_shell_client_host.cc ('k') | device/devices_app/devices_apptest.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_shell_context.h" 5 #include "content/browser/mojo/mojo_shell_context.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 } 265 }
266 266
267 // static 267 // static
268 void MojoShellContext::ConnectToApplication( 268 void MojoShellContext::ConnectToApplication(
269 const GURL& url, 269 const GURL& url,
270 const GURL& requestor_url, 270 const GURL& requestor_url,
271 mojo::InterfaceRequest<mojo::ServiceProvider> request, 271 mojo::InterfaceRequest<mojo::ServiceProvider> request,
272 mojo::ServiceProviderPtr exposed_services, 272 mojo::ServiceProviderPtr exposed_services,
273 const mojo::shell::CapabilityFilter& filter, 273 const mojo::shell::CapabilityFilter& filter,
274 const mojo::Shell::ConnectToApplicationCallback& callback) { 274 const mojo::Shell::ConnectToApplicationCallback& callback) {
275 proxy_.Get()->ConnectToApplication(url, requestor_url, request.Pass(), 275 proxy_.Get()->ConnectToApplication(url, requestor_url,
276 exposed_services.Pass(), filter, callback); 276 request.Pass(), exposed_services.Pass(),
277 filter, callback);
277 } 278 }
278 279
279 void MojoShellContext::ConnectToApplicationOnOwnThread( 280 void MojoShellContext::ConnectToApplicationOnOwnThread(
280 const GURL& url, 281 const GURL& url,
281 const GURL& requestor_url, 282 const GURL& requestor_url,
282 mojo::InterfaceRequest<mojo::ServiceProvider> request, 283 mojo::InterfaceRequest<mojo::ServiceProvider> request,
283 mojo::ServiceProviderPtr exposed_services, 284 mojo::ServiceProviderPtr exposed_services,
284 const mojo::shell::CapabilityFilter& filter, 285 const mojo::shell::CapabilityFilter& filter,
285 const mojo::Shell::ConnectToApplicationCallback& callback) { 286 const mojo::Shell::ConnectToApplicationCallback& callback) {
286 scoped_ptr<mojo::shell::ConnectToApplicationParams> params( 287 scoped_ptr<mojo::shell::ConnectToApplicationParams> params(
287 new mojo::shell::ConnectToApplicationParams); 288 new mojo::shell::ConnectToApplicationParams);
288 params->set_source( 289 params->set_source(
289 mojo::shell::Identity(requestor_url, std::string(), 290 mojo::shell::Identity(requestor_url, std::string(),
290 mojo::shell::GetPermissiveCapabilityFilter())); 291 mojo::shell::GetPermissiveCapabilityFilter()));
291 params->SetTarget(mojo::shell::Identity(url, std::string(), filter)); 292 params->SetTarget(mojo::shell::Identity(url, std::string(), filter));
292 params->set_services(request.Pass()); 293 params->set_services(request.Pass());
293 params->set_exposed_services(exposed_services.Pass()); 294 params->set_exposed_services(exposed_services.Pass());
294 params->set_on_application_end(base::Bind(&base::DoNothing)); 295 params->set_on_application_end(base::Bind(&base::DoNothing));
295 params->set_connect_callback(callback); 296 params->set_connect_callback(callback);
296 application_manager_->ConnectToApplication(params.Pass()); 297 application_manager_->ConnectToApplication(params.Pass());
297 } 298 }
298 299
299 } // namespace content 300 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/mojo/mojo_shell_client_host.cc ('k') | device/devices_app/devices_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698