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

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..22986d50f359132af93b5534e52477428f0b52c5 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. Use as a proxy for knowledge of when
+ // the underlying application connection is destroyed.
+ virtual void SetConnectionErrorHandler(const Closure& handler) = 0;
sky 2015/07/24 15:36:55 Do you think this should be SetServiceProviderConn
+
protected:
virtual ~ApplicationConnection();
@@ -106,7 +113,7 @@ class ApplicationConnection {
virtual void OnCloseConnection() = 0;
private:
- virtual void SetServiceConnectorForName(ServiceConnector* service_connector,
+ virtual bool SetServiceConnectorForName(ServiceConnector* service_connector,
sky 2015/07/24 15:36:55 Document return value.
const std::string& name) = 0;
// Ensures that CloseConnection can only be called once and the

Powered by Google App Engine
This is Rietveld 408576698