Index: mojo/service_manager/service_manager_unittest.cc |
diff --git a/mojo/service_manager/service_manager_unittest.cc b/mojo/service_manager/service_manager_unittest.cc |
index 0e6b0695a3f0ca27b0bf5bebbda3657d3892c4f1..3d21dc80277d28d741e2f6f117726a1c2141cd16 100644 |
--- a/mojo/service_manager/service_manager_unittest.cc |
+++ b/mojo/service_manager/service_manager_unittest.cc |
@@ -24,24 +24,28 @@ struct TestContext { |
int num_loader_deletes; |
}; |
-class TestServiceImpl : |
- public ServiceConnection<TestService, TestServiceImpl, TestContext> { |
+class TestServiceImpl : public InterfaceImpl<TestService> { |
public: |
+ explicit TestServiceImpl(TestContext* context) : context_(context) { |
+ ++context_->num_impls; |
+ } |
+ |
virtual ~TestServiceImpl() { |
- if (context()) |
- --context()->num_impls; |
+ --context_->num_impls; |
} |
- void Initialize() { |
- if (context()) |
- ++context()->num_impls; |
+ // InterfaceImpl<TestService> implementation. |
+ virtual void OnConnectionError() OVERRIDE { |
} |
// TestService implementation: |
virtual void Test(const mojo::String& test_string) OVERRIDE { |
- context()->last_test_string = test_string.To<std::string>(); |
+ context_->last_test_string = test_string.To<std::string>(); |
client()->AckTest(); |
} |
+ |
+ private: |
+ TestContext* context_; |
}; |
class TestClientImpl : public TestClient { |
@@ -98,8 +102,7 @@ class TestServiceLoader : public ServiceLoader { |
ScopedMessagePipeHandle shell_handle) OVERRIDE { |
++num_loads_; |
test_app_.reset(new Application(shell_handle.Pass())); |
- test_app_->AddServiceConnector( |
- new ServiceConnector<TestServiceImpl, TestContext>(context_)); |
+ test_app_->AddService<TestServiceImpl>(context_); |
} |
virtual void OnServiceError(ServiceManager* manager, |