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

Side by Side Diff: mojo/public/cpp/application/lib/service_registry.cc

Issue 1682113003: Mojo C++ bindings: Generate InterfaceHandle<> instead of InterfacePtr<>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase ontop of master, address trung's comments Created 4 years, 10 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 | « mojo/public/cpp/application/lib/service_registry.h ('k') | mojo/public/cpp/bindings/binding.h » ('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 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 "mojo/public/cpp/application/lib/service_registry.h" 5 #include "mojo/public/cpp/application/lib/service_registry.h"
6 6
7 #include "mojo/public/cpp/application/application_connection.h" 7 #include "mojo/public/cpp/application/application_connection.h"
8 #include "mojo/public/cpp/application/application_impl.h" 8 #include "mojo/public/cpp/application/application_impl.h"
9 #include "mojo/public/cpp/application/service_connector.h" 9 #include "mojo/public/cpp/application/service_connector.h"
10 10
11 namespace mojo { 11 namespace mojo {
12 namespace internal { 12 namespace internal {
13 13
14 ServiceRegistry::ServiceRegistry( 14 ServiceRegistry::ServiceRegistry(
15 ApplicationImpl* application_impl, 15 ApplicationImpl* application_impl,
16 const std::string& connection_url, 16 const std::string& connection_url,
17 const std::string& remote_url, 17 const std::string& remote_url,
18 ServiceProviderPtr remote_services, 18 InterfaceHandle<ServiceProvider> remote_services,
19 InterfaceRequest<ServiceProvider> local_services) 19 InterfaceRequest<ServiceProvider> local_services)
20 : application_impl_(application_impl), 20 : application_impl_(application_impl),
21 connection_url_(connection_url), 21 connection_url_(connection_url),
22 remote_url_(remote_url), 22 remote_url_(remote_url),
23 local_binding_(this), 23 local_binding_(this),
24 remote_service_provider_(remote_services.Pass()) { 24 remote_service_provider_(
25 ServiceProviderPtr::Create(std::move(remote_services))) {
25 if (local_services.is_pending()) 26 if (local_services.is_pending())
26 local_binding_.Bind(local_services.Pass()); 27 local_binding_.Bind(local_services.Pass());
27 } 28 }
28 29
29 ServiceRegistry::ServiceRegistry() 30 ServiceRegistry::ServiceRegistry()
30 : application_impl_(nullptr), local_binding_(this) { 31 : application_impl_(nullptr), local_binding_(this) {
31 } 32 }
32 33
33 ServiceRegistry::~ServiceRegistry() { 34 ServiceRegistry::~ServiceRegistry() {
34 } 35 }
(...skipping 25 matching lines...) Expand all
60 } 61 }
61 62
62 void ServiceRegistry::ConnectToService(const mojo::String& service_name, 63 void ServiceRegistry::ConnectToService(const mojo::String& service_name,
63 ScopedMessagePipeHandle client_handle) { 64 ScopedMessagePipeHandle client_handle) {
64 service_connector_registry_.ConnectToService(this, service_name, 65 service_connector_registry_.ConnectToService(this, service_name,
65 &client_handle); 66 &client_handle);
66 } 67 }
67 68
68 } // namespace internal 69 } // namespace internal
69 } // namespace mojo 70 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/application/lib/service_registry.h ('k') | mojo/public/cpp/bindings/binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698