| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 state->initialize_local_name = identity_.name(); | 79 state->initialize_local_name = identity_.name(); |
| 80 state->initialize_id = id_; | 80 state->initialize_id = id_; |
| 81 state->initialize_userid = identity_.user_id(); | 81 state->initialize_userid = identity_.user_id(); |
| 82 connection->GetInterface(&caller_); | 82 connection->GetInterface(&caller_); |
| 83 caller_->ConnectionAccepted(std::move(state)); | 83 caller_->ConnectionAccepted(std::move(state)); |
| 84 | 84 |
| 85 return true; | 85 return true; |
| 86 } | 86 } |
| 87 | 87 |
| 88 // InterfaceFactory<test::mojom::ConnectTestService>: | 88 // InterfaceFactory<test::mojom::ConnectTestService>: |
| 89 void Create(Connection* connection, | 89 void Create(const Identity& remote_identity, |
| 90 test::mojom::ConnectTestServiceRequest request) override { | 90 test::mojom::ConnectTestServiceRequest request) override { |
| 91 bindings_.AddBinding(this, std::move(request)); | 91 bindings_.AddBinding(this, std::move(request)); |
| 92 } | 92 } |
| 93 | 93 |
| 94 // InterfaceFactory<test::mojom::StandaloneApp>: | 94 // InterfaceFactory<test::mojom::StandaloneApp>: |
| 95 void Create(Connection* connection, | 95 void Create(const Identity& remote_identity, |
| 96 test::mojom::StandaloneAppRequest request) override { | 96 test::mojom::StandaloneAppRequest request) override { |
| 97 standalone_bindings_.AddBinding(this, std::move(request)); | 97 standalone_bindings_.AddBinding(this, std::move(request)); |
| 98 } | 98 } |
| 99 | 99 |
| 100 // InterfaceFactory<test::mojom::BlockedInterface>: | 100 // InterfaceFactory<test::mojom::BlockedInterface>: |
| 101 void Create(Connection* connection, | 101 void Create(const Identity& remote_identity, |
| 102 test::mojom::BlockedInterfaceRequest request) override { | 102 test::mojom::BlockedInterfaceRequest request) override { |
| 103 blocked_bindings_.AddBinding(this, std::move(request)); | 103 blocked_bindings_.AddBinding(this, std::move(request)); |
| 104 } | 104 } |
| 105 | 105 |
| 106 // InterfaceFactory<test::mojom::UserIdTest>: | 106 // InterfaceFactory<test::mojom::UserIdTest>: |
| 107 void Create(Connection* connection, | 107 void Create(const Identity& remote_identity, |
| 108 test::mojom::UserIdTestRequest request) override { | 108 test::mojom::UserIdTestRequest request) override { |
| 109 user_id_test_bindings_.AddBinding(this, std::move(request)); | 109 user_id_test_bindings_.AddBinding(this, std::move(request)); |
| 110 } | 110 } |
| 111 | 111 |
| 112 // test::mojom::ConnectTestService: | 112 // test::mojom::ConnectTestService: |
| 113 void GetTitle(const GetTitleCallback& callback) override { | 113 void GetTitle(const GetTitleCallback& callback) override { |
| 114 callback.Run("APP"); | 114 callback.Run("APP"); |
| 115 } | 115 } |
| 116 void GetInstance(const GetInstanceCallback& callback) override { | 116 void GetInstance(const GetInstanceCallback& callback) override { |
| 117 callback.Run(identity_.instance()); | 117 callback.Run(identity_.instance()); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 DISALLOW_COPY_AND_ASSIGN(ConnectTestApp); | 220 DISALLOW_COPY_AND_ASSIGN(ConnectTestApp); |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 } // namespace shell | 223 } // namespace shell |
| 224 | 224 |
| 225 MojoResult MojoMain(MojoHandle shell_handle) { | 225 MojoResult MojoMain(MojoHandle shell_handle) { |
| 226 MojoResult rv = | 226 MojoResult rv = |
| 227 shell::ServiceRunner(new shell::ConnectTestApp).Run(shell_handle); | 227 shell::ServiceRunner(new shell::ConnectTestApp).Run(shell_handle); |
| 228 return rv; | 228 return rv; |
| 229 } | 229 } |
| OLD | NEW |