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

Unified Diff: services/shell/public/cpp/shell_connection.h

Issue 1920033005: services/shell: Fix running the connection-lost callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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/shell/public/cpp/lib/shell_connection.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/shell/public/cpp/shell_connection.h
diff --git a/services/shell/public/cpp/shell_connection.h b/services/shell/public/cpp/shell_connection.h
index 7f8928bb76514dd75805ad91b6f12f8954df05e7..f2f0cfc51293b7dc71ecd8cd27f94b1cacf500be 100644
--- a/services/shell/public/cpp/shell_connection.h
+++ b/services/shell/public/cpp/shell_connection.h
@@ -63,9 +63,9 @@ class ShellConnection : public mojom::ShellClient {
void SetAppTestConnectorForTesting(mojom::ConnectorPtr connector);
// Specify a function to be called when the connection to the shell is lost.
- void set_connection_lost_closure(const base::Closure& closure) {
- connection_lost_closure_ = closure;
- }
+ // Note that if connection has already been lost, then |closure| is called
+ // immediately.
+ void SetConnectionLostClosure(const base::Closure& closure);
private:
// mojom::ShellClient:
@@ -95,6 +95,7 @@ class ShellConnection : public mojom::ShellClient {
mojo::Binding<mojom::ShellClient> binding_;
std::unique_ptr<Connector> connector_;
shell::Identity identity_;
+ bool should_run_connection_lost_closure_ = false;
base::Closure connection_lost_closure_;
« no previous file with comments | « services/shell/public/cpp/lib/shell_connection.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698