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

Unified Diff: base/threading/worker_pool_posix.cc

Issue 8463004: A couple comment updates (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/worker_pool_posix.cc
diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc
index 917565d7269a333e6cabdfe09a6971a6ac36faf1..09b60fff5c5b9e7ee5b15da79f13205180b9b3f8 100644
--- a/base/threading/worker_pool_posix.cc
+++ b/base/threading/worker_pool_posix.cc
@@ -9,7 +9,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
-#include "base/stringprintf.h"
+#include "base/string_number_conversions.h"
#include "base/task.h"
#include "base/threading/platform_thread.h"
#include "base/threading/worker_pool.h"
@@ -63,22 +63,23 @@ class WorkerThread : public PlatformThread::Delegate {
public:
WorkerThread(const std::string& name_prefix,
base::PosixDynamicThreadPool* pool)
- : name_prefix_(name_prefix),
+ : name_(name_prefix),
pool_(pool) {}
virtual void ThreadMain();
private:
- const std::string name_prefix_;
+ std::string name_;
scoped_refptr<base::PosixDynamicThreadPool> pool_;
DISALLOW_COPY_AND_ASSIGN(WorkerThread);
};
void WorkerThread::ThreadMain() {
- const std::string name = base::StringPrintf(
- "%s/%d", name_prefix_.c_str(), PlatformThread::CurrentId());
- PlatformThread::SetName(name.c_str());
+ name_.reserve(name_.size() + 10);
jar (doing other things) 2011/11/04 15:30:32 nit: Reserve is not needed.
joth 2011/11/04 16:41:25 will remove
+ name_.push_back('/');
+ name_.append(IntToString(PlatformThread::CurrentId()));
+ PlatformThread::SetName(name_.c_str());
for (;;) {
PosixDynamicThreadPool::PendingTask pending_task = pool_->WaitForTask();
« no previous file with comments | « base/threading/thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698