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

Unified Diff: gpu/common/gpu_trace_event.cc

Issue 6997006: iwyu: Include stringprintf.h where appropriate, part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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
Index: gpu/common/gpu_trace_event.cc
diff --git a/gpu/common/gpu_trace_event.cc b/gpu/common/gpu_trace_event.cc
index b92ce6d628969e3ea47bd7c98cad9be0f526845f..82e520b7a8ca77a82afdc680333b721a2ae3346f 100644
--- a/gpu/common/gpu_trace_event.cc
+++ b/gpu/common/gpu_trace_event.cc
@@ -12,8 +12,6 @@
#define USE_UNRELIABLE_NOW
-using namespace base;
-
namespace gpu {
// Controls the number of trace events we will buffer in-memory
@@ -177,7 +175,8 @@ void TraceEvent::AppendAsJSON(std::string* out) const {
const char* phaseStr = GetPhaseStr(phase);
int64 time_int64 = timestamp.ToInternalValue();
- StringAppendF(out,
+ base::StringAppendF(
+ out,
"{\"cat\":\"%s\",\"pid\":%i,\"tid\":%i,\"ts\":%lld,"
"\"ph\":\"%s\",\"name\":\"%s\",\"args\":{",
category->name(),
@@ -219,7 +218,7 @@ TraceLog::~TraceLog() {
}
TraceCategory* TraceLog::GetCategory(const char* name) {
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
for (int i = 0; i < g_category_index; i++) {
if (strcmp(g_categories[i].name(), name) == 0)
return &g_categories[i];
@@ -232,7 +231,7 @@ TraceCategory* TraceLog::GetCategory(const char* name) {
}
void TraceLog::SetEnabled(bool enabled) {
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
if (enabled == enabled_)
return;
if (enabled) {
@@ -258,7 +257,7 @@ float TraceLog::GetBufferPercentFull() const {
}
void TraceLog::SetOutputCallback(TraceLog::OutputCallback* cb) {
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
if (enabled_) {
FlushWithLockAlreadyHeld();
}
@@ -266,18 +265,18 @@ void TraceLog::SetOutputCallback(TraceLog::OutputCallback* cb) {
}
void TraceLog::SetBufferFullCallback(TraceLog::BufferFullCallback* cb) {
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
buffer_full_callback_.reset(cb);
}
void TraceLog::AddRemotelyCollectedData(const std::string& json_events) {
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
if (output_callback_.get())
output_callback_->Run(json_events);
}
void TraceLog::Flush() {
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
FlushWithLockAlreadyHeld();
}
@@ -301,18 +300,18 @@ void TraceLog::AddTraceEvent(TraceEventPhase phase,
const char* arg2name, TraceValue arg2val) {
DCHECK(file && name);
#ifdef USE_UNRELIABLE_NOW
- TimeTicks now = TimeTicks::HighResNow();
+ base::TimeTicks now = base::TimeTicks::HighResNow();
#else
- TimeTicks now = TimeTicks::Now();
+ base::TimeTicks now = base::TimeTicks::Now();
#endif
//static_cast<unsigned long>(base::GetCurrentProcId()),
- AutoLock lock(lock_);
+ base::AutoLock lock(lock_);
if (logged_events_.size() >= TRACE_EVENT_BUFFER_SIZE)
return;
logged_events_.push_back(TraceEvent());
TraceEvent& event = logged_events_.back();
event.processId = static_cast<unsigned long>(base::GetCurrentProcId());
- event.threadId = PlatformThread::CurrentId();
+ event.threadId = base::PlatformThread::CurrentId();
event.timestamp = now;
event.phase = phase;
event.category = category;

Powered by Google App Engine
This is Rietveld 408576698