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

Unified Diff: mojo/application/public/cpp/application_connection.h

Issue 1244233002: Allow trusted brokers to restrict connections for spawned applications to whitelisted applications … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: mojo/application/public/cpp/application_connection.h
diff --git a/mojo/application/public/cpp/application_connection.h b/mojo/application/public/cpp/application_connection.h
index 921462f12405f35e88a146400f31a747d744f089..5fe14ef84109c2a2978e1ca41de6deaa10db4d13 100644
--- a/mojo/application/public/cpp/application_connection.h
+++ b/mojo/application/public/cpp/application_connection.h
@@ -56,9 +56,11 @@ class ApplicationConnection {
// Makes Interface available as a service to the remote application.
// |factory| will create implementations of Interface on demand.
+ // Returns true if the service was exposed, false if capability filtering
+ // from the shell prevented the service from being exposed.
template <typename Interface>
- void AddService(InterfaceFactory<Interface>* factory) {
- SetServiceConnectorForName(
+ bool AddService(InterfaceFactory<Interface>* factory) {
+ return SetServiceConnectorForName(
new internal::InterfaceFactoryConnector<Interface>(factory),
Interface::Name_);
}
@@ -99,6 +101,11 @@ class ApplicationConnection {
// value is owned by this connection.
virtual ServiceProvider* GetLocalServiceProvider() = 0;
+ // Register a handler to receive an error notification on the pipe to the
+ // remote application's service provider.
+ virtual void SetRemoteServiceProviderConnectionErrorHandler(
+ const Closure& handler) = 0;
+
protected:
virtual ~ApplicationConnection();
@@ -106,7 +113,9 @@ class ApplicationConnection {
virtual void OnCloseConnection() = 0;
private:
- virtual void SetServiceConnectorForName(ServiceConnector* service_connector,
+ // Returns true if the connector was set, false if it was not set (e.g. by
+ // some filtering policy preventing this interface from being exposed).
+ virtual bool SetServiceConnectorForName(ServiceConnector* service_connector,
const std::string& name) = 0;
// Ensures that CloseConnection can only be called once and the

Powered by Google App Engine
This is Rietveld 408576698