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

Unified Diff: chrome/browser/printing/print_view_manager.cc

Issue 2742853003: Properly clean up in PrintViewManager::RenderFrameCreated(). (Closed)
Patch Set: Add test Created 3 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/printing/print_view_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_view_manager.cc
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc
index 5f6053ac10928b90dfcb03fdfbddbd233abae843..59eb8f24bc47403f9077392b5f05696b8ce82960 100644
--- a/chrome/browser/printing/print_view_manager.cc
+++ b/chrome/browser/printing/print_view_manager.cc
@@ -136,7 +136,8 @@ void PrintViewManager::PrintPreviewForWebNode(content::RenderFrameHost* rfh) {
void PrintViewManager::PrintPreviewDone() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- DCHECK_NE(NOT_PREVIEWING, print_preview_state_);
+ if (print_preview_state_ == NOT_PREVIEWING)
+ return;
if (print_preview_state_ == SCRIPTED_PREVIEW) {
auto& map = g_scripted_print_preview_closure_map.Get();
@@ -161,7 +162,7 @@ void PrintViewManager::RenderFrameCreated(
void PrintViewManager::RenderFrameDeleted(
content::RenderFrameHost* render_frame_host) {
if (render_frame_host == print_preview_rfh_)
- print_preview_state_ = NOT_PREVIEWING;
+ PrintPreviewDone();
PrintViewManagerBase::RenderFrameDeleted(render_frame_host);
}
« no previous file with comments | « no previous file | chrome/browser/printing/print_view_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698