Index: content/common/mojo/embedded_application_runner.h |
diff --git a/content/common/mojo/embedded_application_runner.h b/content/common/mojo/embedded_application_runner.h |
index 37b45897b9eb159ff82741b1e9b9c5d908f00fcb..737b503809f0fcbf8d18c23e838cd4058aad0160 100644 |
--- a/content/common/mojo/embedded_application_runner.h |
+++ b/content/common/mojo/embedded_application_runner.h |
@@ -10,6 +10,7 @@ |
#include "base/callback.h" |
#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
+#include "base/memory/weak_ptr.h" |
#include "base/single_thread_task_runner.h" |
#include "services/shell/public/cpp/shell_client.h" |
#include "services/shell/public/interfaces/shell_client.mojom.h" |
@@ -41,9 +42,15 @@ class EmbeddedApplicationRunner { |
// bound to the running instance. |
void BindShellClientRequest(shell::mojom::ShellClientRequest request); |
+ // Sets a callback to run after the application loses its last connection and |
+ // is torn down. |
+ void SetQuitClosure(const base::Closure& quit_closure); |
+ |
private: |
class Instance; |
+ void OnQuit(); |
+ |
// The TaskRunner on which the factory callback will be run. The |
// shell::ShellClient it returns will live and die on this TaskRunner's |
// thread. |
@@ -53,6 +60,10 @@ class EmbeddedApplicationRunner { |
// |application_task_runner_|'s thread. |
scoped_refptr<Instance> instance_; |
+ base::Closure quit_closure_; |
+ |
+ base::WeakPtrFactory<EmbeddedApplicationRunner> weak_factory_; |
+ |
DISALLOW_COPY_AND_ASSIGN(EmbeddedApplicationRunner); |
}; |