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

Side by Side Diff: services/shell/background/tests/test_service.cc

Issue 2182643003: Remove shell::Connection* parameter to InterfaceFactory<T>::Create() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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/navigation/navigation.cc ('k') | services/shell/public/cpp/interface_binder.h » ('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 "mojo/public/c/system/main.h" 5 #include "mojo/public/c/system/main.h"
6 #include "mojo/public/cpp/bindings/binding_set.h" 6 #include "mojo/public/cpp/bindings/binding_set.h"
7 #include "services/shell/background/tests/test.mojom.h" 7 #include "services/shell/background/tests/test.mojom.h"
8 #include "services/shell/public/cpp/connection.h" 8 #include "services/shell/public/cpp/connection.h"
9 #include "services/shell/public/cpp/service.h" 9 #include "services/shell/public/cpp/service.h"
10 #include "services/shell/public/cpp/service_runner.h" 10 #include "services/shell/public/cpp/service_runner.h"
(...skipping 11 matching lines...) Expand all
22 // Service: 22 // Service:
23 bool OnConnect(Connection* connection) override { 23 bool OnConnect(Connection* connection) override {
24 connection->AddInterface(this); 24 connection->AddInterface(this);
25 return true; 25 return true;
26 } 26 }
27 bool OnStop() override { 27 bool OnStop() override {
28 return true; 28 return true;
29 } 29 }
30 30
31 // InterfaceFactory<mojom::TestService>: 31 // InterfaceFactory<mojom::TestService>:
32 void Create(Connection* connection, 32 void Create(const Identity& remote_identity,
33 mojo::InterfaceRequest<mojom::TestService> request) override { 33 mojo::InterfaceRequest<mojom::TestService> request) override {
34 bindings_.AddBinding(this, std::move(request)); 34 bindings_.AddBinding(this, std::move(request));
35 } 35 }
36 36
37 // mojom::TestService 37 // mojom::TestService
38 void Test(const TestCallback& callback) override { 38 void Test(const TestCallback& callback) override {
39 callback.Run(); 39 callback.Run();
40 } 40 }
41 41
42 mojo::BindingSet<mojom::TestService> bindings_; 42 mojo::BindingSet<mojom::TestService> bindings_;
43 43
44 DISALLOW_COPY_AND_ASSIGN(TestClient); 44 DISALLOW_COPY_AND_ASSIGN(TestClient);
45 }; 45 };
46 46
47 } // namespace shell 47 } // namespace shell
48 48
49 MojoResult MojoMain(MojoHandle shell_handle) { 49 MojoResult MojoMain(MojoHandle shell_handle) {
50 shell::ServiceRunner runner(new shell::TestClient); 50 shell::ServiceRunner runner(new shell::TestClient);
51 return runner.Run(shell_handle); 51 return runner.Run(shell_handle);
52 } 52 }
OLDNEW
« no previous file with comments | « services/navigation/navigation.cc ('k') | services/shell/public/cpp/interface_binder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698