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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/mojo_services.gypi ('k') | mojo/services/test_service/test_service_application.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_SERVICES_TEST_SERVICE_TEST_SERVICE_APPLICATION_H_
6 #define MOJO_SERVICES_TEST_SERVICE_TEST_SERVICE_APPLICATION_H_
7
5 #include "mojo/public/cpp/application/application.h" 8 #include "mojo/public/cpp/application/application.h"
6 #include "mojo/public/cpp/system/macros.h" 9 #include "mojo/public/cpp/system/macros.h"
7 #include "mojo/services/test_service/test_service_impl.h"
8 10
9 namespace mojo { 11 namespace mojo {
10 namespace test { 12 namespace test {
11 namespace {
12 13
13 class TestServiceApplication : public Application { 14 class TestServiceApplication : public Application {
14 public: 15 public:
15 TestServiceApplication() {} 16 TestServiceApplication();
16 virtual ~TestServiceApplication() {} 17 virtual ~TestServiceApplication();
17 18
18 virtual void Initialize() MOJO_OVERRIDE { 19 virtual void Initialize() MOJO_OVERRIDE;
19 AddService<TestServiceImpl>(); 20
20 } 21 void AddRef();
22 void ReleaseRef();
21 23
22 private: 24 private:
25 int ref_count_;
26
23 MOJO_DISALLOW_COPY_AND_ASSIGN(TestServiceApplication); 27 MOJO_DISALLOW_COPY_AND_ASSIGN(TestServiceApplication);
24 }; 28 };
25 29
26 } // namespace
27 } // namespace test 30 } // namespace test
31 } // namespace mojo
28 32
29 // static 33 #endif // MOJO_SERVICES_TEST_SERVICE_TEST_SERVICE_APPLICATION_H_
30 Application* Application::Create() {
31 return new mojo::test::TestServiceApplication();
32 }
33
34 } // namespace mojo
OLDNEW
« 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