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

Unified Diff: base/threading/sequenced_worker_pool.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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/sequenced_worker_pool.h ('k') | base/threading/sequenced_worker_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/sequenced_worker_pool.cc
diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc
index 086f54ba805e1c11fb519d441730ae34822d8acc..24a07511a9847a4faba4dc855470cbda3fbb347b 100644
--- a/base/threading/sequenced_worker_pool.cc
+++ b/base/threading/sequenced_worker_pool.cc
@@ -8,6 +8,7 @@
#include <list>
#include <map>
+#include <memory>
#include <set>
#include <utility>
#include <vector>
@@ -19,7 +20,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/condition_variable.h"
@@ -445,7 +446,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.
- using ThreadMap = std::map<PlatformThreadId, scoped_ptr<Worker>>;
+ using ThreadMap = std::map<PlatformThreadId, std::unique_ptr<Worker>>;
ThreadMap threads_;
// Set to true when we're in the process of creating another thread.
@@ -786,7 +787,7 @@ void SequencedWorkerPool::Inner::ThreadLoop(Worker* this_worker) {
DCHECK(thread_being_created_);
thread_being_created_ = false;
auto result = threads_.insert(
- std::make_pair(this_worker->tid(), make_scoped_ptr(this_worker)));
+ std::make_pair(this_worker->tid(), WrapUnique(this_worker)));
DCHECK(result.second);
while (true) {
« no previous file with comments | « base/threading/sequenced_worker_pool.h ('k') | base/threading/sequenced_worker_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698