summaryrefslogtreecommitdiffstats
path: root/mash/example
diff options
context:
space:
mode:
authorben <ben@chromium.org>2016-02-23 23:50:19 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-24 07:51:20 +0000
commita16b491f249de01d84114889f2ea3a8aea966413 (patch)
treebf275c5f7a0fb4704e170b4d2aa112bec1288313 /mash/example
parent3436fa2dc73318d3dbaf6a6784d0ddee9be0243d (diff)
downloadchromium_src-a16b491f249de01d84114889f2ea3a8aea966413.zip
chromium_src-a16b491f249de01d84114889f2ea3a8aea966413.tar.gz
chromium_src-a16b491f249de01d84114889f2ea3a8aea966413.tar.bz2
Add a user id parameter to connections.
This is simply a uint32 that identifies the user running a particular instance. Note that the shell cares nothing about higher level semantic meaning/mapping of this identifier. That's for a user service to perform. An application that connects to another specifies the user id they wish the target to be run as. This can either be a specific user, the root user, or "inherit" which means either their own identity or root, whichever is available in that order. The application manager resolves "inherit" to the source identity or the root identity, and initializes & completes the connection. When a target application is initialized, the shell tells it (via Initialize()) the identity it is run as. When a target application receives an inbound connection, the shell tells it (via AcceptConnection) the identity of the caller. This allows a service run as root to service connections from other users, and create facades scoped to that user. Long term, only specific applications will be able to pass anything other than "inherit" as the user id. (e.g. the login app and the profile creator app). This isn't done in this CL. I need to add some tests for this, along with the rest of the shell stuff. TBD. R=sky@chromium.org CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation Review URL: https://codereview.chromium.org/1719193003 Cr-Commit-Position: refs/heads/master@{#377239}
Diffstat (limited to 'mash/example')
-rw-r--r--mash/example/views_examples/views_examples_application_delegate.cc3
-rw-r--r--mash/example/views_examples/views_examples_application_delegate.h2
-rw-r--r--mash/example/window_type_launcher/window_type_launcher.cc2
-rw-r--r--mash/example/window_type_launcher/window_type_launcher.h2
4 files changed, 5 insertions, 4 deletions
diff --git a/mash/example/views_examples/views_examples_application_delegate.cc b/mash/example/views_examples/views_examples_application_delegate.cc
index ccdb1af..9be2175 100644
--- a/mash/example/views_examples/views_examples_application_delegate.cc
+++ b/mash/example/views_examples/views_examples_application_delegate.cc
@@ -18,7 +18,8 @@ ViewsExamplesApplicationDelegate::~ViewsExamplesApplicationDelegate() {
void ViewsExamplesApplicationDelegate::Initialize(mojo::Shell* shell,
const std::string& url,
- uint32_t id) {
+ uint32_t id,
+ uint32_t user_id) {
tracing_.Initialize(shell, url);
aura_init_.reset(new views::AuraInit(shell, "views_mus_resources.pak"));
diff --git a/mash/example/views_examples/views_examples_application_delegate.h b/mash/example/views_examples/views_examples_application_delegate.h
index a8d9a4f..90f28ce 100644
--- a/mash/example/views_examples/views_examples_application_delegate.h
+++ b/mash/example/views_examples/views_examples_application_delegate.h
@@ -22,7 +22,7 @@ class ViewsExamplesApplicationDelegate : public mojo::ShellClient {
private:
// mojo::ShellClient:
void Initialize(mojo::Shell* shell, const std::string& url,
- uint32_t id) override;
+ uint32_t id, uint32_t user_id) override;
bool AcceptConnection(mojo::Connection* connection) override;
mojo::TracingImpl tracing_;
diff --git a/mash/example/window_type_launcher/window_type_launcher.cc b/mash/example/window_type_launcher/window_type_launcher.cc
index b8dcbb6..a5dacd0 100644
--- a/mash/example/window_type_launcher/window_type_launcher.cc
+++ b/mash/example/window_type_launcher/window_type_launcher.cc
@@ -356,7 +356,7 @@ WindowTypeLauncher::WindowTypeLauncher() {}
WindowTypeLauncher::~WindowTypeLauncher() {}
void WindowTypeLauncher::Initialize(mojo::Shell* shell, const std::string& url,
- uint32_t id) {
+ uint32_t id, uint32_t user_id) {
aura_init_.reset(new views::AuraInit(shell, "views_mus_resources.pak"));
views::WindowManagerConnection::Create(shell);
diff --git a/mash/example/window_type_launcher/window_type_launcher.h b/mash/example/window_type_launcher/window_type_launcher.h
index e1d9c6e..610c528 100644
--- a/mash/example/window_type_launcher/window_type_launcher.h
+++ b/mash/example/window_type_launcher/window_type_launcher.h
@@ -21,7 +21,7 @@ class WindowTypeLauncher : public mojo::ShellClient {
private:
// mojo::ShellClient:
void Initialize(mojo::Shell* shell, const std::string& url,
- uint32_t id) override;
+ uint32_t id, uint32_t user_id) override;
scoped_ptr<views::AuraInit> aura_init_;