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

Unified Diff: base/file_descriptor_posix.h

Issue 184003002: Remove CreatePlatformFile from content shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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: base/file_descriptor_posix.h
diff --git a/base/file_descriptor_posix.h b/base/file_descriptor_posix.h
index abc07893fafd2df96c9b44664d179920da244d3c..093dd2fdb37abe01513863bed3e69d3747256792 100644
--- a/base/file_descriptor_posix.h
+++ b/base/file_descriptor_posix.h
@@ -5,6 +5,8 @@
#ifndef BASE_FILE_DESCRIPTOR_POSIX_H_
#define BASE_FILE_DESCRIPTOR_POSIX_H_
+#include "base/files/file.h"
+
namespace base {
// -----------------------------------------------------------------------------
@@ -16,13 +18,12 @@ namespace base {
// above the template specialisation for this structure.
// -----------------------------------------------------------------------------
struct FileDescriptor {
- FileDescriptor()
- : fd(-1),
- auto_close(false) { }
+ FileDescriptor() : fd(-1), auto_close(false) {}
+
+ FileDescriptor(int ifd, bool iauto_close) : fd(ifd), auto_close(iauto_close) {
+ }
- FileDescriptor(int ifd, bool iauto_close)
- : fd(ifd),
- auto_close(iauto_close) { }
+ FileDescriptor(File file) : fd(file.TakePlatformFile()), auto_close(true) {}
bool operator==(const FileDescriptor& other) const {
return (fd == other.fd && auto_close == other.auto_close);

Powered by Google App Engine
This is Rietveld 408576698