Skip to content

Commit

Permalink
Printing: Push checking of |context| one level lower, as the different
Browse files Browse the repository at this point in the history
platforms have different expectations at this level.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/3475021

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60704 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
jhawkins@chromium.org committed Sep 27, 2010
1 parent 2073bd0 commit 3b52c98
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
8 changes: 1 addition & 7 deletions chrome/browser/printing/print_job_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,7 @@ void PrintJobWorker::OnDocumentDone() {
void PrintJobWorker::SpoolPage(PrintedPage& page) {
DCHECK_EQ(message_loop(), MessageLoop::current());
DCHECK_NE(page_number_, PageNumber::npos());
#if !defined(OS_MACOSX)
DCHECK(printing_context_.context());
#endif

// Signal everyone that the page is about to be printed.
NotificationTask* task = new NotificationTask();
task->Init(owner_,
Expand All @@ -280,10 +278,6 @@ void PrintJobWorker::SpoolPage(PrintedPage& page) {
return;
}

#if defined(OS_MACOSX)
// Context is only valid between NewPage and PageDone, so we only check here.
DCHECK(printing_context_.context());
#endif
// Actual printing.
document_->RenderPrintedPage(page, printing_context_.context());

Expand Down
2 changes: 2 additions & 0 deletions printing/printed_document_cairo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ void PrintedDocument::RenderPrintedPage(
}
#endif

DCHECK(context);

NOTIMPLEMENTED();
}

Expand Down
2 changes: 2 additions & 0 deletions printing/printed_document_mac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ void PrintedDocument::RenderPrintedPage(
}
#endif

DCHECK(context);

const printing::PageSetup& page_setup(
immutable_.settings_.page_setup_device_units());
gfx::Rect content_area;
Expand Down
2 changes: 2 additions & 0 deletions printing/printed_document_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ void PrintedDocument::RenderPrintedPage(
}
#endif

DCHECK(context);

const printing::PageSetup& page_setup(
immutable_.settings_.page_setup_device_units());
gfx::Rect content_area;
Expand Down
2 changes: 2 additions & 0 deletions printing/printing_context_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ PrintingContext::Result PrintingContext::NewDocument(
PrintingContext::Result PrintingContext::NewPage() {
if (abort_printing_)
return CANCEL;

DCHECK(context_);
DCHECK(in_print_job_);

// Inform the driver that the application is about to begin sending data.
Expand Down

0 comments on commit 3b52c98

Please sign in to comment.