Index: components/html_viewer/html_document_application_delegate.cc |
diff --git a/components/html_viewer/html_document_application_delegate.cc b/components/html_viewer/html_document_application_delegate.cc |
index e57b857126da81a20c3cda62f8476c236be32a22..db537c6ba167214b2237251c847a36bf156ff969 100644 |
--- a/components/html_viewer/html_document_application_delegate.cc |
+++ b/components/html_viewer/html_document_application_delegate.cc |
@@ -56,7 +56,8 @@ HTMLDocumentApplicationDelegate::HTMLDocumentApplicationDelegate( |
mojo::InterfaceRequest<mojo::Application> request, |
mojo::URLResponsePtr response, |
GlobalState* global_state, |
- scoped_ptr<mojo::AppRefCount> parent_app_refcount) |
+ scoped_ptr<mojo::AppRefCount> parent_app_refcount, |
+ const mojo::Callback<void()>& destruct_callback) |
: app_(this, |
request.Pass(), |
base::Bind(&HTMLDocumentApplicationDelegate::OnTerminate, |
@@ -66,6 +67,7 @@ HTMLDocumentApplicationDelegate::HTMLDocumentApplicationDelegate( |
initial_response_(response.Pass()), |
global_state_(global_state), |
html_factory_(this), |
+ destruct_callback_(destruct_callback), |
weak_factory_(this) {} |
HTMLDocumentApplicationDelegate::~HTMLDocumentApplicationDelegate() { |
@@ -76,6 +78,7 @@ HTMLDocumentApplicationDelegate::~HTMLDocumentApplicationDelegate() { |
for (HTMLDocument* doc : documents2) |
doc->Destroy(); |
DCHECK(documents2_.empty()); |
+ destruct_callback_.Run(); |
} |
// Callback from the quit closure. We key off this rather than |