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

Unified Diff: mojo/services/test_service/test_service_application.h

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/mojo_services.gypi ('k') | mojo/services/test_service/test_service_application.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/test_service/test_service_application.h
diff --git a/mojo/services/test_service/test_service_application.cc b/mojo/services/test_service/test_service_application.h
similarity index 57%
copy from mojo/services/test_service/test_service_application.cc
copy to mojo/services/test_service/test_service_application.h
index c2754c21f41d0ac8f519adb6ce45e8dba268a643..9f042c1987a98c42398490310c803d3a31344735 100644
--- a/mojo/services/test_service/test_service_application.cc
+++ b/mojo/services/test_service/test_service_application.h
@@ -2,33 +2,32 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#ifndef MOJO_SERVICES_TEST_SERVICE_TEST_SERVICE_APPLICATION_H_
+#define MOJO_SERVICES_TEST_SERVICE_TEST_SERVICE_APPLICATION_H_
+
#include "mojo/public/cpp/application/application.h"
#include "mojo/public/cpp/system/macros.h"
-#include "mojo/services/test_service/test_service_impl.h"
namespace mojo {
namespace test {
-namespace {
class TestServiceApplication : public Application {
public:
- TestServiceApplication() {}
- virtual ~TestServiceApplication() {}
+ TestServiceApplication();
+ virtual ~TestServiceApplication();
+
+ virtual void Initialize() MOJO_OVERRIDE;
- virtual void Initialize() MOJO_OVERRIDE {
- AddService<TestServiceImpl>();
- }
+ void AddRef();
+ void ReleaseRef();
private:
+ int ref_count_;
+
MOJO_DISALLOW_COPY_AND_ASSIGN(TestServiceApplication);
};
-} // namespace
} // namespace test
-
-// static
-Application* Application::Create() {
- return new mojo::test::TestServiceApplication();
-}
-
} // namespace mojo
+
+#endif // MOJO_SERVICES_TEST_SERVICE_TEST_SERVICE_APPLICATION_H_
« no previous file with comments | « mojo/mojo_services.gypi ('k') | mojo/services/test_service/test_service_application.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698