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"
14 class ApplicationImpl
;
18 class TestServiceApplication
;
20 class TestServiceImpl
: public TestService
{
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
;
35 TestServiceApplication
* const application_
;
36 ApplicationImpl
* const app_impl_
;
37 TestTimeServicePtr time_service_
;
38 scoped_ptr
<TrackedService
> tracking_
;
39 StrongBinding
<TestService
> binding_
;
41 MOJO_DISALLOW_COPY_AND_ASSIGN(TestServiceImpl
);
47 #endif // SERVICES_TEST_SERVICE_TEST_SERVICE_IMPL_H_