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

Unified Diff: base/threading/sequenced_worker_pool.cc

Issue 1641563002: Remove linked_ptr usage in //base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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
Index: base/threading/sequenced_worker_pool.cc
diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc
index 3cc50f404c214ed75f1f540cf598f89d4d83e530..85cf853717b90722d6a9f17e573a7bb2df11931d 100644
--- a/base/threading/sequenced_worker_pool.cc
+++ b/base/threading/sequenced_worker_pool.cc
@@ -19,7 +19,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/linked_ptr.h"
+#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/condition_variable.h"
@@ -448,7 +448,7 @@ class SequencedWorkerPool::Inner {
// Owning pointers to all threads we've created so far, indexed by
// ID. Since we lazily create threads, this may be less than
// max_threads_ and will be initially empty.
- typedef std::map<PlatformThreadId, linked_ptr<Worker> > ThreadMap;
+ using ThreadMap = std::map<PlatformThreadId, scoped_ptr<Worker>>;
ThreadMap threads_;
// Set to true when we're in the process of creating another thread.
@@ -788,9 +788,8 @@ void SequencedWorkerPool::Inner::ThreadLoop(Worker* this_worker) {
AutoLock lock(lock_);
DCHECK(thread_being_created_);
thread_being_created_ = false;
- std::pair<ThreadMap::iterator, bool> result =
- threads_.insert(
- std::make_pair(this_worker->tid(), make_linked_ptr(this_worker)));
+ std::pair<ThreadMap::iterator, bool> result = threads_.insert(
danakj 2016/01/27 22:20:51 unrelated, but: auto pair_result? This is the land
dcheng 2016/01/27 22:26:01 Done.
+ std::make_pair(this_worker->tid(), make_scoped_ptr(this_worker)));
DCHECK(result.second);
while (true) {

Powered by Google App Engine
This is Rietveld 408576698