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

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: simplify the profile service loader / impl 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..62da1c540718234bb25f73cb3422f2cde93e3e89 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,9 @@ 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 InterfaceProvider<ViewManagerClient> {
public:
EmbedServiceLoader() {}
virtual ~EmbedServiceLoader() {}
@@ -384,10 +385,17 @@ class EmbedServiceLoader : public ServiceLoader, ApplicationDelegate {
// ApplicationDelegate
virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
OVERRIDE {
- connection->AddService<TestViewManagerClientConnection>();
+ connection->AddServiceProvider(this);
return true;
}
+ // InterfaceProvider<ViewManagerClient>
+ virtual void BindToRequest(
+ ApplicationConnection* connection,
+ InterfaceRequest<ViewManagerClient> request) OVERRIDE {
+ mojo::BindToRequest(new TestViewManagerClientConnection, &request);
+ }
+
private:
ScopedVector<ApplicationImpl> apps_;

Powered by Google App Engine
This is Rietveld 408576698