Only set File::[tracing_]path_ when file tracing is enabled.
R=rvargas@chromium.org
BUG=none
TEST=less |path_| cruft lying around
Review URL: https://codereview.chromium.org/1216183004
Cr-Commit-Position: refs/heads/master@{#337168}
CrOS-Libchrome-Original-Commit: fd5b108c82d56f6022dfbe62a023d1e81ff6f83b
diff --git a/base/files/file.cc b/base/files/file.cc
index 6dfeb91..47b9f88 100644
--- a/base/files/file.cc
+++ b/base/files/file.cc
@@ -52,7 +52,7 @@
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_) {
@@ -76,7 +76,7 @@
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_;
@@ -90,9 +90,10 @@
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