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

Side by Side Diff: services/shell/tests/shutdown/shutdown_client_app.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
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 "base/macros.h" 5 #include "base/macros.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "mojo/public/c/system/main.h" 7 #include "mojo/public/c/system/main.h"
8 #include "mojo/public/cpp/bindings/binding_set.h" 8 #include "mojo/public/cpp/bindings/binding_set.h"
9 #include "services/shell/public/cpp/connector.h" 9 #include "services/shell/public/cpp/connector.h"
10 #include "services/shell/public/cpp/interface_factory.h" 10 #include "services/shell/public/cpp/interface_factory.h"
(...skipping 18 matching lines...) Expand all
29 uint32_t id) override { 29 uint32_t id) override {
30 connector_ = connector; 30 connector_ = connector;
31 } 31 }
32 32
33 bool OnConnect(Connection* connection) override { 33 bool OnConnect(Connection* connection) override {
34 connection->AddInterface<mojom::ShutdownTestClientController>(this); 34 connection->AddInterface<mojom::ShutdownTestClientController>(this);
35 return true; 35 return true;
36 } 36 }
37 37
38 // InterfaceFactory<mojom::ShutdownTestClientController>: 38 // InterfaceFactory<mojom::ShutdownTestClientController>:
39 void Create(Connection* connection, 39 void Create(const Identity& remote_identity,
40 mojom::ShutdownTestClientControllerRequest request) override { 40 mojom::ShutdownTestClientControllerRequest request) override {
41 bindings_.AddBinding(this, std::move(request)); 41 bindings_.AddBinding(this, std::move(request));
42 } 42 }
43 43
44 // mojom::ShutdownTestClientController: 44 // mojom::ShutdownTestClientController:
45 void ConnectAndWait(const ConnectAndWaitCallback& callback) override { 45 void ConnectAndWait(const ConnectAndWaitCallback& callback) override {
46 mojom::ShutdownTestServicePtr service; 46 mojom::ShutdownTestServicePtr service;
47 connector_->ConnectToInterface("mojo:shutdown_service", &service); 47 connector_->ConnectToInterface("mojo:shutdown_service", &service);
48 48
49 mojo::Binding<mojom::ShutdownTestClient> client_binding(this); 49 mojo::Binding<mojom::ShutdownTestClient> client_binding(this);
(...skipping 18 matching lines...) Expand all
68 DISALLOW_COPY_AND_ASSIGN(ShutdownClientApp); 68 DISALLOW_COPY_AND_ASSIGN(ShutdownClientApp);
69 }; 69 };
70 70
71 } // namespace shell 71 } // namespace shell
72 72
73 73
74 MojoResult MojoMain(MojoHandle shell_handle) { 74 MojoResult MojoMain(MojoHandle shell_handle) {
75 return shell::ServiceRunner(new shell::ShutdownClientApp) 75 return shell::ServiceRunner(new shell::ShutdownClientApp)
76 .Run(shell_handle); 76 .Run(shell_handle);
77 } 77 }
OLDNEW
« no previous file with comments | « services/shell/tests/shell/shell_unittest.cc ('k') | services/shell/tests/shutdown/shutdown_service_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698