OLD | NEW |
---|---|
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_ps_metafile_cairo.h" | 5 #include "printing/pdf_ps_metafile_cairo.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <cairo.h> | 9 #include <cairo.h> |
10 #include <cairo-pdf.h> | 10 #include <cairo-pdf.h> |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
351 return false; | 351 return false; |
352 } | 352 } |
353 | 353 |
354 bool success = true; | 354 bool success = true; |
355 if (file_util::WriteFileDescriptor(fd.fd, all_pages_.data(), | 355 if (file_util::WriteFileDescriptor(fd.fd, all_pages_.data(), |
356 GetDataSize()) < 0) { | 356 GetDataSize()) < 0) { |
357 DLOG(ERROR) << "Failed to save file with fd " << fd.fd; | 357 DLOG(ERROR) << "Failed to save file with fd " << fd.fd; |
358 success = false; | 358 success = false; |
359 } | 359 } |
360 | 360 |
361 if (fd.auto_close) | 361 if (fd.auto_close) { |
362 HANDLE_EINTR(close(fd.fd)); | 362 if (HANDLE_EINTR(close(fd.fd)) < 0) |
willchan no longer on Chromium
2010/03/30 17:13:18
It's probably a good idea to PLOG here too.
| |
363 success = false; | |
364 } | |
365 | |
363 return success; | 366 return success; |
364 } | 367 } |
365 | 368 |
366 void PdfPsMetafile::CleanUpAll() { | 369 void PdfPsMetafile::CleanUpAll() { |
367 CleanUpContext(&context_); | 370 CleanUpContext(&context_); |
368 CleanUpSurface(&surface_); | 371 CleanUpSurface(&surface_); |
369 CleanUpContext(&page_context_); | 372 CleanUpContext(&page_context_); |
370 CleanUpSurface(&page_surface_); | 373 CleanUpSurface(&page_surface_); |
371 current_page_.clear(); | 374 current_page_.clear(); |
372 all_pages_.clear(); | 375 all_pages_.clear(); |
373 skia::VectorPlatformDevice::ClearFontCache(); | 376 skia::VectorPlatformDevice::ClearFontCache(); |
374 } | 377 } |
375 | 378 |
376 } // namespace printing | 379 } // namespace printing |
OLD | NEW |