Commit 7cf8040b authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Remove a nullptr check in PrintViewManagerBase::OnPrintSettingsDone().

The PrinterQuery being passed in is never nullptr, since the caller is
written as: printer_query->SetSettings(..., printer_query).

Change-Id: I97bdd100743e35b967de8b34df6bbfed2bb80216
Reviewed-on: https://chromium-review.googlesource.com/c/1428406Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625388}
parent e5e37026
...@@ -176,10 +176,11 @@ void PrintViewManagerBase::OnPrintSettingsDone( ...@@ -176,10 +176,11 @@ void PrintViewManagerBase::OnPrintSettingsDone(
PrinterHandler::PrintCallback callback, PrinterHandler::PrintCallback callback,
scoped_refptr<printing::PrinterQuery> printer_query) { scoped_refptr<printing::PrinterQuery> printer_query) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(printer_query);
// Check if the job was cancelled. This should only happen on Windows when // Check if the job was cancelled. This should only happen on Windows when
// the system dialog is cancelled. // the system dialog is cancelled.
if (printer_query && if (printer_query->last_status() == PrintingContext::CANCEL) {
printer_query->last_status() == PrintingContext::CANCEL) {
queue_->QueuePrinterQuery(printer_query.get()); queue_->QueuePrinterQuery(printer_query.get());
#if defined(OS_WIN) #if defined(OS_WIN)
base::PostTaskWithTraits( base::PostTaskWithTraits(
...@@ -191,8 +192,7 @@ void PrintViewManagerBase::OnPrintSettingsDone( ...@@ -191,8 +192,7 @@ void PrintViewManagerBase::OnPrintSettingsDone(
return; return;
} }
if (!printer_query || !printer_query->cookie() || if (!printer_query->cookie() || !printer_query->settings().dpi()) {
!printer_query->settings().dpi()) {
if (printer_query) if (printer_query)
printer_query->StopWorker(); printer_query->StopWorker();
std::move(callback).Run(base::Value("Update settings failed")); std::move(callback).Run(base::Value("Update settings failed"));
......
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