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

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

Issue 718473003: Add mojo::Binding<Interface> for more flexible pipe<->impl binding (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rename Binding::router() -> Binding::internal_router() Created 6 years, 1 month 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
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_TIME_SERVICE_IMPL_H_ 5 #ifndef MOJO_SERVICES_TEST_SERVICE_TEST_TIME_SERVICE_IMPL_H_
6 #define MOJO_SERVICES_TEST_SERVICE_TEST_TIME_SERVICE_IMPL_H_ 6 #define MOJO_SERVICES_TEST_SERVICE_TEST_TIME_SERVICE_IMPL_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "mojo/public/cpp/bindings/interface_request.h"
10 #include "mojo/public/cpp/bindings/strong_binding.h"
9 #include "mojo/public/cpp/system/macros.h" 11 #include "mojo/public/cpp/system/macros.h"
10 #include "mojo/services/test_service/test_service.mojom.h" 12 #include "mojo/services/test_service/test_service.mojom.h"
11 13
12 namespace mojo { 14 namespace mojo {
13 15
14 class ApplicationConnection; 16 class ApplicationConnection;
15 17
16 namespace test { 18 namespace test {
17 19
18 class TestRequestTrackerClientImpl; 20 class TestRequestTrackerClientImpl;
19 21
20 class TestTimeServiceImpl : public InterfaceImpl<TestTimeService> { 22 class TestTimeServiceImpl : public TestTimeService {
21 public: 23 public:
22 explicit TestTimeServiceImpl(ApplicationConnection* application); 24 TestTimeServiceImpl(ApplicationConnection* application,
25 InterfaceRequest<TestTimeService> request);
23 ~TestTimeServiceImpl() override; 26 ~TestTimeServiceImpl() override;
24 27
25 // |TestTimeService| methods: 28 // |TestTimeService| methods:
26 void GetPartyTime( 29 void GetPartyTime(
27 const mojo::Callback<void(int64_t time_usec)>& callback) override; 30 const mojo::Callback<void(int64_t time_usec)>& callback) override;
28 void StartTrackingRequests(const mojo::Callback<void()>& callback) override; 31 void StartTrackingRequests(const mojo::Callback<void()>& callback) override;
29 32
30 private: 33 private:
31 ApplicationConnection* application_; 34 ApplicationConnection* application_;
32 scoped_ptr<TestRequestTrackerClientImpl> tracking_; 35 scoped_ptr<TestRequestTrackerClientImpl> tracking_;
36 StrongBinding<TestTimeService> binding_;
33 MOJO_DISALLOW_COPY_AND_ASSIGN(TestTimeServiceImpl); 37 MOJO_DISALLOW_COPY_AND_ASSIGN(TestTimeServiceImpl);
34 }; 38 };
35 39
36 } // namespace test 40 } // namespace test
37 } // namespace mojo 41 } // namespace mojo
38 42
39 #endif // MOJO_SERVICES_TEST_SERVICE_TEST_TIME_SERVICE_IMPL_H_ 43 #endif // MOJO_SERVICES_TEST_SERVICE_TEST_TIME_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698