Index: base/files/file.cc |
diff --git a/base/files/file.cc b/base/files/file.cc |
index a997074bec4003b2474287d33785d844a354addb..8030bf13734e8a6b20bfe4f8f45ccc738885e075 100644 |
--- a/base/files/file.cc |
+++ b/base/files/file.cc |
@@ -4,10 +4,8 @@ |
#include "base/files/file.h" |
#include "base/files/file_path.h" |
- |
-#if defined(OS_POSIX) |
-#include "base/files/file_posix_hooks_internal.h" |
-#endif |
+#include "base/metrics/histogram.h" |
+#include "base/timer/elapsed_timer.h" |
namespace base { |
@@ -42,8 +40,6 @@ File::File(PlatformFile platform_file) |
async_(false) { |
#if defined(OS_POSIX) |
DCHECK_GE(platform_file, -1); |
- if (IsValid()) |
- ProtectFileDescriptor(platform_file); |
#endif |
} |
@@ -58,10 +54,6 @@ 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() { |
@@ -86,7 +78,7 @@ void File::Initialize(const FilePath& name, uint32 flags) { |
error_details_ = FILE_ERROR_ACCESS_DENIED; |
return; |
} |
- InitializeUnsafe(name, flags); |
+ DoInitialize(name, flags); |
} |
#endif |
@@ -134,4 +126,11 @@ std::string File::ErrorToString(Error error) { |
return ""; |
} |
+bool File::Flush() { |
+ ElapsedTimer timer; |
+ bool return_value = DoFlush(); |
+ UMA_HISTOGRAM_TIMES("PlatformFile.FlushTime", timer.Elapsed()); |
+ return return_value; |
+} |
+ |
} // namespace base |