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

Unified Diff: base/threading/thread_id_name_manager.cc

Issue 1128733002: Update from https://crrev.com/328418 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « base/threading/thread_id_name_manager.h ('k') | base/threading/thread_id_name_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/thread_id_name_manager.cc
diff --git a/base/threading/thread_id_name_manager.cc b/base/threading/thread_id_name_manager.cc
index 7c85c1b5e99670caa66f3969395c540b281712ee..56cfa273a87d72df8ed3163bed0348e1d09203dc 100644
--- a/base/threading/thread_id_name_manager.cc
+++ b/base/threading/thread_id_name_manager.cc
@@ -48,17 +48,16 @@ void ThreadIdNameManager::RegisterThread(PlatformThreadHandle::Handle handle,
name_to_interned_name_[kDefaultName];
}
-void ThreadIdNameManager::SetName(PlatformThreadId id, const char* name) {
- std::string str_name(name);
-
+void ThreadIdNameManager::SetName(PlatformThreadId id,
+ const std::string& name) {
AutoLock locked(lock_);
- NameToInternedNameMap::iterator iter = name_to_interned_name_.find(str_name);
+ NameToInternedNameMap::iterator iter = name_to_interned_name_.find(name);
std::string* leaked_str = NULL;
if (iter != name_to_interned_name_.end()) {
leaked_str = iter->second;
} else {
- leaked_str = new std::string(str_name);
- name_to_interned_name_[str_name] = leaked_str;
+ leaked_str = new std::string(name);
+ name_to_interned_name_[name] = leaked_str;
}
ThreadIdToHandleMap::iterator id_to_handle_iter =
« no previous file with comments | « base/threading/thread_id_name_manager.h ('k') | base/threading/thread_id_name_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698