summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authormikhail.pozdnyakov <mikhail.pozdnyakov@intel.com>2015-05-04 11:29:58 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-04 18:30:34 +0000
commit4839a142bf95776323647c82ca9dc0725f7c4f15 (patch)
treee8544d9f66e60db96de0683ed570038eb8fcbca5 /remoting
parentac322f81dff6cd124c0dd114c0b4e573fbab5455 (diff)
downloadchromium_src-4839a142bf95776323647c82ca9dc0725f7c4f15.zip
chromium_src-4839a142bf95776323647c82ca9dc0725f7c4f15.tar.gz
chromium_src-4839a142bf95776323647c82ca9dc0725f7c4f15.tar.bz2
Avoid unnecessary memory allocations at PlatformThread::SetName()
The PlatformThread::SetName() method used to accept 'name' parameter as 'const char*' even though all the clients stored as 'std::string' and thus had to convert, further inside PlatformThread::SetName() it was converted back to 'std::string' (when passing to ThreadIdNameManager::SetName()) leading to unnecessary memory allocations. See also: https://groups.google.com/a/chromium.org/forum/#!msg/chromium-dev/EUqoIz2iFU4/kPZ5ZK0K3gEJ Review URL: https://codereview.chromium.org/1093223007 Cr-Commit-Position: refs/heads/master@{#328157}
Diffstat (limited to 'remoting')
-rw-r--r--remoting/base/auto_thread.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/remoting/base/auto_thread.cc b/remoting/base/auto_thread.cc
index 2e5006b..514b82f 100644
--- a/remoting/base/auto_thread.cc
+++ b/remoting/base/auto_thread.cc
@@ -183,7 +183,7 @@ void AutoThread::ThreadMain() {
base::MessageLoop message_loop(startup_data_->loop_type);
// Complete the initialization of our AutoThread object.
- base::PlatformThread::SetName(name_.c_str());
+ base::PlatformThread::SetName(name_);
ANNOTATE_THREAD_NAME(name_.c_str()); // Tell the name to race detector.
message_loop.set_thread_name(name_);