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

Unified Diff: chrome/renderer/printing/print_web_view_helper.cc

Issue 322173002: Printing: Minor cleanup and tweaks in PrintWebViewHelper. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/printing/print_web_view_helper.cc
===================================================================
--- chrome/renderer/printing/print_web_view_helper.cc (revision 275947)
+++ chrome/renderer/printing/print_web_view_helper.cc (working copy)
@@ -1016,9 +1016,8 @@
if (print_preview_context_.last_error() != PREVIEW_ERROR_BAD_SETTING) {
Send(new PrintHostMsg_PrintPreviewInvalidPrinterSettings(
routing_id(),
- print_pages_params_.get()
- ? print_pages_params_->params.document_cookie
- : 0));
+ print_pages_params_ ?
+ print_pages_params_->params.document_cookie : 0));
notify_browser_of_print_failure_ = false; // Already sent.
}
DidFinishPrinting(FAIL_PREVIEW);
@@ -1294,7 +1293,7 @@
break;
case FAIL_PRINT:
- if (notify_browser_of_print_failure_ && print_pages_params_.get()) {
+ if (notify_browser_of_print_failure_ && print_pages_params_) {
int cookie = print_pages_params_->params.document_cookie;
Send(new PrintHostMsg_PrintingFailed(routing_id(), cookie));
}
@@ -1302,7 +1301,7 @@
case FAIL_PREVIEW:
DCHECK(is_preview_enabled_);
- int cookie = print_pages_params_.get() ?
+ int cookie = print_pages_params_ ?
print_pages_params_->params.document_cookie : 0;
if (notify_browser_of_print_failure_) {
LOG(ERROR) << "CreatePreviewDocument failed";
@@ -1497,7 +1496,7 @@
// Send the cookie so that UpdatePrintSettings can reuse PrinterQuery when
// possible.
- int cookie = print_pages_params_.get() ?
+ int cookie = print_pages_params_ ?
print_pages_params_->params.document_cookie : 0;
PrintMsg_PrintPages_Params settings;
Send(new PrintHostMsg_UpdatePrintSettings(routing_id(), cookie, *job_settings,
@@ -1618,15 +1617,13 @@
content::RenderThread::Get()->HostAllocateSharedMemoryBuffer(
buf_size).release());
- if (shared_buf.get()) {
+ if (shared_buf) {
if (shared_buf->Map(buf_size)) {
metafile->GetData(shared_buf->memory(), buf_size);
- shared_buf->GiveToProcess(base::GetCurrentProcessHandle(),
- shared_mem_handle);
- return true;
+ return shared_buf->GiveToProcess(base::GetCurrentProcessHandle(),
+ shared_mem_handle);
}
}
- NOTREACHED();
return false;
}
#endif // defined(OS_POSIX)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698