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 <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 request_(std::move(request)), | 42 request_(std::move(request)), |
43 shell_(nullptr) { | 43 shell_(nullptr) { |
44 Start(); | 44 Start(); |
45 } | 45 } |
46 ~ProvidedShellClient() override { | 46 ~ProvidedShellClient() override { |
47 Join(); | 47 Join(); |
48 } | 48 } |
49 | 49 |
50 private: | 50 private: |
51 // mojo::ShellClient: | 51 // mojo::ShellClient: |
52 void Initialize(Shell* shell, const std::string& url, uint32_t id) override { | 52 void Initialize(Shell* shell, const std::string& url, |
| 53 uint32_t id, uint32_t user_id) override { |
53 shell_ = shell; | 54 shell_ = shell; |
54 bindings_.set_connection_error_handler( | 55 bindings_.set_connection_error_handler( |
55 base::Bind(&ProvidedShellClient::OnConnectionError, | 56 base::Bind(&ProvidedShellClient::OnConnectionError, |
56 base::Unretained(this))); | 57 base::Unretained(this))); |
57 } | 58 } |
58 bool AcceptConnection(Connection* connection) override { | 59 bool AcceptConnection(Connection* connection) override { |
59 connection->AddInterface<test::mojom::PackageTestService>( | 60 connection->AddInterface<test::mojom::PackageTestService>( |
60 this); | 61 this); |
61 return true; | 62 return true; |
62 } | 63 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 public InterfaceFactory<mojom::ShellClientFactory>, | 98 public InterfaceFactory<mojom::ShellClientFactory>, |
98 public InterfaceFactory<test::mojom::PackageTestService>, | 99 public InterfaceFactory<test::mojom::PackageTestService>, |
99 public mojom::ShellClientFactory, | 100 public mojom::ShellClientFactory, |
100 public test::mojom::PackageTestService { | 101 public test::mojom::PackageTestService { |
101 public: | 102 public: |
102 PackageTestShellClient() : shell_(nullptr) {} | 103 PackageTestShellClient() : shell_(nullptr) {} |
103 ~PackageTestShellClient() override {} | 104 ~PackageTestShellClient() override {} |
104 | 105 |
105 private: | 106 private: |
106 // mojo::ShellClient: | 107 // mojo::ShellClient: |
107 void Initialize(Shell* shell, const std::string& url, uint32_t id) override { | 108 void Initialize(Shell* shell, const std::string& url, |
| 109 uint32_t id, uint32_t user_id) override { |
108 shell_ = shell; | 110 shell_ = shell; |
109 bindings_.set_connection_error_handler( | 111 bindings_.set_connection_error_handler( |
110 base::Bind(&PackageTestShellClient::OnConnectionError, | 112 base::Bind(&PackageTestShellClient::OnConnectionError, |
111 base::Unretained(this))); | 113 base::Unretained(this))); |
112 } | 114 } |
113 bool AcceptConnection(Connection* connection) override { | 115 bool AcceptConnection(Connection* connection) override { |
114 connection->AddInterface<ShellClientFactory>(this); | 116 connection->AddInterface<ShellClientFactory>(this); |
115 connection->AddInterface<test::mojom::PackageTestService>(this); | 117 connection->AddInterface<test::mojom::PackageTestService>(this); |
116 return true; | 118 return true; |
117 } | 119 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 159 |
158 } // namespace shell | 160 } // namespace shell |
159 } // namespace mojo | 161 } // namespace mojo |
160 | 162 |
161 | 163 |
162 MojoResult MojoMain(MojoHandle shell_handle) { | 164 MojoResult MojoMain(MojoHandle shell_handle) { |
163 MojoResult rv = mojo::ApplicationRunner( | 165 MojoResult rv = mojo::ApplicationRunner( |
164 new mojo::shell::PackageTestShellClient).Run(shell_handle); | 166 new mojo::shell::PackageTestShellClient).Run(shell_handle); |
165 return rv; | 167 return rv; |
166 } | 168 } |
OLD | NEW |