Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Unified Diff: printing/pdf_ps_metafile_cairo.cc

Issue 6611032: Unifying NativeMetafile class interface (as much as possible) for Linux, Mac, Win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restored pdf_ps_metafile_cairo.h class comment Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: printing/pdf_ps_metafile_cairo.cc
diff --git a/printing/pdf_ps_metafile_cairo.cc b/printing/pdf_ps_metafile_cairo.cc
index 8ab925833408d82d2f7bbceeb1bbe136dab6fd5a..defd918166311e2825489f607780588932cb9f15 100644
--- a/printing/pdf_ps_metafile_cairo.cc
+++ b/printing/pdf_ps_metafile_cairo.cc
@@ -217,31 +217,19 @@ bool PdfPsMetafile::GetData(void* dst_buffer, uint32 dst_buffer_size) const {
return true;
}
-bool PdfPsMetafile::SaveTo(const base::FileDescriptor& fd) const {
+bool PdfPsMetafile::SaveTo(const FilePath& file_path) const {
// We need to check at least these two members to ensure that either Init()
// has been called to initialize |data_|, or metafile has been closed.
DCHECK(!context_);
DCHECK(!data_.empty());
- if (fd.fd < 0) {
- DLOG(ERROR) << "Invalid file descriptor!";
- return false;
- }
-
bool success = true;
- if (file_util::WriteFileDescriptor(fd.fd, data_.data(),
- GetDataSize()) < 0) {
- DLOG(ERROR) << "Failed to save file with fd " << fd.fd;
+ if (file_util::WriteFile(file_path,
vandebo (ex-Chrome) 2011/03/08 00:39:35 Fits on one line now.
dpapad 2011/03/08 19:39:22 Done.
+ data_.data(),
+ GetDataSize()) < 0) {
+ DLOG(ERROR) << "Failed to save file " << file_path.value().c_str();
success = false;
}
-
- if (fd.auto_close) {
- if (HANDLE_EINTR(close(fd.fd)) < 0) {
- DPLOG(WARNING) << "close";
- success = false;
- }
- }
-
return success;
}

Powered by Google App Engine
This is Rietveld 408576698