Chromium Code Reviews| Index: base/files/file_tracing.cc |
| diff --git a/base/files/file_tracing.cc b/base/files/file_tracing.cc |
| index c25772db8ab5a101f47885ce58016eb576687dd7..1e3f57085124b9ad25337fa8f44837b26fa6a6cb 100644 |
| --- a/base/files/file_tracing.cc |
| +++ b/base/files/file_tracing.cc |
| @@ -13,6 +13,11 @@ FileTracing::Provider* g_provider = nullptr; |
| } |
| // static |
| +bool FileTracing::IsCategoryEnabled() { |
| + return g_provider && g_provider->FileTracingCategoryIsEnabled(); |
| +} |
| + |
| +// static |
| void FileTracing::SetProvider(FileTracing::Provider* provider) { |
| g_provider = provider; |
| } |
| @@ -34,18 +39,10 @@ FileTracing::ScopedTrace::~ScopedTrace() { |
| g_provider->FileTracingEventEnd(name_, id_); |
| } |
| -bool FileTracing::ScopedTrace::ShouldInitialize() const { |
| - return g_provider && g_provider->FileTracingCategoryIsEnabled(); |
| -} |
| - |
| void FileTracing::ScopedTrace::Initialize( |
| const char* name, File* file, int64 size) { |
| - if (!g_provider) |
|
Dan Beam
2015/07/02 00:43:48
this should never happen
|
| - return; |
| - |
| id_ = &file->trace_enabler_; |
| name_ = name; |
| - |
| g_provider->FileTracingEventBegin(name_, id_, file->path_, size); |
| } |