diff options
author | Kristian Monsen <kristianm@google.com> | 2011-06-09 15:04:01 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2011-06-14 20:31:33 -0700 |
commit | 408e341a50962061e47be3d6a8f50ee299fae1ed (patch) | |
tree | 0efe11da1bfc2264e7a69e92ed53a8b15c135df5 /base | |
parent | 88cd212725de4726b13b171fde17a47e2073ff2f (diff) | |
download | external_chromium-408e341a50962061e47be3d6a8f50ee299fae1ed.zip external_chromium-408e341a50962061e47be3d6a8f50ee299fae1ed.tar.gz external_chromium-408e341a50962061e47be3d6a8f50ee299fae1ed.tar.bz2 |
File not used, matching upstream to avoid conflicts.
Change-Id: Iee92f225644e96852796596a25f571e05ebf28a7
Diffstat (limited to 'base')
-rw-r--r-- | base/debug/trace_event.cc | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/base/debug/trace_event.cc b/base/debug/trace_event.cc index a6fddee..f50422c 100644 --- a/base/debug/trace_event.cc +++ b/base/debug/trace_event.cc @@ -8,9 +8,9 @@ #include "base/file_path.h" #include "base/file_util.h" #include "base/path_service.h" +#include "base/platform_thread.h" #include "base/process_util.h" #include "base/stringprintf.h" -#include "base/threading/platform_thread.h" #include "base/utf_string_conversions.h" #include "base/time.h" @@ -29,7 +29,6 @@ static const FilePath::CharType* kLogFileName = FILE_PATH_LITERAL("trace_%d.log"); TraceLog::TraceLog() : enabled_(false), log_file_(NULL) { -#ifndef ANDROID base::ProcessHandle proc = base::GetCurrentProcessHandle(); #if !defined(OS_MACOSX) process_metrics_.reset(base::ProcessMetrics::CreateProcessMetrics(proc)); @@ -38,14 +37,11 @@ TraceLog::TraceLog() : enabled_(false), log_file_(NULL) { // process. process_metrics_.reset(base::ProcessMetrics::CreateProcessMetrics(proc, NULL)); -#endif // !defined(OS_MACOSX) -#endif // !ANDROID +#endif } TraceLog::~TraceLog() { -#ifndef ANDROID Stop(); -#endif } // static @@ -64,7 +60,6 @@ bool TraceLog::StartTracing() { } bool TraceLog::Start() { -#ifndef ANDROID if (enabled_) return true; enabled_ = OpenLogFile(); @@ -74,9 +69,6 @@ bool TraceLog::Start() { timer_.Start(TimeDelta::FromMilliseconds(250), this, &TraceLog::Heartbeat); } return enabled_; -#else - return false; -#endif } // static @@ -94,22 +86,17 @@ void TraceLog::Stop() { } void TraceLog::Heartbeat() { -#ifndef ANDROID std::string cpu = StringPrintf("%.0f", process_metrics_->GetCPUUsage()); TRACE_EVENT_INSTANT("heartbeat.cpu", 0, cpu); -#endif } void TraceLog::CloseLogFile() { -#ifndef ANDROID if (log_file_) { file_util::CloseFile(log_file_); } -#endif } bool TraceLog::OpenLogFile() { -#ifndef ANDROID FilePath::StringType pid_filename = StringPrintf(kLogFileName, base::GetCurrentProcId()); FilePath log_file_path; @@ -125,9 +112,6 @@ bool TraceLog::OpenLogFile() { } } return true; -#else - return false; -#endif } void TraceLog::Trace(const std::string& name, @@ -147,7 +131,6 @@ void TraceLog::Trace(const std::string& name, const std::string& extra, const char* file, int line) { -#ifndef ANDROID if (!enabled_) return; @@ -173,15 +156,12 @@ void TraceLog::Trace(const std::string& name, usec); Log(msg); -#endif } void TraceLog::Log(const std::string& msg) { -#ifndef ANDROID AutoLock lock(file_lock_); fprintf(log_file_, "%s", msg.c_str()); -#endif } } // namespace debug |