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

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

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 months 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 SERVICES_TEST_SERVICE_TEST_SERVICE_IMPL_H_ 5 #ifndef SERVICES_TEST_SERVICE_TEST_SERVICE_IMPL_H_
6 #define SERVICES_TEST_SERVICE_TEST_SERVICE_IMPL_H_ 6 #define SERVICES_TEST_SERVICE_TEST_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/strong_binding.h" 11 #include "mojo/public/cpp/bindings/strong_binding.h"
12 #include "mojo/public/cpp/system/macros.h" 12 #include "mojo/public/cpp/system/macros.h"
13 #include "mojo/services/test_service/test_service.mojom.h" 13 #include "mojo/services/test_service/test_service.mojom.h"
14 14
15 namespace mojo { 15 namespace mojo {
16 class ApplicationImpl; 16 class Shell;
17 namespace test { 17 namespace test {
18 18
19 class TrackedService; 19 class TrackedService;
20 class TestServiceApplication; 20 class TestServiceApplication;
21 21
22 class TestServiceImpl : public TestService { 22 class TestServiceImpl : public TestService {
23 public: 23 public:
24 TestServiceImpl(ApplicationImpl* app_impl, 24 TestServiceImpl(Shell* shell,
25 TestServiceApplication* application, 25 TestServiceApplication* application,
26 InterfaceRequest<TestService> request); 26 InterfaceRequest<TestService> request);
27 ~TestServiceImpl() override; 27 ~TestServiceImpl() override;
28 28
29 // |TestService| methods: 29 // |TestService| methods:
30 void Ping(const mojo::Callback<void()>& callback) override; 30 void Ping(const mojo::Callback<void()>& callback) override;
31 void ConnectToAppAndGetTime( 31 void ConnectToAppAndGetTime(
32 const mojo::String& app_url, 32 const mojo::String& app_url,
33 const mojo::Callback<void(int64_t)>& callback) override; 33 const mojo::Callback<void(int64_t)>& callback) override;
34 void StartTrackingRequests(const mojo::Callback<void()>& callback) override; 34 void StartTrackingRequests(const mojo::Callback<void()>& callback) override;
35 35
36 private: 36 private:
37 TestServiceApplication* const application_; 37 TestServiceApplication* const application_;
38 ApplicationImpl* const app_impl_; 38 Shell* const shell_;
39 TestTimeServicePtr time_service_; 39 TestTimeServicePtr time_service_;
40 scoped_ptr<TrackedService> tracking_; 40 scoped_ptr<TrackedService> tracking_;
41 StrongBinding<TestService> binding_; 41 StrongBinding<TestService> binding_;
42 42
43 MOJO_DISALLOW_COPY_AND_ASSIGN(TestServiceImpl); 43 MOJO_DISALLOW_COPY_AND_ASSIGN(TestServiceImpl);
44 }; 44 };
45 45
46 } // namespace test 46 } // namespace test
47 } // namespace mojo 47 } // namespace mojo
48 48
49 #endif // SERVICES_TEST_SERVICE_TEST_SERVICE_IMPL_H_ 49 #endif // SERVICES_TEST_SERVICE_TEST_SERVICE_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/services/test_service/test_service_application.cc ('k') | mojo/services/test_service/test_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698