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

Unified Diff: base/debug/trace_event_unittest.cc

Issue 11438022: Add ability to retrieve a thread_name given a thread_id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make some of the try servers happier. Created 7 years, 11 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
« no previous file with comments | « base/debug/trace_event_impl.cc ('k') | base/threading/platform_thread_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event_unittest.cc
diff --git a/base/debug/trace_event_unittest.cc b/base/debug/trace_event_unittest.cc
index cf16fa58dcbde0e17db0376926b70cc33b541cea..c42cc5dccf80ebf6ba2d0712a7ac85bae183a863 100644
--- a/base/debug/trace_event_unittest.cc
+++ b/base/debug/trace_event_unittest.cc
@@ -79,15 +79,18 @@ class TraceEventTestFixture : public testing::Test {
}
virtual void SetUp() OVERRIDE {
- old_thread_name_ = PlatformThread::GetName();
+ const char* name = PlatformThread::GetName();
+ old_thread_name_ = name ? strdup(name) : NULL;
}
virtual void TearDown() OVERRIDE {
if (TraceLog::GetInstance())
EXPECT_FALSE(TraceLog::GetInstance()->IsEnabled());
- PlatformThread::SetName(old_thread_name_ ? old_thread_name_ : "");
+ PlatformThread::SetName(old_thread_name_ ? old_thread_name_ : "");
+ free(old_thread_name_);
+ old_thread_name_ = NULL;
}
- const char* old_thread_name_;
+ char* old_thread_name_;
ListValue trace_parsed_;
base::debug::TraceResultBuffer trace_buffer_;
base::debug::TraceResultBuffer::SimpleOutput json_output_;
« no previous file with comments | « base/debug/trace_event_impl.cc ('k') | base/threading/platform_thread_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698