OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |