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

Unified Diff: base/files/file_tracing.h

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_posix.cc ('k') | base/files/file_tracing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_tracing.h
diff --git a/base/files/file_tracing.h b/base/files/file_tracing.h
index 149bd78a9b4a5000543ff3d36cd88397b4bb9ede..373fe0e38f27e825e02b8ed0c2615e00e9ef3b9f 100644
--- a/base/files/file_tracing.h
+++ b/base/files/file_tracing.h
@@ -12,9 +12,9 @@
#define FILE_TRACING_PREFIX "File"
#define SCOPED_FILE_TRACE_WITH_SIZE(name, size) \
- FileTracing::ScopedTrace scoped_file_trace; \
- if (scoped_file_trace.ShouldInitialize()) \
- scoped_file_trace.Initialize(FILE_TRACING_PREFIX "::" name, this, size)
+ FileTracing::ScopedTrace scoped_file_trace; \
+ if (FileTracing::IsCategoryEnabled()) \
+ scoped_file_trace.Initialize(FILE_TRACING_PREFIX "::" name, this, size)
#define SCOPED_FILE_TRACE(name) SCOPED_FILE_TRACE_WITH_SIZE(name, 0)
@@ -25,8 +25,13 @@ class FilePath;
class BASE_EXPORT FileTracing {
public:
+ // Whether the file tracing category is enabled.
+ static bool IsCategoryEnabled();
+
class Provider {
public:
+ virtual ~Provider() = default;
+
// Whether the file tracing category is currently enabled.
virtual bool FileTracingCategoryIsEnabled() const = 0;
@@ -61,9 +66,6 @@ class BASE_EXPORT FileTracing {
ScopedTrace();
~ScopedTrace();
- // Whether this trace should be initialized or not.
- bool ShouldInitialize() const;
-
// Called only if the tracing category is enabled. |name| is the name of the
// event to trace (e.g. "Read", "Write") and must have an application
// lifetime (e.g. static or literal). |file| is the file being traced; must
« no previous file with comments | « base/files/file_posix.cc ('k') | base/files/file_tracing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698