| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 connection->AddInterface<test::mojom::UserIdTest>(this); | 73 connection->AddInterface<test::mojom::UserIdTest>(this); |
| 74 | 74 |
| 75 uint32_t remote_id = connection->GetRemoteInstanceID(); | 75 uint32_t remote_id = connection->GetRemoteInstanceID(); |
| 76 test::mojom::ConnectionStatePtr state(test::mojom::ConnectionState::New()); | 76 test::mojom::ConnectionStatePtr state(test::mojom::ConnectionState::New()); |
| 77 state->connection_local_name = connection->GetConnectionName(); | 77 state->connection_local_name = connection->GetConnectionName(); |
| 78 state->connection_remote_name = connection->GetRemoteIdentity().name(); | 78 state->connection_remote_name = connection->GetRemoteIdentity().name(); |
| 79 state->connection_remote_userid = connection->GetRemoteIdentity().user_id(); | 79 state->connection_remote_userid = connection->GetRemoteIdentity().user_id(); |
| 80 state->connection_remote_id = remote_id; | 80 state->connection_remote_id = remote_id; |
| 81 state->initialize_local_name = identity_.name(); | 81 state->initialize_local_name = identity_.name(); |
| 82 state->initialize_userid = identity_.user_id(); | 82 state->initialize_userid = identity_.user_id(); |
| 83 connection->GetInterface(&caller_); | 83 |
| 84 connector()->ConnectToInterface(connection->GetRemoteIdentity(), &caller_); |
| 84 caller_->ConnectionAccepted(std::move(state)); | 85 caller_->ConnectionAccepted(std::move(state)); |
| 85 | 86 |
| 86 return true; | 87 return true; |
| 87 } | 88 } |
| 88 | 89 |
| 89 // InterfaceFactory<test::mojom::ConnectTestService>: | 90 // InterfaceFactory<test::mojom::ConnectTestService>: |
| 90 void Create(const Identity& remote_identity, | 91 void Create(const Identity& remote_identity, |
| 91 test::mojom::ConnectTestServiceRequest request) override { | 92 test::mojom::ConnectTestServiceRequest request) override { |
| 92 bindings_.AddBinding(this, std::move(request)); | 93 bindings_.AddBinding(this, std::move(request)); |
| 93 } | 94 } |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 224 |
| 224 DISALLOW_COPY_AND_ASSIGN(ConnectTestService); | 225 DISALLOW_COPY_AND_ASSIGN(ConnectTestService); |
| 225 }; | 226 }; |
| 226 | 227 |
| 227 } // namespace shell | 228 } // namespace shell |
| 228 | 229 |
| 229 MojoResult ServiceMain(MojoHandle service_request_handle) { | 230 MojoResult ServiceMain(MojoHandle service_request_handle) { |
| 230 shell::ServiceRunner runner(new shell::ConnectTestService); | 231 shell::ServiceRunner runner(new shell::ConnectTestService); |
| 231 return runner.Run(service_request_handle); | 232 return runner.Run(service_request_handle); |
| 232 } | 233 } |
| OLD | NEW |