| 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/pdf_metafile_skia.h" | 5 #include "printing/pdf_metafile_skia.h" |
| 6 | 6 |
| 7 #include "base/eintr_wrapper.h" | 7 #include "base/eintr_wrapper.h" |
| 8 #include "base/file_descriptor_posix.h" | 8 #include "base/file_descriptor_posix.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 if (!pdf_doc.appendPage(data_->current_page_.get())) | 242 if (!pdf_doc.appendPage(data_->current_page_.get())) |
| 243 return NULL; | 243 return NULL; |
| 244 | 244 |
| 245 if (!pdf_doc.emitPDF(&pdf_stream)) | 245 if (!pdf_doc.emitPDF(&pdf_stream)) |
| 246 return NULL; | 246 return NULL; |
| 247 | 247 |
| 248 SkAutoDataUnref data(pdf_stream.copyToData()); | 248 SkAutoDataUnref data(pdf_stream.copyToData()); |
| 249 if (data.size() == 0) | 249 if (data.size() == 0) |
| 250 return NULL; | 250 return NULL; |
| 251 | 251 |
| 252 PdfMetafileSkia* metafile = new printing::PdfMetafileSkia; | 252 PdfMetafileSkia* metafile = new PdfMetafileSkia; |
| 253 metafile->InitFromData(data.bytes(), data.size()); | 253 metafile->InitFromData(data.bytes(), data.size()); |
| 254 return metafile; | 254 return metafile; |
| 255 } | 255 } |
| 256 | 256 |
| 257 } // namespace printing | 257 } // namespace printing |
| OLD | NEW |