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

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
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..6ea31593f29bc0074d71c278f9624f1258a7d19b 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_;
Ben Goodger (Google) 2016/04/27 22:29:20 = false;
sadrul 2016/04/27 22:45:11 Done.
base::Closure connection_lost_closure_;

Powered by Google App Engine
This is Rietveld 408576698