OLD | NEW |
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/application/public/cpp/lib/service_registry.h" | 5 #include "mojo/application/public/cpp/lib/service_registry.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "mojo/application/public/cpp/application_connection.h" | 8 #include "mojo/application/public/cpp/application_connection.h" |
9 #include "mojo/application/public/cpp/service_connector.h" | 9 #include "mojo/application/public/cpp/service_connector.h" |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 bool ServiceRegistry::SetServiceConnectorForName( | 45 bool ServiceRegistry::SetServiceConnectorForName( |
46 ServiceConnector* service_connector, | 46 ServiceConnector* service_connector, |
47 const std::string& interface_name) { | 47 const std::string& interface_name) { |
48 if (allow_all_interfaces_ || | 48 if (allow_all_interfaces_ || |
49 allowed_interfaces_.count(interface_name)) { | 49 allowed_interfaces_.count(interface_name)) { |
50 service_connector_registry_.SetServiceConnectorForName(service_connector, | 50 service_connector_registry_.SetServiceConnectorForName(service_connector, |
51 interface_name); | 51 interface_name); |
52 return true; | 52 return true; |
53 } | 53 } |
54 DVLOG(2) << "CapabilityFilter prevented connection to interface: " << | 54 LOG(WARNING) << "CapabilityFilter prevented connection to interface: " << |
55 interface_name; | 55 interface_name; |
56 return false; | 56 return false; |
57 } | 57 } |
58 | 58 |
59 ServiceProvider* ServiceRegistry::GetLocalServiceProvider() { | 59 ServiceProvider* ServiceRegistry::GetLocalServiceProvider() { |
60 return this; | 60 return this; |
61 } | 61 } |
62 | 62 |
63 void ServiceRegistry::SetRemoteServiceProviderConnectionErrorHandler( | 63 void ServiceRegistry::SetRemoteServiceProviderConnectionErrorHandler( |
64 const Closure& handler) { | 64 const Closure& handler) { |
(...skipping 24 matching lines...) Expand all Loading... |
89 } | 89 } |
90 | 90 |
91 void ServiceRegistry::ConnectToService(const mojo::String& service_name, | 91 void ServiceRegistry::ConnectToService(const mojo::String& service_name, |
92 ScopedMessagePipeHandle client_handle) { | 92 ScopedMessagePipeHandle client_handle) { |
93 service_connector_registry_.ConnectToService(this, service_name, | 93 service_connector_registry_.ConnectToService(this, service_name, |
94 client_handle.Pass()); | 94 client_handle.Pass()); |
95 } | 95 } |
96 | 96 |
97 } // namespace internal | 97 } // namespace internal |
98 } // namespace mojo | 98 } // namespace mojo |
OLD | NEW |