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

Unified Diff: mojo/shell/shell.cc

Issue 1831623002: Changes lifetime of apps with the "all_users" capability (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/shell.cc
diff --git a/mojo/shell/shell.cc b/mojo/shell/shell.cc
index c480e918d4e9ec94c7e9bdfeb49ae532f526c0c4..63ee453636b12f29ffb29e86d6dff82b9add98ff 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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698