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

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

Issue 1287043004: Use CapabilityFilter to restrict what HTMLViewers can connect to. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 4 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/application/public/cpp/lib/application_impl.cc ('k') | mojo/shell/application_instance.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 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
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
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
OLDNEW
« no previous file with comments | « mojo/application/public/cpp/lib/application_impl.cc ('k') | mojo/shell/application_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698