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

Unified Diff: trunk/src/mojo/service_manager/service_manager_unittest.cc

Issue 287003004: Revert 270867 "Mojo: Internalize ServiceConnector<>" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 | « trunk/src/mojo/public/cpp/shell/service.h ('k') | trunk/src/mojo/services/dbus_echo/dbus_echo_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/mojo/service_manager/service_manager_unittest.cc
===================================================================
--- trunk/src/mojo/service_manager/service_manager_unittest.cc (revision 270872)
+++ trunk/src/mojo/service_manager/service_manager_unittest.cc (working copy)
@@ -24,28 +24,24 @@
int num_loader_deletes;
};
-class TestServiceImpl : public InterfaceImpl<TestService> {
+class TestServiceImpl :
+ public ServiceConnection<TestService, TestServiceImpl, TestContext> {
public:
- explicit TestServiceImpl(TestContext* context) : context_(context) {
- ++context_->num_impls;
- }
-
virtual ~TestServiceImpl() {
- --context_->num_impls;
+ if (context())
+ --context()->num_impls;
}
- // InterfaceImpl<TestService> implementation.
- virtual void OnConnectionError() OVERRIDE {
+ void Initialize() {
+ if (context())
+ ++context()->num_impls;
}
// 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 {
@@ -102,7 +98,8 @@
ScopedMessagePipeHandle shell_handle) OVERRIDE {
++num_loads_;
test_app_.reset(new Application(shell_handle.Pass()));
- test_app_->AddService<TestServiceImpl>(context_);
+ test_app_->AddServiceConnector(
+ new ServiceConnector<TestServiceImpl, TestContext>(context_));
}
virtual void OnServiceError(ServiceManager* manager,
« no previous file with comments | « trunk/src/mojo/public/cpp/shell/service.h ('k') | trunk/src/mojo/services/dbus_echo/dbus_echo_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698