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

Side by Side Diff: printing/pdf_metafile_skia.cc

Issue 100253002: Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/tests/test_broker.cc ('k') | remoting/host/ipc_util_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/containers/hash_tables.h" 7 #include "base/containers/hash_tables.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/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 SkAutoDataUnref data(data_->pdf_stream_.copyToData()); 205 SkAutoDataUnref data(data_->pdf_stream_.copyToData());
206 if (file_util::WriteFileDescriptor(fd.fd, 206 if (file_util::WriteFileDescriptor(fd.fd,
207 reinterpret_cast<const char*>(data->data()) , 207 reinterpret_cast<const char*>(data->data()) ,
208 GetDataSize()) != 208 GetDataSize()) !=
209 static_cast<int>(GetDataSize())) { 209 static_cast<int>(GetDataSize())) {
210 DLOG(ERROR) << "Failed to save file with fd " << fd.fd; 210 DLOG(ERROR) << "Failed to save file with fd " << fd.fd;
211 result = false; 211 result = false;
212 } 212 }
213 213
214 if (fd.auto_close) { 214 if (fd.auto_close) {
215 if (HANDLE_EINTR(close(fd.fd)) < 0) { 215 if (IGNORE_EINTR(close(fd.fd)) < 0) {
216 DPLOG(WARNING) << "close"; 216 DPLOG(WARNING) << "close";
217 result = false; 217 result = false;
218 } 218 }
219 } 219 }
220 return result; 220 return result;
221 } 221 }
222 #endif 222 #endif
223 223
224 PdfMetafileSkia::PdfMetafileSkia() 224 PdfMetafileSkia::PdfMetafileSkia()
225 : data_(new PdfMetafileSkiaData), 225 : data_(new PdfMetafileSkiaData),
(...skipping 13 matching lines...) Expand all
239 if (data->size() == 0) 239 if (data->size() == 0)
240 return NULL; 240 return NULL;
241 241
242 PdfMetafileSkia* metafile = new PdfMetafileSkia; 242 PdfMetafileSkia* metafile = new PdfMetafileSkia;
243 metafile->InitFromData(data->bytes(), 243 metafile->InitFromData(data->bytes(),
244 base::checked_numeric_cast<uint32>(data->size())); 244 base::checked_numeric_cast<uint32>(data->size()));
245 return metafile; 245 return metafile;
246 } 246 }
247 247
248 } // namespace printing 248 } // namespace printing
OLDNEW
« no previous file with comments | « ppapi/tests/test_broker.cc ('k') | remoting/host/ipc_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698