OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SERVICES_TEST_SERVICE_TEST_SERVICE_IMPL_H_ |
| 6 #define SERVICES_TEST_SERVICE_TEST_SERVICE_IMPL_H_ |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 10 #include "mojo/public/cpp/system/macros.h" |
| 11 #include "mojo/services/test_service/test_service.mojom.h" |
| 12 |
| 13 namespace mojo { |
| 14 class ApplicationImpl; |
| 15 namespace test { |
| 16 |
| 17 class TrackedService; |
| 18 class TestServiceApplication; |
| 19 |
| 20 class TestServiceImpl : public TestService, ErrorHandler { |
| 21 public: |
| 22 TestServiceImpl(ApplicationImpl* app_impl, |
| 23 TestServiceApplication* application, |
| 24 InterfaceRequest<TestService> request); |
| 25 ~TestServiceImpl() override; |
| 26 |
| 27 // |TestService| methods: |
| 28 void Ping(const mojo::Callback<void()>& callback) override; |
| 29 void ConnectToAppAndGetTime( |
| 30 const mojo::String& app_url, |
| 31 const mojo::Callback<void(int64_t)>& callback) override; |
| 32 void StartTrackingRequests(const mojo::Callback<void()>& callback) override; |
| 33 |
| 34 // ErrorHandler methods: |
| 35 void OnConnectionError() override; |
| 36 |
| 37 private: |
| 38 TestServiceApplication* const application_; |
| 39 ApplicationImpl* const app_impl_; |
| 40 TestTimeServicePtr time_service_; |
| 41 scoped_ptr<TrackedService> tracking_; |
| 42 StrongBinding<TestService> binding_; |
| 43 |
| 44 MOJO_DISALLOW_COPY_AND_ASSIGN(TestServiceImpl); |
| 45 }; |
| 46 |
| 47 } // namespace test |
| 48 } // namespace mojo |
| 49 |
| 50 #endif // SERVICES_TEST_SERVICE_TEST_SERVICE_IMPL_H_ |
OLD | NEW |