blob: 74120ba0591bcc3cc05ae25133cfbb0f40a99df4 [file] [log] [blame]
[email protected]d53002f42014-01-14 16:08:561// Copyright 2014 The Chromium Authors. All rights reserved.
[email protected]b75dca82009-10-13 18:46:212// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "printing/printed_document.h"
6
[email protected]b75dca82009-10-13 18:46:217#include "base/logging.h"
[email protected]b75dca82009-10-13 18:46:218#include "printing/page_number.h"
9#include "printing/printed_page.h"
[email protected]d53002f42014-01-14 16:08:5610#include "printing/printing_context_linux.h"
[email protected]b75dca82009-10-13 18:46:2111
12namespace printing {
13
skaub7931952016-07-27 18:04:5114#if !defined(OS_ANDROID)
[email protected]b75dca82009-10-13 18:46:2115void PrintedDocument::RenderPrintedPage(
[email protected]5cc4c422011-02-19 00:09:2216 const PrintedPage& page, PrintingContext* context) const {
[email protected]b75dca82009-10-13 18:46:2117#ifndef NDEBUG
18 {
19 // Make sure the page is from our list.
[email protected]20305ec2011-01-21 04:55:5220 base::AutoLock lock(lock_);
[email protected]b75dca82009-10-13 18:46:2121 DCHECK(&page == mutable_.pages_.find(page.page_number() - 1)->second.get());
22 }
23#endif
24
[email protected]3b52c982010-09-27 20:40:3625 DCHECK(context);
26
[email protected]da4eefd2011-03-03 23:40:2727 {
28 base::AutoLock lock(lock_);
29 if (page.page_number() - 1 == mutable_.first_page) {
vitalybuka5d1290582014-09-12 09:19:5930 static_cast<PrintingContextLinux*>(context)
31 ->PrintDocument(*page.metafile());
[email protected]da4eefd2011-03-03 23:40:2732 }
[email protected]5cc4c422011-02-19 00:09:2233 }
[email protected]b75dca82009-10-13 18:46:2134}
skaub7931952016-07-27 18:04:5135#endif // !OS_ANDROID
[email protected]b75dca82009-10-13 18:46:2136
[email protected]b75dca82009-10-13 18:46:2137} // namespace printing