summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordbeam <dbeam@chromium.org>2015-05-04 17:53:07 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-05 00:53:37 +0000
commit0f045e96533304388b88da9c4af42039790d8942 (patch)
tree4a54a05d1a1ee76e60a5ad6b18de3bb132c0aec4
parent016a80057fe62da2ec63fedba72ea1c47d3f33cd (diff)
downloadchromium_src-0f045e96533304388b88da9c4af42039790d8942.zip
chromium_src-0f045e96533304388b88da9c4af42039790d8942.tar.gz
chromium_src-0f045e96533304388b88da9c4af42039790d8942.tar.bz2
Revert of Add granular base::File tracing. (patchset #10 id:490001 of https://codereview.chromium.org/1072133006/)
Reason for revert: See if this broke sizes by increasing setup.exe by 0.43%. Original issue's description: > Add granular base::File tracing. > > R=thestig@chromium.org,nduca@chromium.org > BUG=480665 > > Committed: https://crrev.com/a6e05c977096a03774e5406d63ad80c0166f9adc > Cr-Commit-Position: refs/heads/master@{#328153} TBR=thestig@chromium.org,nduca@chromium.org,oysteine@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=480665 Review URL: https://codereview.chromium.org/1127713004 Cr-Commit-Position: refs/heads/master@{#328241}
-rw-r--r--base/BUILD.gn2
-rw-r--r--base/base.gypi2
-rw-r--r--base/files/file.cc24
-rw-r--r--base/files/file.h31
-rw-r--r--base/files/file_posix.cc37
-rw-r--r--base/files/file_tracing.cc47
-rw-r--r--base/files/file_tracing.h68
-rw-r--r--base/files/file_win.cc45
-rw-r--r--base/trace_event/trace_event.h24
9 files changed, 30 insertions, 250 deletions
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 97fed21..e7985ef 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -216,8 +216,6 @@ component("base") {
"files/file_posix.cc",
"files/file_proxy.cc",
"files/file_proxy.h",
- "files/file_tracing.cc",
- "files/file_tracing.h",
"files/file_util.cc",
"files/file_util.h",
"files/file_util_android.cc",
diff --git a/base/base.gypi b/base/base.gypi
index b84c405..4a8cd172 100644
--- a/base/base.gypi
+++ b/base/base.gypi
@@ -209,8 +209,6 @@
'files/file_posix.cc',
'files/file_proxy.cc',
'files/file_proxy.h',
- 'files/file_tracing.cc',
- 'files/file_tracing.h',
'files/file_util.cc',
'files/file_util.h',
'files/file_util_android.cc',
diff --git a/base/files/file.cc b/base/files/file.cc
index 774539f..8030bf1 100644
--- a/base/files/file.cc
+++ b/base/files/file.cc
@@ -4,7 +4,6 @@
#include "base/files/file.h"
#include "base/files/file_path.h"
-#include "base/files/file_tracing.h"
#include "base/metrics/histogram.h"
#include "base/timer/elapsed_timer.h"
@@ -26,11 +25,11 @@ File::File()
}
#if !defined(OS_NACL)
-File::File(const FilePath& path, uint32 flags)
+File::File(const FilePath& name, uint32 flags)
: error_details_(FILE_OK),
created_(false),
async_(false) {
- Initialize(path, flags);
+ Initialize(name, flags);
}
#endif
@@ -52,7 +51,6 @@ File::File(Error error_details)
File::File(RValue other)
: file_(other.object->TakePlatformFile()),
- path_(other.object->path_),
error_details_(other.object->error_details()),
created_(other.object->created()),
async_(other.object->async_) {
@@ -67,7 +65,6 @@ File& File::operator=(RValue other) {
if (this != other.object) {
Close();
SetPlatformFile(other.object->TakePlatformFile());
- path_ = other.object->path_;
error_details_ = other.object->error_details();
created_ = other.object->created();
async_ = other.object->async_;
@@ -76,14 +73,12 @@ File& File::operator=(RValue other) {
}
#if !defined(OS_NACL)
-void File::Initialize(const FilePath& path, uint32 flags) {
- if (path.ReferencesParent()) {
+void File::Initialize(const FilePath& name, uint32 flags) {
+ if (name.ReferencesParent()) {
error_details_ = FILE_ERROR_ACCESS_DENIED;
return;
}
- path_ = path;
- SCOPED_FILE_TRACE("Initialize");
- DoInitialize(flags);
+ DoInitialize(name, flags);
}
#endif
@@ -133,18 +128,9 @@ std::string File::ErrorToString(Error error) {
bool File::Flush() {
ElapsedTimer timer;
- SCOPED_FILE_TRACE("Flush");
bool return_value = DoFlush();
UMA_HISTOGRAM_TIMES("PlatformFile.FlushTime", timer.Elapsed());
return return_value;
}
-File::TraceEnabler::TraceEnabler() {
- FILE_TRACING_BEGIN();
-}
-
-File::TraceEnabler::~TraceEnabler() {
- FILE_TRACING_END();
-}
-
} // namespace base
diff --git a/base/files/file.h b/base/files/file.h
index 589403d..89077b4 100644
--- a/base/files/file.h
+++ b/base/files/file.h
@@ -18,7 +18,6 @@
#include "base/base_export.h"
#include "base/basictypes.h"
-#include "base/files/file_path.h"
#include "base/files/scoped_file.h"
#include "base/gtest_prod_util.h"
#include "base/move.h"
@@ -32,6 +31,8 @@ FORWARD_DECLARE_TEST(FileTest, MemoryCorruption);
namespace base {
+class FilePath;
+
#if defined(OS_WIN)
typedef HANDLE PlatformFile;
#elif defined(OS_POSIX)
@@ -161,8 +162,8 @@ class BASE_EXPORT File {
File();
// Creates or opens the given file. This will fail with 'access denied' if the
- // |path| contains path traversal ('..') components.
- File(const FilePath& path, uint32 flags);
+ // |name| contains path traversal ('..') components.
+ File(const FilePath& name, uint32 flags);
// Takes ownership of |platform_file|.
explicit File(PlatformFile platform_file);
@@ -179,7 +180,7 @@ class BASE_EXPORT File {
File& operator=(RValue other);
// Creates or opens the given file.
- void Initialize(const FilePath& path, uint32 flags);
+ void Initialize(const FilePath& name, uint32 flags);
bool IsValid() const;
@@ -190,7 +191,7 @@ class BASE_EXPORT File {
// Returns the OS result of opening this file. Note that the way to verify
// the success of the operation is to use IsValid(), not this method:
- // File file(path, flags);
+ // File file(name, flags);
// if (!file.IsValid())
// return;
Error error_details() const { return error_details_; }
@@ -304,8 +305,6 @@ class BASE_EXPORT File {
private:
FRIEND_TEST_ALL_PREFIXES(::FileTest, MemoryCorruption);
- friend class ScopedFileTrace;
-
#if defined(OS_POSIX)
// Encloses a single ScopedFD, saving a cheap tamper resistent memory checksum
// alongside it. This checksum is validated at every access, allowing early
@@ -351,9 +350,9 @@ class BASE_EXPORT File {
};
#endif
- // Creates or opens the given file. Only called if |path_| has no
- // traversal ('..') components.
- void DoInitialize(uint32 flags);
+ // Creates or opens the given file. Only called if |name| has no traversal
+ // ('..') components.
+ void DoInitialize(const FilePath& name, uint32 flags);
// TODO(tnagel): Reintegrate into Flush() once histogram isn't needed anymore,
// cf. issue 473337.
@@ -367,18 +366,6 @@ class BASE_EXPORT File {
MemoryCheckingScopedFD file_;
#endif
- // Path that |Initialize()| was called with. Only set if safe (i.e. no '..').
- FilePath path_;
-
- class TraceEnabler {
- public:
- TraceEnabler();
- ~TraceEnabler();
- };
-
- // Object tied to the lifetime of this File that enables/disables tracing.
- TraceEnabler trace_enabler_;
-
Error error_details_;
bool created_;
bool async_;
diff --git a/base/files/file_posix.cc b/base/files/file_posix.cc
index 563dba1..4c79057 100644
--- a/base/files/file_posix.cc
+++ b/base/files/file_posix.cc
@@ -10,7 +10,6 @@
#include <unistd.h>
#include "base/files/file_path.h"
-#include "base/files/file_tracing.h"
#include "base/logging.h"
#include "base/metrics/sparse_histogram.h"
#include "base/posix/eintr_wrapper.h"
@@ -174,7 +173,6 @@ void File::Close() {
if (!IsValid())
return;
- SCOPED_FILE_TRACE("Close");
ThreadRestrictions::AssertIOAllowed();
file_.reset();
}
@@ -183,8 +181,6 @@ int64 File::Seek(Whence whence, int64 offset) {
ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
- SCOPED_FILE_TRACE_WITH_SIZE("Seek", offset);
-
#if defined(OS_ANDROID)
COMPILE_ASSERT(sizeof(int64) == sizeof(off64_t), off64_t_64_bit);
return lseek64(file_.get(), static_cast<off64_t>(offset),
@@ -202,8 +198,6 @@ int File::Read(int64 offset, char* data, int size) {
if (size < 0)
return -1;
- SCOPED_FILE_TRACE_WITH_SIZE("Read", size);
-
int bytes_read = 0;
int rv;
do {
@@ -224,8 +218,6 @@ int File::ReadAtCurrentPos(char* data, int size) {
if (size < 0)
return -1;
- SCOPED_FILE_TRACE_WITH_SIZE("ReadAtCurrentPos", size);
-
int bytes_read = 0;
int rv;
do {
@@ -242,7 +234,7 @@ int File::ReadAtCurrentPos(char* data, int size) {
int File::ReadNoBestEffort(int64 offset, char* data, int size) {
ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
- SCOPED_FILE_TRACE_WITH_SIZE("ReadNoBestEffort", size);
+
return HANDLE_EINTR(pread(file_.get(), data, size, offset));
}
@@ -252,7 +244,6 @@ int File::ReadAtCurrentPosNoBestEffort(char* data, int size) {
if (size < 0)
return -1;
- SCOPED_FILE_TRACE_WITH_SIZE("ReadAtCurrentPosNoBestEffort", size);
return HANDLE_EINTR(read(file_.get(), data, size));
}
@@ -266,8 +257,6 @@ int File::Write(int64 offset, const char* data, int size) {
if (size < 0)
return -1;
- SCOPED_FILE_TRACE_WITH_SIZE("Write", size);
-
int bytes_written = 0;
int rv;
do {
@@ -288,8 +277,6 @@ int File::WriteAtCurrentPos(const char* data, int size) {
if (size < 0)
return -1;
- SCOPED_FILE_TRACE_WITH_SIZE("WriteAtCurrentPos", size);
-
int bytes_written = 0;
int rv;
do {
@@ -310,15 +297,12 @@ int File::WriteAtCurrentPosNoBestEffort(const char* data, int size) {
if (size < 0)
return -1;
- SCOPED_FILE_TRACE_WITH_SIZE("WriteAtCurrentPosNoBestEffort", size);
return HANDLE_EINTR(write(file_.get(), data, size));
}
int64 File::GetLength() {
DCHECK(IsValid());
- SCOPED_FILE_TRACE("GetLength");
-
stat_wrapper_t file_info;
if (CallFstat(file_.get(), &file_info))
return false;
@@ -329,8 +313,6 @@ int64 File::GetLength() {
bool File::SetLength(int64 length) {
ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
-
- SCOPED_FILE_TRACE_WITH_SIZE("SetLength", length);
return !CallFtruncate(file_.get(), length);
}
@@ -338,8 +320,6 @@ bool File::SetTimes(Time last_access_time, Time last_modified_time) {
ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
- SCOPED_FILE_TRACE("SetTimes");
-
timeval times[2];
times[0] = last_access_time.ToTimeVal();
times[1] = last_modified_time.ToTimeVal();
@@ -350,8 +330,6 @@ bool File::SetTimes(Time last_access_time, Time last_modified_time) {
bool File::GetInfo(Info* info) {
DCHECK(IsValid());
- SCOPED_FILE_TRACE("GetInfo");
-
stat_wrapper_t file_info;
if (CallFstat(file_.get(), &file_info))
return false;
@@ -361,12 +339,10 @@ bool File::GetInfo(Info* info) {
}
File::Error File::Lock() {
- SCOPED_FILE_TRACE("Lock");
return CallFctnlFlock(file_.get(), true);
}
File::Error File::Unlock() {
- SCOPED_FILE_TRACE("Unlock");
return CallFctnlFlock(file_.get(), false);
}
@@ -374,8 +350,6 @@ File File::Duplicate() {
if (!IsValid())
return File();
- SCOPED_FILE_TRACE("Duplicate");
-
PlatformFile other_fd = dup(GetPlatformFile());
if (other_fd == -1)
return File(OSErrorToFileError(errno));
@@ -468,7 +442,7 @@ void File::MemoryCheckingScopedFD::UpdateChecksum() {
// NaCl doesn't implement system calls to open files directly.
#if !defined(OS_NACL)
// TODO(erikkay): does it make sense to support FLAG_EXCLUSIVE_* here?
-void File::DoInitialize(uint32 flags) {
+void File::DoInitialize(const FilePath& name, uint32 flags) {
ThreadRestrictions::AssertIOAllowed();
DCHECK(!IsValid());
@@ -523,7 +497,7 @@ void File::DoInitialize(uint32 flags) {
mode |= S_IRGRP | S_IROTH;
#endif
- int descriptor = HANDLE_EINTR(open(path_.value().c_str(), open_flags, mode));
+ int descriptor = HANDLE_EINTR(open(name.value().c_str(), open_flags, mode));
if (flags & FLAG_OPEN_ALWAYS) {
if (descriptor < 0) {
@@ -531,7 +505,7 @@ void File::DoInitialize(uint32 flags) {
if (flags & FLAG_EXCLUSIVE_READ || flags & FLAG_EXCLUSIVE_WRITE)
open_flags |= O_EXCL; // together with O_CREAT implies O_NOFOLLOW
- descriptor = HANDLE_EINTR(open(path_.value().c_str(), open_flags, mode));
+ descriptor = HANDLE_EINTR(open(name.value().c_str(), open_flags, mode));
if (descriptor >= 0)
created_ = true;
}
@@ -546,7 +520,7 @@ void File::DoInitialize(uint32 flags) {
created_ = true;
if (flags & FLAG_DELETE_ON_CLOSE)
- unlink(path_.value().c_str());
+ unlink(name.value().c_str());
async_ = ((flags & FLAG_ASYNC) == FLAG_ASYNC);
error_details_ = FILE_OK;
@@ -557,7 +531,6 @@ void File::DoInitialize(uint32 flags) {
bool File::DoFlush() {
ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
-
#if defined(OS_NACL)
NOTIMPLEMENTED(); // NaCl doesn't implement fsync.
return true;
diff --git a/base/files/file_tracing.cc b/base/files/file_tracing.cc
deleted file mode 100644
index 3326e2d..0000000
--- a/base/files/file_tracing.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/files/file_tracing.h"
-
-#include "base/files/file.h"
-#include "base/files/file_path.h"
-
-namespace base {
-
-const char kFileTracingEventCategoryGroup[] = TRACE_DISABLED_BY_DEFAULT("file");
-
-ScopedFileTrace::ScopedFileTrace() : initialized_(false) {}
-
-ScopedFileTrace::~ScopedFileTrace() {
- if (initialized_) {
- if (size_) {
- TRACE_EVENT_NESTABLE_ASYNC_END2(
- kFileTracingEventCategoryGroup, name_, &file_->trace_enabler_,
- "path", file_->path_.AsUTF8Unsafe(), "size", size_);
- } else {
- TRACE_EVENT_NESTABLE_ASYNC_END1(
- kFileTracingEventCategoryGroup, name_, &file_->trace_enabler_,
- "path", file_->path_.AsUTF8Unsafe());
- }
- }
-}
-
-void ScopedFileTrace::Initialize(const char* name, File* file, int64 size) {
- file_ = file;
- name_ = name;
- size_ = size;
- initialized_ = true;
-
- if (size_) {
- TRACE_EVENT_NESTABLE_ASYNC_BEGIN2(
- kFileTracingEventCategoryGroup, name_, &file_->trace_enabler_,
- "path", file_->path_.AsUTF8Unsafe(), "size", size_);
- } else {
- TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(
- kFileTracingEventCategoryGroup, name_, &file_->trace_enabler_,
- "path", file_->path_.AsUTF8Unsafe());
- }
-}
-
-} // namespace base
diff --git a/base/files/file_tracing.h b/base/files/file_tracing.h
deleted file mode 100644
index f3bb631..0000000
--- a/base/files/file_tracing.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef BASE_FILES_FILE_TRACING_H_
-#define BASE_FILES_FILE_TRACING_H_
-
-#include "base/basictypes.h"
-#include "base/macros.h"
-#include "base/trace_event/trace_event.h"
-
-#define FILE_TRACING_PREFIX "File"
-
-#define FILE_TRACING_BEGIN() \
- TRACE_EVENT_NESTABLE_ASYNC_BEGIN0( \
- base::kFileTracingEventCategoryGroup, FILE_TRACING_PREFIX, this)
-
-#define FILE_TRACING_END() \
- TRACE_EVENT_NESTABLE_ASYNC_END0( \
- base::kFileTracingEventCategoryGroup, FILE_TRACING_PREFIX, this)
-
-#define SCOPED_FILE_TRACE_WITH_SIZE(name, size) \
- base::ScopedFileTrace scoped_file_trace; \
- do { \
- bool category_enabled; \
- TRACE_EVENT_CATEGORY_GROUP_ENABLED( \
- base::kFileTracingEventCategoryGroup, &category_enabled); \
- if (category_enabled) \
- scoped_file_trace.Initialize( \
- FILE_TRACING_PREFIX "::" name, this, size); \
- } while (0)
-
-#define SCOPED_FILE_TRACE(name) SCOPED_FILE_TRACE_WITH_SIZE(name, 0)
-
-namespace base {
-
-class File;
-
-extern const char kFileTracingEventCategoryGroup[];
-
-class ScopedFileTrace {
- public:
- ScopedFileTrace();
- ~ScopedFileTrace();
-
- // Called only if the tracing category is enabled.
- void Initialize(const char* event, File* file, int64 size);
-
- private:
- // True if |Initialize()| has been called. Don't touch |path_|, |event_|,
- // or |bytes_| if |initialized_| is false.
- bool initialized_;
-
- // The event name to trace (e.g. "Read", "Write"). Prefixed with "base::File".
- const char* name_;
-
- // The file being traced. Must outlive this class.
- File* file_;
-
- // The size (in bytes) of this trace. Not reported if 0.
- int64 size_;
-
- DISALLOW_COPY_AND_ASSIGN(ScopedFileTrace);
-};
-
-} // namespace base
-
-#endif // BASE_FILES_FILE_TRACING_H_
diff --git a/base/files/file_win.cc b/base/files/file_win.cc
index 56c5959..200ea29 100644
--- a/base/files/file_win.cc
+++ b/base/files/file_win.cc
@@ -6,7 +6,7 @@
#include <io.h>
-#include "base/files/file_tracing.h"
+#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/metrics/sparse_histogram.h"
#include "base/threading/thread_restrictions.h"
@@ -31,20 +31,16 @@ PlatformFile File::TakePlatformFile() {
}
void File::Close() {
- if (!file_.IsValid())
- return;
-
- ThreadRestrictions::AssertIOAllowed();
- SCOPED_FILE_TRACE("Close");
- file_.Close();
+ if (file_.IsValid()) {
+ ThreadRestrictions::AssertIOAllowed();
+ file_.Close();
+ }
}
int64 File::Seek(Whence whence, int64 offset) {
ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
- SCOPED_FILE_TRACE_WITH_SIZE("Seek", offset);
-
LARGE_INTEGER distance, res;
distance.QuadPart = offset;
DWORD move_method = static_cast<DWORD>(whence);
@@ -60,8 +56,6 @@ int File::Read(int64 offset, char* data, int size) {
if (size < 0)
return -1;
- SCOPED_FILE_TRACE_WITH_SIZE("Read", size);
-
LARGE_INTEGER offset_li;
offset_li.QuadPart = offset;
@@ -85,8 +79,6 @@ int File::ReadAtCurrentPos(char* data, int size) {
if (size < 0)
return -1;
- SCOPED_FILE_TRACE_WITH_SIZE("ReadAtCurrentPos", size);
-
DWORD bytes_read;
if (::ReadFile(file_.Get(), data, size, &bytes_read, NULL))
return bytes_read;
@@ -97,12 +89,10 @@ int File::ReadAtCurrentPos(char* data, int size) {
}
int File::ReadNoBestEffort(int64 offset, char* data, int size) {
- // TODO(dbeam): trace this separately?
return Read(offset, data, size);
}
int File::ReadAtCurrentPosNoBestEffort(char* data, int size) {
- // TODO(dbeam): trace this separately?
return ReadAtCurrentPos(data, size);
}
@@ -111,8 +101,6 @@ int File::Write(int64 offset, const char* data, int size) {
DCHECK(IsValid());
DCHECK(!async_);
- SCOPED_FILE_TRACE_WITH_SIZE("Write", size);
-
LARGE_INTEGER offset_li;
offset_li.QuadPart = offset;
@@ -134,8 +122,6 @@ int File::WriteAtCurrentPos(const char* data, int size) {
if (size < 0)
return -1;
- SCOPED_FILE_TRACE_WITH_SIZE("WriteAtCurrentPos", size);
-
DWORD bytes_written;
if (::WriteFile(file_.Get(), data, size, &bytes_written, NULL))
return bytes_written;
@@ -150,9 +136,6 @@ int File::WriteAtCurrentPosNoBestEffort(const char* data, int size) {
int64 File::GetLength() {
ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
-
- SCOPED_FILE_TRACE("GetLength");
-
LARGE_INTEGER size;
if (!::GetFileSizeEx(file_.Get(), &size))
return -1;
@@ -164,8 +147,6 @@ bool File::SetLength(int64 length) {
ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
- SCOPED_FILE_TRACE_WITH_SIZE("SetLength", length);
-
// Get the current file pointer.
LARGE_INTEGER file_pointer;
LARGE_INTEGER zero;
@@ -195,8 +176,6 @@ bool File::SetTimes(Time last_access_time, Time last_modified_time) {
ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
- SCOPED_FILE_TRACE("SetTimes");
-
FILETIME last_access_filetime = last_access_time.ToFileTime();
FILETIME last_modified_filetime = last_modified_time.ToFileTime();
return (::SetFileTime(file_.Get(), NULL, &last_access_filetime,
@@ -207,8 +186,6 @@ bool File::GetInfo(Info* info) {
ThreadRestrictions::AssertIOAllowed();
DCHECK(IsValid());
- SCOPED_FILE_TRACE("GetInfo");
-
BY_HANDLE_FILE_INFORMATION file_info;
if (!GetFileInformationByHandle(file_.Get(), &file_info))
return false;
@@ -228,9 +205,6 @@ bool File::GetInfo(Info* info) {
File::Error File::Lock() {
DCHECK(IsValid());
-
- SCOPED_FILE_TRACE("Lock");
-
BOOL result = LockFile(file_.Get(), 0, 0, MAXDWORD, MAXDWORD);
if (!result)
return OSErrorToFileError(GetLastError());
@@ -239,9 +213,6 @@ File::Error File::Lock() {
File::Error File::Unlock() {
DCHECK(IsValid());
-
- SCOPED_FILE_TRACE("Unlock");
-
BOOL result = UnlockFile(file_.Get(), 0, 0, MAXDWORD, MAXDWORD);
if (!result)
return OSErrorToFileError(GetLastError());
@@ -252,8 +223,6 @@ File File::Duplicate() {
if (!IsValid())
return File();
- SCOPED_FILE_TRACE("Duplicate");
-
HANDLE other_handle = nullptr;
if (!::DuplicateHandle(GetCurrentProcess(), // hSourceProcessHandle
@@ -309,7 +278,7 @@ File::Error File::OSErrorToFileError(DWORD last_error) {
}
}
-void File::DoInitialize(uint32 flags) {
+void File::DoInitialize(const FilePath& name, uint32 flags) {
ThreadRestrictions::AssertIOAllowed();
DCHECK(!IsValid());
@@ -377,7 +346,7 @@ void File::DoInitialize(uint32 flags) {
if (flags & FLAG_BACKUP_SEMANTICS)
create_flags |= FILE_FLAG_BACKUP_SEMANTICS;
- file_.Set(CreateFile(path_.value().c_str(), access, sharing, NULL,
+ file_.Set(CreateFile(name.value().c_str(), access, sharing, NULL,
disposition, create_flags, NULL));
if (file_.IsValid()) {
diff --git a/base/trace_event/trace_event.h b/base/trace_event/trace_event.h
index 9511f80..e0249f5 100644
--- a/base/trace_event/trace_event.h
+++ b/base/trace_event/trace_event.h
@@ -702,31 +702,15 @@
// NESTABLE_ASYNC event of that id. Corresponding warning messages for
// unmatched events will be shown in the analysis view.
-// Records a single NESTABLE_ASYNC_BEGIN event called "name" immediately, with 1
-// or 2 associated arguments. If the category is not enabled, then this does
-// nothing.
-#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(category_group, name, id) \
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \
- category_group, name, id, TRACE_EVENT_FLAG_NONE)
-#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(category_group, name, id, arg1_name, \
- arg1_val) \
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \
- category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
+// Records a single NESTABLE_ASYNC_BEGIN event called "name" immediately, with 2
+// associated arguments. If the category is not enabled, then this does nothing.
#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN2(category_group, name, id, arg1_name, \
arg1_val, arg2_name, arg2_val) \
INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \
category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \
arg2_name, arg2_val)
-// Records a single NESTABLE_ASYNC_END event called "name" immediately, with 1
-// or 2 associated arguments. If the category is not enabled, then this does
-// nothing.
-#define TRACE_EVENT_NESTABLE_ASYNC_END0(category_group, name, id) \
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \
- category_group, name, id, TRACE_EVENT_FLAG_NONE)
-#define TRACE_EVENT_NESTABLE_ASYNC_END1(category_group, name, id, arg1_name, \
- arg1_val) \
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \
- category_group, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
+// Records a single NESTABLE_ASYNC_END event called "name" immediately, with 2
+// associated arguments. If the category is not enabled, then this does nothing.
#define TRACE_EVENT_NESTABLE_ASYNC_END2(category_group, name, id, arg1_name, \
arg1_val, arg2_name, arg2_val) \
INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \