Index: base/files/file.cc |
diff --git a/base/files/file.cc b/base/files/file.cc |
index ea8dbf27ac1770d88fc6ce933a4bdd331820d2d9..a997074bec4003b2474287d33785d844a354addb 100644 |
--- a/base/files/file.cc |
+++ b/base/files/file.cc |
@@ -5,6 +5,10 @@ |
#include "base/files/file.h" |
#include "base/files/file_path.h" |
+#if defined(OS_POSIX) |
+#include "base/files/file_posix_hooks_internal.h" |
+#endif |
+ |
namespace base { |
File::Info::Info() |
@@ -38,6 +42,8 @@ File::File(PlatformFile platform_file) |
async_(false) { |
#if defined(OS_POSIX) |
DCHECK_GE(platform_file, -1); |
+ if (IsValid()) |
+ ProtectFileDescriptor(platform_file); |
#endif |
} |
@@ -52,6 +58,10 @@ File::File(RValue other) |
error_details_(other.object->error_details()), |
created_(other.object->created()), |
async_(other.object->async_) { |
+#if defined(OS_POSIX) |
+ if (IsValid()) |
+ ProtectFileDescriptor(GetPlatformFile()); |
+#endif |
} |
File::~File() { |