| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 uint32_t id, uint32_t user_id) override { | 141 uint32_t id, uint32_t user_id) override { |
| 142 bindings_.set_connection_error_handler( | 142 bindings_.set_connection_error_handler( |
| 143 base::Bind(&ConnectTestShellClient::OnConnectionError, | 143 base::Bind(&ConnectTestShellClient::OnConnectionError, |
| 144 base::Unretained(this))); | 144 base::Unretained(this))); |
| 145 } | 145 } |
| 146 bool AcceptConnection(Connection* connection) override { | 146 bool AcceptConnection(Connection* connection) override { |
| 147 connection->AddInterface<ShellClientFactory>(this); | 147 connection->AddInterface<ShellClientFactory>(this); |
| 148 connection->AddInterface<test::mojom::ConnectTestService>(this); | 148 connection->AddInterface<test::mojom::ConnectTestService>(this); |
| 149 return true; | 149 return true; |
| 150 } | 150 } |
| 151 bool ShellConnectionLost() override { | 151 void ShellConnectionLost() override { |
| 152 if (base::MessageLoop::current() && | 152 if (base::MessageLoop::current() && |
| 153 base::MessageLoop::current()->is_running()) { | 153 base::MessageLoop::current()->is_running()) { |
| 154 base::MessageLoop::current()->QuitWhenIdle(); | 154 base::MessageLoop::current()->QuitWhenIdle(); |
| 155 } | 155 } |
| 156 return true; | |
| 157 } | 156 } |
| 158 | 157 |
| 159 // InterfaceFactory<mojom::ShellClientFactory>: | 158 // InterfaceFactory<mojom::ShellClientFactory>: |
| 160 void Create(Connection* connection, | 159 void Create(Connection* connection, |
| 161 mojom::ShellClientFactoryRequest request) override { | 160 mojom::ShellClientFactoryRequest request) override { |
| 162 shell_client_factory_bindings_.AddBinding(this, std::move(request)); | 161 shell_client_factory_bindings_.AddBinding(this, std::move(request)); |
| 163 } | 162 } |
| 164 | 163 |
| 165 // InterfaceFactory<test::mojom::ConnectTestService>: | 164 // InterfaceFactory<test::mojom::ConnectTestService>: |
| 166 void Create(Connection* connection, | 165 void Create(Connection* connection, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 196 | 195 |
| 197 } // namespace shell | 196 } // namespace shell |
| 198 } // namespace mojo | 197 } // namespace mojo |
| 199 | 198 |
| 200 | 199 |
| 201 MojoResult MojoMain(MojoHandle shell_handle) { | 200 MojoResult MojoMain(MojoHandle shell_handle) { |
| 202 MojoResult rv = mojo::ApplicationRunner( | 201 MojoResult rv = mojo::ApplicationRunner( |
| 203 new mojo::shell::ConnectTestShellClient).Run(shell_handle); | 202 new mojo::shell::ConnectTestShellClient).Run(shell_handle); |
| 204 return rv; | 203 return rv; |
| 205 } | 204 } |
| OLD | NEW |