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

Unified Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.cc

Issue 10389186: Revert 137558 - Revert 136935 - Sometimes data is NULL. I am not sure if it's correct behavior , bu… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | « chrome/browser/ui/webui/print_preview/print_preview_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/print_preview/print_preview_handler.cc
===================================================================
--- chrome/browser/ui/webui/print_preview/print_preview_handler.cc (revision 137566)
+++ chrome/browser/ui/webui/print_preview/print_preview_handler.cc (working copy)
@@ -715,7 +715,7 @@
web_ui()->GetController());
print_preview_ui->GetPrintPreviewDataForIndex(
printing::COMPLETE_PREVIEW_DOCUMENT_INDEX, &data);
- if (data->size() > 0U && data->front()) {
+ if (data.get() && data->size() > 0U && data->front()) {
string16 print_job_title_utf16 =
preview_tab_wrapper()->print_view_manager()->RenderSourceName();
std::string print_job_title = UTF16ToUTF8(print_job_title_utf16);
@@ -841,12 +841,14 @@
print_preview_ui->GetPrintPreviewDataForIndex(
printing::COMPLETE_PREVIEW_DOCUMENT_INDEX, &data);
print_to_pdf_path_.reset(new FilePath(path));
- if (data.get())
- PostPrintToPdfTask(data);
+ PostPrintToPdfTask(data);
}
-void PrintPreviewHandler::PostPrintToPdfTask(
- scoped_refptr<base::RefCountedBytes> data) {
+void PrintPreviewHandler::PostPrintToPdfTask(base::RefCountedBytes* data) {
+ if (!data) {
+ NOTREACHED();
+ return;
+ }
printing::PreviewMetafile* metafile = new printing::PreviewMetafile;
metafile->InitFromData(static_cast<const void*>(data->front()), data->size());
// PrintToPdfCallback takes ownership of |metafile|.
« no previous file with comments | « chrome/browser/ui/webui/print_preview/print_preview_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698