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

Side by Side Diff: mojo/services/test_service/test_request_tracker_application.cc

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix network_service_loader Created 6 years, 5 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
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 #include "mojo/services/test_service/test_request_tracker_application.h" 5 #include "mojo/services/test_service/test_request_tracker_application.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 8
9 #include "mojo/public/cpp/application/application_connection.h" 9 #include "mojo/public/cpp/application/application_connection.h"
10 #include "mojo/services/test_service/test_time_service_impl.h" 10 #include "mojo/services/test_service/test_time_service_impl.h"
11 11
12 namespace mojo { 12 namespace mojo {
13 namespace test { 13 namespace test {
14 14
15 TestRequestTrackerApplication::TestRequestTrackerApplication() { 15 TestRequestTrackerApplication::TestRequestTrackerApplication()
16 : test_tracked_request_factory_(&context_),
17 test_request_tracker_factory_(&context_) {
16 } 18 }
17 19
18 TestRequestTrackerApplication::~TestRequestTrackerApplication() { 20 TestRequestTrackerApplication::~TestRequestTrackerApplication() {
19 } 21 }
20 22
21 bool TestRequestTrackerApplication::ConfigureIncomingConnection( 23 bool TestRequestTrackerApplication::ConfigureIncomingConnection(
22 ApplicationConnection* connection) { 24 ApplicationConnection* connection) {
23 // Every instance of the service and recorder shares the context. 25 // Every instance of the service and recorder shares the context.
24 // Note, this app is single-threaded, so this is thread safe. 26 // Note, this app is single-threaded, so this is thread safe.
25 connection->AddService<TestTrackedRequestServiceImpl>(&context_); 27 connection->AddService(&test_tracked_request_factory_);
26 connection->AddService<TestRequestTrackerImpl>(&context_); 28 connection->AddService(&test_request_tracker_factory_);
27 connection->AddService<TestTimeServiceImpl>(); 29 connection->AddService(this);
28 return true; 30 return true;
29 } 31 }
30 32
33 void TestRequestTrackerApplication::Create(
34 ApplicationConnection* connection,
35 InterfaceRequest<TestTimeService> request) {
36 BindToRequest(new TestTimeServiceImpl(connection), &request);
37 }
38
31 } // namespace test 39 } // namespace test
32 40
33 // static 41 // static
34 ApplicationDelegate* ApplicationDelegate::Create() { 42 ApplicationDelegate* ApplicationDelegate::Create() {
35 return new mojo::test::TestRequestTrackerApplication(); 43 return new test::TestRequestTrackerApplication();
36 } 44 }
37 45
38 } // namespace mojo 46 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/test_service/test_request_tracker_application.h ('k') | mojo/services/test_service/test_request_tracker_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698