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

Unified Diff: mojo/services/test_service/test_service_impl.cc

Issue 336483003: Mojo: Make the TestService quit when there are no more connections. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops, forgot some stuff Created 6 years, 6 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 | « mojo/services/test_service/test_service_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/test_service/test_service_impl.cc
diff --git a/mojo/services/test_service/test_service_impl.cc b/mojo/services/test_service/test_service_impl.cc
index b4e9c35dc97d53ce1691b7fe3d683f806dbbfc6e..a38d619d90e2c2bec41c693bce2b837fc09f53e2 100644
--- a/mojo/services/test_service/test_service_impl.cc
+++ b/mojo/services/test_service/test_service_impl.cc
@@ -4,15 +4,26 @@
#include "mojo/services/test_service/test_service_impl.h"
+#include "mojo/services/test_service/test_service_application.h"
+
namespace mojo {
namespace test {
-TestServiceImpl::TestServiceImpl() {
+TestServiceImpl::TestServiceImpl(TestServiceApplication* application)
+ : application_(application) {
}
TestServiceImpl::~TestServiceImpl() {
}
+void TestServiceImpl::OnConnectionEstablished() {
+ application_->AddRef();
+}
+
+void TestServiceImpl::OnConnectionError() {
+ application_->ReleaseRef();
+}
+
void TestServiceImpl::Ping(const mojo::Callback<void()>& callback) {
callback.Run();
}
« no previous file with comments | « mojo/services/test_service/test_service_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698