summaryrefslogtreecommitdiffstats
path: root/media/mojo
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 /media/mojo
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 'media/mojo')
-rw-r--r--media/mojo/services/mojo_media_application.cc3
-rw-r--r--media/mojo/services/mojo_media_application.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/media/mojo/services/mojo_media_application.cc b/media/mojo/services/mojo_media_application.cc
index e343efd..d954bdd 100644
--- a/media/mojo/services/mojo_media_application.cc
+++ b/media/mojo/services/mojo_media_application.cc
@@ -27,7 +27,8 @@ MojoMediaApplication::~MojoMediaApplication() {}
void MojoMediaApplication::Initialize(mojo::Shell* shell,
const std::string& /* url */,
- uint32_t /* id */) {
+ uint32_t /* id */,
+ uint32_t user_id) {
shell_ = shell;
mojo_media_client_->Initialize();
}
diff --git a/media/mojo/services/mojo_media_application.h b/media/mojo/services/mojo_media_application.h
index 6cf98c9..ece3264 100644
--- a/media/mojo/services/mojo_media_application.h
+++ b/media/mojo/services/mojo_media_application.h
@@ -28,7 +28,8 @@ class MojoMediaApplication
// mojo::ShellClient implementation.
void Initialize(mojo::Shell* shell,
const std::string& url,
- uint32_t id) final;
+ uint32_t id,
+ uint32_t user_id) final;
bool AcceptConnection(mojo::Connection* connection) final;
// mojo::InterfaceFactory<interfaces::ServiceFactory> implementation.