| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/files/file_tracing.h" | 5 #include "base/files/file_tracing.h" |
| 6 | 6 |
| 7 #include "base/files/file.h" | 7 #include "base/files/file.h" |
| 8 | 8 |
| 9 namespace base { | 9 namespace base { |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 } | 33 } |
| 34 | 34 |
| 35 FileTracing::ScopedTrace::ScopedTrace() : id_(nullptr) {} | 35 FileTracing::ScopedTrace::ScopedTrace() : id_(nullptr) {} |
| 36 | 36 |
| 37 FileTracing::ScopedTrace::~ScopedTrace() { | 37 FileTracing::ScopedTrace::~ScopedTrace() { |
| 38 if (id_ && g_provider) | 38 if (id_ && g_provider) |
| 39 g_provider->FileTracingEventEnd(name_, id_); | 39 g_provider->FileTracingEventEnd(name_, id_); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void FileTracing::ScopedTrace::Initialize(const char* name, | 42 void FileTracing::ScopedTrace::Initialize(const char* name, |
| 43 File* file, | 43 const File* file, |
| 44 int64_t size) { | 44 int64_t size) { |
| 45 id_ = &file->trace_enabler_; | 45 id_ = &file->trace_enabler_; |
| 46 name_ = name; | 46 name_ = name; |
| 47 g_provider->FileTracingEventBegin(name_, id_, file->tracing_path_, size); | 47 g_provider->FileTracingEventBegin(name_, id_, file->tracing_path_, size); |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace base | 50 } // namespace base |
| OLD | NEW |