| 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 #ifndef PRINTING_PRINTED_DOCUMENT_H_ | 5 #ifndef PRINTING_PRINTED_DOCUMENT_H_ |
| 6 #define PRINTING_PRINTED_DOCUMENT_H_ | 6 #define PRINTING_PRINTED_DOCUMENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 class PrintedPage; | 28 class PrintedPage; |
| 29 class PrintedPagesSource; | 29 class PrintedPagesSource; |
| 30 class PrintingContext; | 30 class PrintingContext; |
| 31 | 31 |
| 32 // A collection of rendered pages. The settings are immutable. If the print | 32 // A collection of rendered pages. The settings are immutable. If the print |
| 33 // settings are changed, a new PrintedDocument must be created. | 33 // settings are changed, a new PrintedDocument must be created. |
| 34 // Warning: May be accessed from many threads at the same time. Only one thread | 34 // Warning: May be accessed from many threads at the same time. Only one thread |
| 35 // will have write access. Sensible functions are protected by a lock. | 35 // will have write access. Sensible functions are protected by a lock. |
| 36 // Warning: Once a page is loaded, it cannot be replaced. Pages may be discarded | 36 // Warning: Once a page is loaded, it cannot be replaced. Pages may be discarded |
| 37 // under low memory conditions. | 37 // under low memory conditions. |
| 38 class PrintedDocument : public base::RefCountedThreadSafe<PrintedDocument> { | 38 class PRINTING_EXPORT PrintedDocument |
| 39 : public base::RefCountedThreadSafe<PrintedDocument> { |
| 39 public: | 40 public: |
| 40 // The cookie shall be unique and has a specific relationship with its | 41 // The cookie shall be unique and has a specific relationship with its |
| 41 // originating source and settings. | 42 // originating source and settings. |
| 42 PrintedDocument(const PrintSettings& settings, | 43 PrintedDocument(const PrintSettings& settings, |
| 43 PrintedPagesSource* source, | 44 PrintedPagesSource* source, |
| 44 int cookie); | 45 int cookie); |
| 45 | 46 |
| 46 // Sets a page's data. 0-based. Takes metafile ownership. | 47 // Sets a page's data. 0-based. Takes metafile ownership. |
| 47 // Note: locks for a short amount of time. | 48 // Note: locks for a short amount of time. |
| 48 void SetPage(int page_number, Metafile* metafile, double shrink, | 49 void SetPage(int page_number, Metafile* metafile, double shrink, |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 185 |
| 185 // All the immutable members. | 186 // All the immutable members. |
| 186 const Immutable immutable_; | 187 const Immutable immutable_; |
| 187 | 188 |
| 188 DISALLOW_COPY_AND_ASSIGN(PrintedDocument); | 189 DISALLOW_COPY_AND_ASSIGN(PrintedDocument); |
| 189 }; | 190 }; |
| 190 | 191 |
| 191 } // namespace printing | 192 } // namespace printing |
| 192 | 193 |
| 193 #endif // PRINTING_PRINTED_DOCUMENT_H_ | 194 #endif // PRINTING_PRINTED_DOCUMENT_H_ |
| OLD | NEW |