summaryrefslogtreecommitdiffstats
path: root/mojo
diff options
context:
space:
mode:
authorsky <sky@chromium.org>2016-03-23 15:31:15 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-23 22:33:01 +0000
commit8526ab53583e2cc6390fb4693132b151d2481ea1 (patch)
treed4a105ec267367eed33a78fe5404628a2b01a108 /mojo
parent3b37c45d6def3adbe958ab5a02433a537c8a9ca3 (diff)
downloadchromium_src-8526ab53583e2cc6390fb4693132b151d2481ea1.zip
chromium_src-8526ab53583e2cc6390fb4693132b151d2481ea1.tar.gz
chromium_src-8526ab53583e2cc6390fb4693132b151d2481ea1.tar.bz2
Changes lifetime of apps with the "all_users" capability
This changes makes it so "all_users" apps are owned by the shell. BUG=597385 TEST=none R=ben@chromium.org Review URL: https://codereview.chromium.org/1831623002 Cr-Commit-Position: refs/heads/master@{#382951}
Diffstat (limited to 'mojo')
-rw-r--r--mojo/shell/shell.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/mojo/shell/shell.cc b/mojo/shell/shell.cc
index c480e91..63ee453 100644
--- a/mojo/shell/shell.cc
+++ b/mojo/shell/shell.cc
@@ -712,14 +712,21 @@ void Shell::OnGotResolvedName(mojom::ShellResolverPtr resolver,
// Clients that request "all_users" class from the shell are allowed to
// field connection requests from any user. They also run with a synthetic
// user id generated here. The user id provided via Connect() is ignored.
+ // Additionally apps with the "all_users" class are not tied to the lifetime
+ // of the app that connected to them, instead they are owned by the shell.
+ Identity source_identity_for_creation;
if (HasClass(capabilities, kCapabilityClass_AllUsers)) {
singletons_.insert(target.name());
target.set_user_id(base::GenerateGUID());
+ source_identity_for_creation = CreateShellIdentity();
+ } else {
+ source_identity_for_creation = params->source();
}
mojom::ClientProcessConnectionPtr client_process_connection =
params->TakeClientProcessConnection();
- Instance* instance = CreateInstance(params->source(), target, capabilities);
+ Instance* instance = CreateInstance(source_identity_for_creation,
+ target, capabilities);
// Below are various paths through which a new Instance can be bound to a
// ShellClient proxy.