OLD | NEW |
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_REQUEST_TRACKER_APPLICATION_H_ | 5 #ifndef MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_APPLICATION_H_ |
6 #define MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_APPLICATION_H_ | 6 #define MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_APPLICATION_H_ |
7 | 7 |
8 #include "mojo/public/cpp/application/application_delegate.h" | 8 #include "mojo/public/cpp/application/application_delegate.h" |
| 9 #include "mojo/public/cpp/application/interface_factory.h" |
| 10 #include "mojo/public/cpp/application/interface_factory_with_context.h" |
9 #include "mojo/public/cpp/system/macros.h" | 11 #include "mojo/public/cpp/system/macros.h" |
10 #include "mojo/services/test_service/test_request_tracker_impl.h" | 12 #include "mojo/services/test_service/test_request_tracker_impl.h" |
11 | 13 |
12 namespace mojo { | 14 namespace mojo { |
13 namespace test { | 15 namespace test { |
| 16 class TestTimeService; |
14 | 17 |
15 // Embeds TestRequestTracker mojo services into an application. | 18 // Embeds TestRequestTracker mojo services into an application. |
16 class TestRequestTrackerApplication : public ApplicationDelegate { | 19 class TestRequestTrackerApplication : public ApplicationDelegate, |
| 20 public InterfaceFactory<TestTimeService> { |
17 public: | 21 public: |
18 TestRequestTrackerApplication(); | 22 TestRequestTrackerApplication(); |
19 virtual ~TestRequestTrackerApplication(); | 23 virtual ~TestRequestTrackerApplication(); |
20 | 24 |
| 25 // ApplicationDelegate methods: |
21 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) | 26 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) |
22 MOJO_OVERRIDE; | 27 MOJO_OVERRIDE; |
23 | 28 |
| 29 // InterfaceFactory<TestTimeService> methods: |
| 30 virtual void Create(ApplicationConnection* connection, |
| 31 InterfaceRequest<TestTimeService> request) MOJO_OVERRIDE; |
| 32 |
24 private: | 33 private: |
25 TrackingContext context_; | 34 TrackingContext context_; |
| 35 typedef InterfaceFactoryWithContext<TestTrackedRequestServiceImpl, |
| 36 TrackingContext> |
| 37 TestTrackedRequestFactory; |
| 38 TestTrackedRequestFactory test_tracked_request_factory_; |
| 39 typedef InterfaceFactoryWithContext<TestRequestTrackerImpl, TrackingContext> |
| 40 TestRequestTrackerFactory; |
| 41 TestRequestTrackerFactory test_request_tracker_factory_; |
26 MOJO_DISALLOW_COPY_AND_ASSIGN(TestRequestTrackerApplication); | 42 MOJO_DISALLOW_COPY_AND_ASSIGN(TestRequestTrackerApplication); |
27 }; | 43 }; |
28 | 44 |
29 } // namespace test | 45 } // namespace test |
30 } // namespace mojo | 46 } // namespace mojo |
31 | 47 |
32 #endif // MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_APPLICATION_H_ | 48 #endif // MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_APPLICATION_H_ |
OLD | NEW |