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 |