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

Unified Diff: services/shell/shell.h

Issue 1921183003: Fixes race in Shell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 2 trunk Created 4 years, 8 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 | « services/catalog/reader.cc ('k') | services/shell/shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/shell/shell.h
diff --git a/services/shell/shell.h b/services/shell/shell.h
index f336025f562ea9efaf3d89aa95a8aecad586e669..5a3cc71e6e7fca75f26a81d328e7ab6ea3a68a0c 100644
--- a/services/shell/shell.h
+++ b/services/shell/shell.h
@@ -81,6 +81,12 @@ class Shell : public ShellClient {
void InitCatalog(mojom::ShellClientPtr catalog);
+ // Returns the resolver to use for the specified identity.
+ // NOTE: ShellResolvers are cached to ensure we service requests in order. If
+ // we use a separate ShellResolver for each request ordering is not
+ // guaranteed and can lead to random flake.
+ mojom::ShellResolver* GetResolver(const Identity& identity);
+
// Destroys all Shell-ends of connections established with Applications.
// Applications connected by this Shell will observe pipe errors and have a
// chance to shutdown.
@@ -131,8 +137,7 @@ class Shell : public ShellClient {
// |client| if provided is a ShellClientPtr which should be used to manage the
// new application instance. This may be null.
// |result| contains the result of the resolve operation.
- void OnGotResolvedName(mojom::ShellResolverPtr resolver,
- std::unique_ptr<ConnectParams> params,
+ void OnGotResolvedName(std::unique_ptr<ConnectParams> params,
mojom::ShellClientPtr client,
mojom::ResolveResultPtr result);
@@ -150,6 +155,8 @@ class Shell : public ShellClient {
// Counter used to assign ids to client factories.
uint32_t shell_client_factory_id_counter_;
+ std::map<Identity, mojom::ShellResolverPtr> identity_to_resolver_;
+
mojo::InterfacePtrSet<mojom::InstanceListener> instance_listeners_;
base::Callback<void(const Identity&)> instance_quit_callback_;
« no previous file with comments | « services/catalog/reader.cc ('k') | services/shell/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698