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

Unified Diff: chrome/browser/printing/print_dialog_gtk.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: Fixed include ordering, some comments and style 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
« no previous file with comments | « no previous file | chrome/renderer/print_web_view_helper_win.cc » ('j') | printing/native_metafile.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_dialog_gtk.cc
diff --git a/chrome/browser/printing/print_dialog_gtk.cc b/chrome/browser/printing/print_dialog_gtk.cc
index 051b24403b227edda7f5785568807fc9dbf94a80..f974c12c0297f7acfa9386cb8dd63d4412ee0036 100644
--- a/chrome/browser/printing/print_dialog_gtk.cc
+++ b/chrome/browser/printing/print_dialog_gtk.cc
@@ -156,15 +156,10 @@ void PrintDialogGtk::SaveDocumentToDisk(const NativeMetafile* metafile,
error = true;
}
- if (!error) {
- base::FileDescriptor temp_file_fd;
- temp_file_fd.fd = open(path_to_pdf_.value().c_str(), O_WRONLY);
- temp_file_fd.auto_close = true;
- if (!metafile->SaveTo(temp_file_fd)) {
- LOG(ERROR) << "Saving metafile failed";
- file_util::Delete(path_to_pdf_, false);
- error = true;
- }
+ if ((!error) && (!metafile->SaveTo(path_to_pdf_))) {
Lei Zhang 2011/03/04 12:02:36 nit: no need to write: if (!foo && !bar) as: i
dpapad 2011/03/04 19:19:43 Done.
+ LOG(ERROR) << "Saving metafile failed";
+ file_util::Delete(path_to_pdf_, false);
+ error = true;
}
// Done saving, let PrintDialogGtk::PrintDocument() continue.
« no previous file with comments | « no previous file | chrome/renderer/print_web_view_helper_win.cc » ('j') | printing/native_metafile.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698