| 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/guid.h" | 8 #include "base/guid.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 base::Bind(&ConnectTestApp::OnConnectionError, | 65 base::Bind(&ConnectTestApp::OnConnectionError, |
| 66 base::Unretained(this))); | 66 base::Unretained(this))); |
| 67 standalone_bindings_.set_connection_error_handler( | 67 standalone_bindings_.set_connection_error_handler( |
| 68 base::Bind(&ConnectTestApp::OnConnectionError, | 68 base::Bind(&ConnectTestApp::OnConnectionError, |
| 69 base::Unretained(this))); | 69 base::Unretained(this))); |
| 70 registry_.AddInterface<test::mojom::ConnectTestService>(this); | 70 registry_.AddInterface<test::mojom::ConnectTestService>(this); |
| 71 registry_.AddInterface<test::mojom::StandaloneApp>(this); | 71 registry_.AddInterface<test::mojom::StandaloneApp>(this); |
| 72 registry_.AddInterface<test::mojom::BlockedInterface>(this); | 72 registry_.AddInterface<test::mojom::BlockedInterface>(this); |
| 73 registry_.AddInterface<test::mojom::UserIdTest>(this); | 73 registry_.AddInterface<test::mojom::UserIdTest>(this); |
| 74 } | 74 } |
| 75 void OnBindInterface(const ServiceInfo& source_info, | 75 void OnBindInterface(const BindSourceInfo& source_info, |
| 76 const std::string& interface_name, | 76 const std::string& interface_name, |
| 77 mojo::ScopedMessagePipeHandle interface_pipe) override { | 77 mojo::ScopedMessagePipeHandle interface_pipe) override { |
| 78 registry_.BindInterface(source_info.identity, interface_name, | 78 registry_.BindInterface(source_info.identity, interface_name, |
| 79 std::move(interface_pipe)); | 79 std::move(interface_pipe)); |
| 80 } | 80 } |
| 81 | 81 |
| 82 // InterfaceFactory<test::mojom::ConnectTestService>: | 82 // InterfaceFactory<test::mojom::ConnectTestService>: |
| 83 void Create(const Identity& remote_identity, | 83 void Create(const Identity& remote_identity, |
| 84 test::mojom::ConnectTestServiceRequest request) override { | 84 test::mojom::ConnectTestServiceRequest request) override { |
| 85 bindings_.AddBinding(this, std::move(request)); | 85 bindings_.AddBinding(this, std::move(request)); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 218 |
| 219 DISALLOW_COPY_AND_ASSIGN(ConnectTestApp); | 219 DISALLOW_COPY_AND_ASSIGN(ConnectTestApp); |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 } // namespace service_manager | 222 } // namespace service_manager |
| 223 | 223 |
| 224 MojoResult ServiceMain(MojoHandle service_request_handle) { | 224 MojoResult ServiceMain(MojoHandle service_request_handle) { |
| 225 service_manager::ServiceRunner runner(new service_manager::ConnectTestApp); | 225 service_manager::ServiceRunner runner(new service_manager::ConnectTestApp); |
| 226 return runner.Run(service_request_handle); | 226 return runner.Run(service_request_handle); |
| 227 } | 227 } |
| OLD | NEW |