OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "printing/printed_document.h" | 5 #include "printing/printed_document.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 shrink)); | 78 shrink)); |
79 { | 79 { |
80 base::AutoLock lock(lock_); | 80 base::AutoLock lock(lock_); |
81 mutable_.pages_[page_number] = page; | 81 mutable_.pages_[page_number] = page; |
82 | 82 |
83 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 83 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
84 if (page_number < mutable_.first_page) | 84 if (page_number < mutable_.first_page) |
85 mutable_.first_page = page_number; | 85 mutable_.first_page = page_number; |
86 #endif | 86 #endif |
87 } | 87 } |
88 DebugDump(*page); | 88 DebugDump(*page.get()); |
89 } | 89 } |
90 | 90 |
91 bool PrintedDocument::GetPage(int page_number, | 91 bool PrintedDocument::GetPage(int page_number, |
92 scoped_refptr<PrintedPage>* page) { | 92 scoped_refptr<PrintedPage>* page) { |
93 base::AutoLock lock(lock_); | 93 base::AutoLock lock(lock_); |
94 PrintedPages::const_iterator itr = mutable_.pages_.find(page_number); | 94 PrintedPages::const_iterator itr = mutable_.pages_.find(page_number); |
95 if (itr != mutable_.pages_.end()) { | 95 if (itr != mutable_.pages_.end()) { |
96 if (itr->second.get()) { | 96 if (itr->second.get()) { |
97 *page = itr->second; | 97 *page = itr->second; |
98 return true; | 98 return true; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 226 } |
227 | 227 |
228 #if defined(OS_POSIX) && defined(USE_AURA) | 228 #if defined(OS_POSIX) && defined(USE_AURA) |
229 // This function is not used on aura linux/chromeos. | 229 // This function is not used on aura linux/chromeos. |
230 void PrintedDocument::RenderPrintedPage(const PrintedPage& page, | 230 void PrintedDocument::RenderPrintedPage(const PrintedPage& page, |
231 PrintingContext* context) const { | 231 PrintingContext* context) const { |
232 } | 232 } |
233 #endif | 233 #endif |
234 | 234 |
235 } // namespace printing | 235 } // namespace printing |
OLD | NEW |