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

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

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: specify ownership in the Bind call 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 #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/context_interface_provider.h"
10 #include "mojo/public/cpp/application/interface_provider.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
20 : public ApplicationDelegate,
21 public InterfaceProvider<TestTimeService> {
17 public: 22 public:
18 TestRequestTrackerApplication(); 23 TestRequestTrackerApplication();
19 virtual ~TestRequestTrackerApplication(); 24 virtual ~TestRequestTrackerApplication();
20 25
26 // ApplicationDelegate methods:
21 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) 27 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
22 MOJO_OVERRIDE; 28 MOJO_OVERRIDE;
23 29
30 // InterfaceProvider<TestTimeService> methods:
31 virtual void BindToRequest(ApplicationConnection* connection,
32 InterfaceRequest<TestTimeService> request)
33 MOJO_OVERRIDE;
34
24 private: 35 private:
25 TrackingContext context_; 36 TrackingContext context_;
37 typedef ContextInterfaceProvider<TestTrackedRequestServiceImpl,
38 TrackingContext> TestTrackedRequestProvider;
39 TestTrackedRequestProvider test_tracked_request_provider_;
40 typedef ContextInterfaceProvider<TestRequestTrackerImpl, TrackingContext>
41 TestRequestTrackerProvider;
42 TestRequestTrackerProvider test_request_tracker_provider_;
26 MOJO_DISALLOW_COPY_AND_ASSIGN(TestRequestTrackerApplication); 43 MOJO_DISALLOW_COPY_AND_ASSIGN(TestRequestTrackerApplication);
27 }; 44 };
28 45
29 } // namespace test 46 } // namespace test
30 } // namespace mojo 47 } // namespace mojo
31 48
32 #endif // MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_APPLICATION_H_ 49 #endif // MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_APPLICATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698