diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-04 20:00:21 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-04 20:00:21 +0000 |
commit | 9b4dd10af7b7ba6c25dfa10e7c2d71385899d41c (patch) | |
tree | c4f2e3acf165479dfe46b878bb19f71938552322 /chrome/renderer/print_web_view_helper.cc | |
parent | c057ed7f234d1b02858fdeed7990ebff148f08b1 (diff) | |
download | chromium_src-9b4dd10af7b7ba6c25dfa10e7c2d71385899d41c.zip chromium_src-9b4dd10af7b7ba6c25dfa10e7c2d71385899d41c.tar.gz chromium_src-9b4dd10af7b7ba6c25dfa10e7c2d71385899d41c.tar.bz2 |
Print Preview: Fix crash in PrepareFrameAndViewForPrint.
BUG=90887
TEST=Find a way to trigger a print preview generation failure, then reload the print preview tab.
Review URL: http://codereview.chromium.org/7577001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95471 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/print_web_view_helper.cc')
-rw-r--r-- | chrome/renderer/print_web_view_helper.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc index 1735d90..a2c9889 100644 --- a/chrome/renderer/print_web_view_helper.cc +++ b/chrome/renderer/print_web_view_helper.cc @@ -507,7 +507,7 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { store_print_pages_params = false; int cookie = print_pages_params_->params.document_cookie; Send(new PrintHostMsg_PrintPreviewFailed(routing_id(), cookie)); - print_preview_context_.Abort(); + print_preview_context_.Failed(); } else if (result == ABORT_PREVIEW) { DCHECK(is_preview_); store_print_pages_params = false; @@ -1054,6 +1054,12 @@ void PrintWebViewHelper::PrintPreviewContext::Finished() { ClearContext(); } +void PrintWebViewHelper::PrintPreviewContext::Failed() { + DCHECK(IsBusy()); + state_ = INITIALIZED; + ClearContext(); +} + void PrintWebViewHelper::PrintPreviewContext::Abort() { state_ = UNINITIALIZED; ClearContext(); |