| 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 a371f956aced3c3fdddd400232791453bfd4a773..e6466b1fc74294e4f6b49a75df366917d440f545 100644
|
| --- a/mojo/service_manager/service_manager_unittest.cc
|
| +++ b/mojo/service_manager/service_manager_unittest.cc
|
| @@ -24,31 +24,32 @@ struct TestContext {
|
| int num_loader_deletes;
|
| };
|
|
|
| -class TestServiceImpl :
|
| - public ServiceConnection<TestService, TestServiceImpl, TestContext> {
|
| +class TestServiceImpl : public InterfaceImpl<TestService> {
|
| public:
|
| - TestServiceImpl() : client_(NULL) {}
|
| + TestServiceImpl(TestContext* context) : context_(context), client_(NULL) {
|
| + ++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 SetClient(TestClient* client) OVERRIDE {
|
| client_ = client;
|
| }
|
| +
|
| 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_;
|
| TestClient* client_;
|
| };
|
|
|
| @@ -106,8 +107,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,
|
|
|