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

Unified Diff: sky/viewer/document_view.cc

Issue 783973002: Remove shutdown code from sky. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 6 years 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 | « sky/viewer/document_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/viewer/document_view.cc
diff --git a/sky/viewer/document_view.cc b/sky/viewer/document_view.cc
index 1a709e7042868d68a358e40eaef740636994480b..2d524f1aa9226136dd456a3b0f803b6c4efc0683 100644
--- a/sky/viewer/document_view.cc
+++ b/sky/viewer/document_view.cc
@@ -71,12 +71,10 @@ mojo::Target WebNavigationPolicyToNavigationTarget(
static int s_next_debugger_id = 1;
DocumentView::DocumentView(
- const base::Closure& destruction_callback,
mojo::ServiceProviderPtr provider,
mojo::URLResponsePtr response,
mojo::Shell* shell)
- : destruction_callback_(destruction_callback),
- response_(response.Pass()),
+ : response_(response.Pass()),
shell_(shell),
web_view_(NULL),
root_(NULL),
@@ -93,7 +91,6 @@ DocumentView::~DocumentView() {
web_view_->close();
if (root_)
root_->RemoveObserver(this);
- destruction_callback_.Run();
}
base::WeakPtr<DocumentView> DocumentView::GetWeakPtr() {
@@ -244,7 +241,7 @@ void DocumentView::OnViewFocusChanged(mojo::View* gained_focus,
void DocumentView::OnViewDestroyed(mojo::View* view) {
DCHECK_EQ(view, root_);
- delete this;
+ root_ = nullptr;
}
void DocumentView::OnViewInputEvent(
« no previous file with comments | « sky/viewer/document_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698