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

Side by Side Diff: services/shell/tests/lifecycle/package.cc

Issue 2156203003: shell::ApplicationRunner -> shell::ServiceRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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
« no previous file with comments | « services/shell/tests/lifecycle/app_client.h ('k') | services/shell/tests/lifecycle/parent.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include <algorithm> 5 #include <algorithm>
6 #include <memory> 6 #include <memory>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "mojo/public/c/system/main.h" 10 #include "mojo/public/c/system/main.h"
11 #include "mojo/public/cpp/bindings/binding_set.h" 11 #include "mojo/public/cpp/bindings/binding_set.h"
12 #include "services/shell/public/cpp/application_runner.h"
13 #include "services/shell/public/cpp/service_context.h" 12 #include "services/shell/public/cpp/service_context.h"
13 #include "services/shell/public/cpp/service_runner.h"
14 #include "services/shell/public/interfaces/service_factory.mojom.h" 14 #include "services/shell/public/interfaces/service_factory.mojom.h"
15 #include "services/shell/tests/lifecycle/app_client.h" 15 #include "services/shell/tests/lifecycle/app_client.h"
16 #include "services/shell/tests/lifecycle/lifecycle_unittest.mojom.h" 16 #include "services/shell/tests/lifecycle/lifecycle_unittest.mojom.h"
17 17
18 namespace { 18 namespace {
19 19
20 class PackagedApp : public shell::Service, 20 class PackagedApp : public shell::Service,
21 public shell::InterfaceFactory<LifecycleControl>, 21 public shell::InterfaceFactory<LifecycleControl>,
22 public LifecycleControl { 22 public LifecycleControl {
23 public: 23 public:
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 }; 86 };
87 87
88 class Package 88 class Package
89 : public shell::Service, 89 : public shell::Service,
90 public shell::InterfaceFactory<shell::mojom::ServiceFactory>, 90 public shell::InterfaceFactory<shell::mojom::ServiceFactory>,
91 public shell::mojom::ServiceFactory { 91 public shell::mojom::ServiceFactory {
92 public: 92 public:
93 Package() {} 93 Package() {}
94 ~Package() override {} 94 ~Package() override {}
95 95
96 void set_runner(shell::ApplicationRunner* runner) { 96 void set_runner(shell::ServiceRunner* runner) {
97 app_client_.set_runner(runner); 97 app_client_.set_runner(runner);
98 } 98 }
99 99
100 private: 100 private:
101 // shell::test::AppClient: 101 // shell::test::AppClient:
102 bool OnConnect(shell::Connection* connection) override { 102 bool OnConnect(shell::Connection* connection) override {
103 connection->AddInterface<shell::mojom::ServiceFactory>(this); 103 connection->AddInterface<shell::mojom::ServiceFactory>(this);
104 return app_client_.OnConnect(connection); 104 return app_client_.OnConnect(connection);
105 } 105 }
106 106
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 mojo::BindingSet<shell::mojom::ServiceFactory> bindings_; 140 mojo::BindingSet<shell::mojom::ServiceFactory> bindings_;
141 std::vector<PackagedApp*> apps_; 141 std::vector<PackagedApp*> apps_;
142 142
143 DISALLOW_COPY_AND_ASSIGN(Package); 143 DISALLOW_COPY_AND_ASSIGN(Package);
144 }; 144 };
145 145
146 } // namespace 146 } // namespace
147 147
148 MojoResult MojoMain(MojoHandle shell_handle) { 148 MojoResult MojoMain(MojoHandle shell_handle) {
149 Package* package = new Package; 149 Package* package = new Package;
150 shell::ApplicationRunner runner(package); 150 shell::ServiceRunner runner(package);
151 package->set_runner(&runner); 151 package->set_runner(&runner);
152 return runner.Run(shell_handle); 152 return runner.Run(shell_handle);
153 } 153 }
OLDNEW
« no previous file with comments | « services/shell/tests/lifecycle/app_client.h ('k') | services/shell/tests/lifecycle/parent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698