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_; |