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

Side by Side Diff: mojo/shell/tests/package_test_package.cc

Issue 1719193003: Add a user id parameter to connections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 10 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
« no previous file with comments | « mojo/shell/tests/capability_filter_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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
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
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
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 }
OLDNEW
« no previous file with comments | « mojo/shell/tests/capability_filter_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698