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

Unified Diff: base/files/file.cc

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « base/files/file.h ('k') | base/files/file_enumerator_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file.cc
diff --git a/base/files/file.cc b/base/files/file.cc
index 58f80c52322ec38125e1acbe3fda1120f64aa912..9a4ddb1de4a17e174f569a648096e631ad857f8f 100644
--- a/base/files/file.cc
+++ b/base/files/file.cc
@@ -52,22 +52,30 @@ File::File(Error error_details)
File::File(RValue other)
: file_(other.object->TakePlatformFile()),
- path_(other.object->path_),
+ tracing_path_(other.object->tracing_path_),
error_details_(other.object->error_details()),
created_(other.object->created()),
- async_(other.object->async_) {
-}
+ async_(other.object->async_) {}
File::~File() {
// Go through the AssertIOAllowed logic.
Close();
}
+// static
+File File::CreateForAsyncHandle(PlatformFile platform_file) {
+ File file(platform_file);
+ // It would be nice if we could validate that |platform_file| was opened with
+ // FILE_FLAG_OVERLAPPED on Windows but this doesn't appear to be possible.
+ file.async_ = true;
+ return file.Pass();
+}
+
File& File::operator=(RValue other) {
if (this != other.object) {
Close();
SetPlatformFile(other.object->TakePlatformFile());
- path_ = other.object->path_;
+ tracing_path_ = other.object->tracing_path_;
error_details_ = other.object->error_details();
created_ = other.object->created();
async_ = other.object->async_;
@@ -81,9 +89,10 @@ void File::Initialize(const FilePath& path, uint32 flags) {
error_details_ = FILE_ERROR_ACCESS_DENIED;
return;
}
- path_ = path;
+ if (FileTracing::IsCategoryEnabled())
+ tracing_path_ = path;
SCOPED_FILE_TRACE("Initialize");
- DoInitialize(flags);
+ DoInitialize(path, flags);
}
#endif
« no previous file with comments | « base/files/file.h ('k') | base/files/file_enumerator_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698