Inline NetLog IPv6 reachability events.
[chromium-blink-merge.git] / mojo / services / test_service / test_service_impl.h
blob475a95b3801c9d1b8c693a217a86671f91018634
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.
5 #ifndef SERVICES_TEST_SERVICE_TEST_SERVICE_IMPL_H_
6 #define SERVICES_TEST_SERVICE_TEST_SERVICE_IMPL_H_
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"
13 namespace mojo {
14 class ApplicationImpl;
15 namespace test {
17 class TrackedService;
18 class TestServiceApplication;
20 class TestServiceImpl : public TestService, ErrorHandler {
21 public:
22 TestServiceImpl(ApplicationImpl* app_impl,
23 TestServiceApplication* application,
24 InterfaceRequest<TestService> request);
25 ~TestServiceImpl() override;
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;
34 // ErrorHandler methods:
35 void OnConnectionError() override;
37 private:
38 TestServiceApplication* const application_;
39 ApplicationImpl* const app_impl_;
40 TestTimeServicePtr time_service_;
41 scoped_ptr<TrackedService> tracking_;
42 StrongBinding<TestService> binding_;
44 MOJO_DISALLOW_COPY_AND_ASSIGN(TestServiceImpl);
47 } // namespace test
48 } // namespace mojo
50 #endif // SERVICES_TEST_SERVICE_TEST_SERVICE_IMPL_H_