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

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

Issue 1977123002: ApplicationConnection devolution, part 2.5. (Closed) Base URL: https://github.com/domokit/mojo.git@work790_app_conn_devo_2.4
Patch Set: Created 4 years, 7 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
« no previous file with comments | « mojo/public/cpp/application/BUILD.gn ('k') | mojo/public/cpp/application/application_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/application/application_connection.h
diff --git a/mojo/public/cpp/application/application_connection.h b/mojo/public/cpp/application/application_connection.h
index 49a0da8c5068e6c1b0a2268df376d50f54c83e91..e10b7b13c26a4c1316bb35d948f0b5b76f7bbf8a 100644
--- a/mojo/public/cpp/application/application_connection.h
+++ b/mojo/public/cpp/application/application_connection.h
@@ -5,54 +5,20 @@
#ifndef MOJO_PUBLIC_APPLICATION_APPLICATION_CONNECTION_H_
#define MOJO_PUBLIC_APPLICATION_APPLICATION_CONNECTION_H_
-#include <memory>
-#include <string>
-
-#include "mojo/public/cpp/application/lib/interface_factory_connector.h"
#include "mojo/public/cpp/application/service_provider_impl.h"
-#include "mojo/public/interfaces/application/service_provider.mojom.h"
namespace mojo {
-struct ConnectionContext;
-class ServiceConnector;
-
// Represents a connection to another application. An instance of this class is
// passed to ApplicationDelegate's ConfigureIncomingConnection() method each
// time a connection is made to this app, and is returned by the
// ApplicationDelegate's ConnectToApplication() method when this app
// connects to another.
-//
-// To use, define a class that implements your specific service API (e.g.,
-// FooImpl to implement a service named Foo). Then implement an
-// InterfaceFactory<Foo> that binds instances of FooImpl to
-// InterfaceRequest<Foo>s and register that on the connection like this:
-//
-// connection->AddService(&factory);
-//
-// Or, if you have multiple factories implemented by the same type, explicitly
-// specify the interface to register the factory for:
-//
-// connection->AddService<Foo>(&my_foo_and_bar_factory_);
-// connection->AddService<Bar>(&my_foo_and_bar_factory_);
-//
-// The InterfaceFactory must outlive the ApplicationConnection.
-//
// TODO(vtl): Don't get too attached to this class. I'm going to remove it.
class ApplicationConnection {
public:
virtual ~ApplicationConnection();
- // Makes Interface available as a service to the remote application.
- // |factory| will create implementations of Interface on demand.
- template <typename Interface>
- void AddService(InterfaceFactory<Interface>* factory) {
- GetServiceProviderImpl().AddServiceForName(
- std::unique_ptr<ServiceConnector>(
- new internal::InterfaceFactoryConnector<Interface>(factory)),
- Interface::Name_);
- }
-
virtual ServiceProviderImpl& GetServiceProviderImpl() = 0;
};
« no previous file with comments | « mojo/public/cpp/application/BUILD.gn ('k') | mojo/public/cpp/application/application_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698