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

Unified Diff: mojo/services/view_manager/view_manager_unittest.cc

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: some InterfaceProvider impls for common cases Created 6 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/services/view_manager/view_manager_unittest.cc
diff --git a/mojo/services/view_manager/view_manager_unittest.cc b/mojo/services/view_manager/view_manager_unittest.cc
index b6aee00cb68d93b79cadd3b0ac61e06a38163be6..5ab6bd479d454b249daad30dbdf3867f5c9a70ac 100644
--- a/mojo/services/view_manager/view_manager_unittest.cc
+++ b/mojo/services/view_manager/view_manager_unittest.cc
@@ -284,10 +284,9 @@ base::RunLoop* ViewManagerProxy::main_run_loop_ = NULL;
bool ViewManagerProxy::in_embed_ = false;
class TestViewManagerClientConnection
- : public InterfaceImpl<ViewManagerClient> {
+ : public InterfaceImplDeleteOnError<ViewManagerClient> {
public:
- TestViewManagerClientConnection(ApplicationConnection* app_connection) :
- connection_(&tracker_) {
+ TestViewManagerClientConnection() : connection_(&tracker_) {
tracker_.set_delegate(&connection_);
}
@@ -364,7 +363,11 @@ class TestViewManagerClientConnection
// Used with ViewManagerService::Embed(). Creates a
// TestViewManagerClientConnection, which creates and owns the ViewManagerProxy.
-class EmbedServiceLoader : public ServiceLoader, ApplicationDelegate {
+class EmbedServiceLoader
+ : public ServiceLoader,
+ ApplicationDelegate,
+ public DefaultInterfaceProvider<TestViewManagerClientConnection,
jamesr 2014/07/11 20:07:10 the EmbedServiceLoader just wants to allocate+bind
+ ViewManagerClient> {
public:
EmbedServiceLoader() {}
virtual ~EmbedServiceLoader() {}
@@ -384,7 +387,7 @@ class EmbedServiceLoader : public ServiceLoader, ApplicationDelegate {
// ApplicationDelegate
virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
OVERRIDE {
- connection->AddService<TestViewManagerClientConnection>();
+ connection->AddServiceProvider(this);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698