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

Unified Diff: base/files/file.cc

Issue 1124763003: Update from https://crrev.com/327068 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: update nacl, buildtools, fix display_change_notifier_unittest Created 5 years, 7 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/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
« no previous file with comments | « base/files/file.h ('k') | base/files/file_path.h » ('j') | mojo/public/tools/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698