| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 // test::mojom::BlockedInterface: | 110 // test::mojom::BlockedInterface: |
| 111 void GetTitleBlocked(const GetTitleBlockedCallback& callback) override { | 111 void GetTitleBlocked(const GetTitleBlockedCallback& callback) override { |
| 112 callback.Run("Called Blocked Interface!"); | 112 callback.Run("Called Blocked Interface!"); |
| 113 } | 113 } |
| 114 | 114 |
| 115 // test::mojom::UserIdTest: | 115 // test::mojom::UserIdTest: |
| 116 void ConnectToClassAppAsDifferentUser( | 116 void ConnectToClassAppAsDifferentUser( |
| 117 const service_manager::Identity& target, | 117 const service_manager::Identity& target, |
| 118 const ConnectToClassAppAsDifferentUserCallback& callback) override { | 118 const ConnectToClassAppAsDifferentUserCallback& callback) override { |
| 119 Connector::ConnectParams params(target); | |
| 120 std::unique_ptr<Connection> connection = | 119 std::unique_ptr<Connection> connection = |
| 121 context()->connector()->Connect(¶ms); | 120 context()->connector()->Connect(target); |
| 122 { | 121 { |
| 123 base::RunLoop loop; | 122 base::RunLoop loop; |
| 124 connection->AddConnectionCompletedClosure(loop.QuitClosure()); | 123 connection->AddConnectionCompletedClosure(loop.QuitClosure()); |
| 125 base::MessageLoop::ScopedNestableTaskAllower allow( | 124 base::MessageLoop::ScopedNestableTaskAllower allow( |
| 126 base::MessageLoop::current()); | 125 base::MessageLoop::current()); |
| 127 loop.Run(); | 126 loop.Run(); |
| 128 } | 127 } |
| 129 callback.Run(static_cast<int32_t>(connection->GetResult()), | 128 callback.Run(static_cast<int32_t>(connection->GetResult()), |
| 130 connection->GetRemoteIdentity()); | 129 connection->GetRemoteIdentity()); |
| 131 } | 130 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 DISALLOW_COPY_AND_ASSIGN(ConnectTestService); | 232 DISALLOW_COPY_AND_ASSIGN(ConnectTestService); |
| 234 }; | 233 }; |
| 235 | 234 |
| 236 } // namespace service_manager | 235 } // namespace service_manager |
| 237 | 236 |
| 238 MojoResult ServiceMain(MojoHandle service_request_handle) { | 237 MojoResult ServiceMain(MojoHandle service_request_handle) { |
| 239 service_manager::ServiceRunner runner( | 238 service_manager::ServiceRunner runner( |
| 240 new service_manager::ConnectTestService); | 239 new service_manager::ConnectTestService); |
| 241 return runner.Run(service_request_handle); | 240 return runner.Run(service_request_handle); |
| 242 } | 241 } |
| OLD | NEW |