| 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 SERVICES_TEST_SERVICE_TEST_TIME_SERVICE_IMPL_H_ | 5 #ifndef SERVICES_TEST_SERVICE_TEST_TIME_SERVICE_IMPL_H_ |
| 6 #define SERVICES_TEST_SERVICE_TEST_TIME_SERVICE_IMPL_H_ | 6 #define SERVICES_TEST_SERVICE_TEST_TIME_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "mojo/public/cpp/bindings/interface_request.h" | 11 #include "mojo/public/cpp/bindings/interface_request.h" |
| 12 #include "mojo/public/cpp/bindings/strong_binding.h" | 12 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 13 #include "mojo/public/cpp/system/macros.h" | 13 #include "mojo/public/cpp/system/macros.h" |
| 14 #include "mojo/services/test_service/test_service.mojom.h" | 14 #include "mojo/services/test_service/test_service.mojom.h" |
| 15 | 15 |
| 16 namespace mojo { | 16 namespace mojo { |
| 17 | 17 |
| 18 class ApplicationConnection; | 18 class ApplicationConnection; |
| 19 class ApplicationImpl; | 19 class Shell; |
| 20 | 20 |
| 21 namespace test { | 21 namespace test { |
| 22 | 22 |
| 23 class TrackedService; | 23 class TrackedService; |
| 24 | 24 |
| 25 class TestTimeServiceImpl : public TestTimeService { | 25 class TestTimeServiceImpl : public TestTimeService { |
| 26 public: | 26 public: |
| 27 TestTimeServiceImpl(ApplicationImpl* app_impl, | 27 TestTimeServiceImpl(Shell* shell, InterfaceRequest<TestTimeService> request); |
| 28 InterfaceRequest<TestTimeService> request); | |
| 29 ~TestTimeServiceImpl() override; | 28 ~TestTimeServiceImpl() override; |
| 30 | 29 |
| 31 // |TestTimeService| methods: | 30 // |TestTimeService| methods: |
| 32 void GetPartyTime( | 31 void GetPartyTime( |
| 33 const mojo::Callback<void(int64_t time_usec)>& callback) override; | 32 const mojo::Callback<void(int64_t time_usec)>& callback) override; |
| 34 void StartTrackingRequests(const mojo::Callback<void()>& callback) override; | 33 void StartTrackingRequests(const mojo::Callback<void()>& callback) override; |
| 35 | 34 |
| 36 private: | 35 private: |
| 37 ApplicationImpl* app_impl_; | 36 Shell* shell_; |
| 38 scoped_ptr<TrackedService> tracking_; | 37 scoped_ptr<TrackedService> tracking_; |
| 39 StrongBinding<TestTimeService> binding_; | 38 StrongBinding<TestTimeService> binding_; |
| 40 MOJO_DISALLOW_COPY_AND_ASSIGN(TestTimeServiceImpl); | 39 MOJO_DISALLOW_COPY_AND_ASSIGN(TestTimeServiceImpl); |
| 41 }; | 40 }; |
| 42 | 41 |
| 43 } // namespace test | 42 } // namespace test |
| 44 } // namespace mojo | 43 } // namespace mojo |
| 45 | 44 |
| 46 #endif // SERVICES_TEST_SERVICE_TEST_TIME_SERVICE_IMPL_H_ | 45 #endif // SERVICES_TEST_SERVICE_TEST_TIME_SERVICE_IMPL_H_ |
| OLD | NEW |