diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-27 23:46:07 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-27 23:46:07 +0000 |
commit | 60745416082f8f0eebca05ad50da4bc0786f5a20 (patch) | |
tree | e07c5d861f30649fc6540396d693b34ca3834cc4 | |
parent | be8aea74b57599336df6a235dbd173fd557a7a67 (diff) | |
download | chromium_src-60745416082f8f0eebca05ad50da4bc0786f5a20.zip chromium_src-60745416082f8f0eebca05ad50da4bc0786f5a20.tar.gz chromium_src-60745416082f8f0eebca05ad50da4bc0786f5a20.tar.bz2 |
Printing: Push checking of |context| one level lower, as the different
platforms have different expectations at this level.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3418034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60728 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/printing/print_job_worker.cc | 16 | ||||
-rw-r--r-- | printing/printing_context_win.cc | 1 |
2 files changed, 3 insertions, 14 deletions
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc index cac0abf..20e51ea 100644 --- a/chrome/browser/printing/print_job_worker.cc +++ b/chrome/browser/printing/print_job_worker.cc @@ -137,9 +137,7 @@ void PrintJobWorker::StartPrinting(PrintedDocument* new_document) { DCHECK_EQ(document_, new_document); DCHECK(document_.get()); DCHECK(new_document->settings().Equals(printing_context_.settings())); -#if !defined(OS_MACOSX) - DCHECK(printing_context_.context()); -#endif + if (!document_.get() || page_number_ != PageNumber::npos() || document_ != new_document) { return; @@ -166,9 +164,7 @@ void PrintJobWorker::OnDocumentChanged(PrintedDocument* new_document) { DCHECK_EQ(page_number_, PageNumber::npos()); DCHECK(!new_document || new_document->settings().Equals(printing_context_.settings())); -#if !defined(OS_MACOSX) - DCHECK(printing_context_.context()); -#endif + if (page_number_ != PageNumber::npos()) return; @@ -182,11 +178,6 @@ void PrintJobWorker::OnNewPage() { } // message_loop() could return NULL when the print job is cancelled. DCHECK_EQ(message_loop(), MessageLoop::current()); -#if !defined(OS_MACOSX) - DCHECK(printing_context_.context()); - if (!printing_context_.context()) - return; -#endif if (page_number_ == PageNumber::npos()) { // Find first page to print. @@ -239,9 +230,6 @@ void PrintJobWorker::OnDocumentDone() { DCHECK_EQ(message_loop(), MessageLoop::current()); DCHECK_EQ(page_number_, PageNumber::npos()); DCHECK(document_.get()); -#if !defined(OS_MACOSX) - DCHECK(printing_context_.context()); -#endif if (printing_context_.DocumentDone() != PrintingContext::OK) { OnFailure(); diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc index 83ddfd4..94108cd 100644 --- a/printing/printing_context_win.cc +++ b/printing/printing_context_win.cc @@ -330,6 +330,7 @@ PrintingContext::Result PrintingContext::DocumentDone() { if (abort_printing_) return CANCEL; DCHECK(in_print_job_); + DCHECK(context_); // Inform the driver that document has ended. if (EndDoc(context_) <= 0) |