Commit 9b4dd10a authored by thestig@chromium.org's avatar thestig@chromium.org

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
parent c057ed7f
......@@ -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();
......
......@@ -331,6 +331,9 @@ class PrintWebViewHelper : public RenderViewObserver,
// Cleanup after print preview finishes.
void Finished();
// Cleanup after print preview fails.
void Failed();
// Abort the print preview.
void Abort();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment