| 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 <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 registry->AddInterface<test::mojom::ConnectTestService>(this); | 67 registry->AddInterface<test::mojom::ConnectTestService>(this); |
| 68 registry->AddInterface<test::mojom::BlockedInterface>(this); | 68 registry->AddInterface<test::mojom::BlockedInterface>(this); |
| 69 registry->AddInterface<test::mojom::UserIdTest>(this); | 69 registry->AddInterface<test::mojom::UserIdTest>(this); |
| 70 | 70 |
| 71 test::mojom::ConnectionStatePtr state(test::mojom::ConnectionState::New()); | 71 test::mojom::ConnectionStatePtr state(test::mojom::ConnectionState::New()); |
| 72 state->connection_remote_name = remote_info.identity.name(); | 72 state->connection_remote_name = remote_info.identity.name(); |
| 73 state->connection_remote_userid = remote_info.identity.user_id(); | 73 state->connection_remote_userid = remote_info.identity.user_id(); |
| 74 state->initialize_local_name = context()->identity().name(); | 74 state->initialize_local_name = context()->identity().name(); |
| 75 state->initialize_userid = context()->identity().user_id(); | 75 state->initialize_userid = context()->identity().user_id(); |
| 76 | 76 |
| 77 context()->connector()->ConnectToInterface(remote_info.identity, &caller_); | 77 context()->connector()->BindInterface(remote_info.identity, &caller_); |
| 78 caller_->ConnectionAccepted(std::move(state)); | 78 caller_->ConnectionAccepted(std::move(state)); |
| 79 | 79 |
| 80 return true; | 80 return true; |
| 81 } | 81 } |
| 82 | 82 |
| 83 // InterfaceFactory<test::mojom::ConnectTestService>: | 83 // InterfaceFactory<test::mojom::ConnectTestService>: |
| 84 void Create(const Identity& remote_identity, | 84 void Create(const Identity& remote_identity, |
| 85 test::mojom::ConnectTestServiceRequest request) override { | 85 test::mojom::ConnectTestServiceRequest request) override { |
| 86 bindings_.AddBinding(this, std::move(request)); | 86 bindings_.AddBinding(this, std::move(request)); |
| 87 } | 87 } |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 DISALLOW_COPY_AND_ASSIGN(ConnectTestService); | 232 DISALLOW_COPY_AND_ASSIGN(ConnectTestService); |
| 233 }; | 233 }; |
| 234 | 234 |
| 235 } // namespace service_manager | 235 } // namespace service_manager |
| 236 | 236 |
| 237 MojoResult ServiceMain(MojoHandle service_request_handle) { | 237 MojoResult ServiceMain(MojoHandle service_request_handle) { |
| 238 service_manager::ServiceRunner runner( | 238 service_manager::ServiceRunner runner( |
| 239 new service_manager::ConnectTestService); | 239 new service_manager::ConnectTestService); |
| 240 return runner.Run(service_request_handle); | 240 return runner.Run(service_request_handle); |
| 241 } | 241 } |
| OLD | NEW |