Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(507)

Side by Side Diff: services/shell/tests/connect/connect_test_app.cc

Issue 2209943002: Eliminate outgoing InterfaceProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tracing
Patch Set: . Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 connection->AddInterface<test::mojom::UserIdTest>(this); 68 connection->AddInterface<test::mojom::UserIdTest>(this);
69 69
70 uint32_t remote_id = connection->GetRemoteInstanceID(); 70 uint32_t remote_id = connection->GetRemoteInstanceID();
71 test::mojom::ConnectionStatePtr state(test::mojom::ConnectionState::New()); 71 test::mojom::ConnectionStatePtr state(test::mojom::ConnectionState::New());
72 state->connection_local_name = connection->GetConnectionName(); 72 state->connection_local_name = connection->GetConnectionName();
73 state->connection_remote_name = connection->GetRemoteIdentity().name(); 73 state->connection_remote_name = connection->GetRemoteIdentity().name();
74 state->connection_remote_userid = connection->GetRemoteIdentity().user_id(); 74 state->connection_remote_userid = connection->GetRemoteIdentity().user_id();
75 state->connection_remote_id = remote_id; 75 state->connection_remote_id = remote_id;
76 state->initialize_local_name = identity_.name(); 76 state->initialize_local_name = identity_.name();
77 state->initialize_userid = identity_.user_id(); 77 state->initialize_userid = identity_.user_id();
78 connection->GetInterface(&caller_); 78
79 connector()->ConnectToInterface(connection->GetRemoteIdentity(), &caller_);
79 caller_->ConnectionAccepted(std::move(state)); 80 caller_->ConnectionAccepted(std::move(state));
80 81
81 return true; 82 return true;
82 } 83 }
83 84
84 // InterfaceFactory<test::mojom::ConnectTestService>: 85 // InterfaceFactory<test::mojom::ConnectTestService>:
85 void Create(const Identity& remote_identity, 86 void Create(const Identity& remote_identity,
86 test::mojom::ConnectTestServiceRequest request) override { 87 test::mojom::ConnectTestServiceRequest request) override {
87 bindings_.AddBinding(this, std::move(request)); 88 bindings_.AddBinding(this, std::move(request));
88 } 89 }
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 215
215 DISALLOW_COPY_AND_ASSIGN(ConnectTestApp); 216 DISALLOW_COPY_AND_ASSIGN(ConnectTestApp);
216 }; 217 };
217 218
218 } // namespace shell 219 } // namespace shell
219 220
220 MojoResult ServiceMain(MojoHandle service_request_handle) { 221 MojoResult ServiceMain(MojoHandle service_request_handle) {
221 shell::ServiceRunner runner(new shell::ConnectTestApp); 222 shell::ServiceRunner runner(new shell::ConnectTestApp);
222 return runner.Run(service_request_handle); 223 return runner.Run(service_request_handle);
223 } 224 }
OLDNEW
« no previous file with comments | « services/shell/standalone/context.cc ('k') | services/shell/tests/connect/connect_test_app_a_manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698