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

Unified Diff: components/quirks/quirks_manager.cc

Issue 1921923002: Convert //components/[o-t]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 | « components/quirks/quirks_manager.h ('k') | components/rappor/log_uploader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/quirks/quirks_manager.cc
diff --git a/components/quirks/quirks_manager.cc b/components/quirks/quirks_manager.cc
index db97631ab9fd0e6962e0b52ad3cc3ffd87a002f2..7f35bc6fa8b8bb0eecb8386312c74fee127dcba0 100644
--- a/components/quirks/quirks_manager.cc
+++ b/components/quirks/quirks_manager.cc
@@ -9,6 +9,7 @@
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/format_macros.h"
+#include "base/memory/ptr_util.h"
#include "base/path_service.h"
#include "base/rand_util.h"
#include "base/strings/stringprintf.h"
@@ -78,7 +79,7 @@ std::string IdToFileName(int64_t product_id) {
// QuirksManager
QuirksManager::QuirksManager(
- scoped_ptr<Delegate> delegate,
+ std::unique_ptr<Delegate> delegate,
scoped_refptr<base::SequencedWorkerPool> blocking_pool,
PrefService* local_state,
scoped_refptr<net::URLRequestContextGetter> url_context_getter)
@@ -96,7 +97,7 @@ QuirksManager::~QuirksManager() {
// static
void QuirksManager::Initialize(
- scoped_ptr<Delegate> delegate,
+ std::unique_ptr<Delegate> delegate,
scoped_refptr<base::SequencedWorkerPool> blocking_pool,
PrefService* local_state,
scoped_refptr<net::URLRequestContextGetter> url_context_getter) {
@@ -131,7 +132,7 @@ void QuirksManager::OnLoginCompleted() {
clients_.clear();
}
- for (const scoped_ptr<QuirksClient>& client : clients_)
+ for (const std::unique_ptr<QuirksClient>& client : clients_)
client->StartDownload();
}
@@ -156,14 +157,14 @@ void QuirksManager::ClientFinished(QuirksClient* client) {
DCHECK(thread_checker_.CalledOnValidThread());
SetLastServerCheck(client->product_id(), base::Time::Now());
auto it = std::find_if(clients_.begin(), clients_.end(),
- [client](const scoped_ptr<QuirksClient>& c) {
+ [client](const std::unique_ptr<QuirksClient>& c) {
return c.get() == client;
});
CHECK(it != clients_.end());
clients_.erase(it);
}
-scoped_ptr<net::URLFetcher> QuirksManager::CreateURLFetcher(
+std::unique_ptr<net::URLFetcher> QuirksManager::CreateURLFetcher(
const GURL& url,
net::URLFetcherDelegate* delegate) {
if (!fake_quirks_fetcher_creator_.is_null())
@@ -244,7 +245,7 @@ void QuirksManager::CreateClient(
DCHECK(thread_checker_.CalledOnValidThread());
QuirksClient* client =
new QuirksClient(product_id, on_request_finished, this);
- clients_.insert(make_scoped_ptr(client));
+ clients_.insert(base::WrapUnique(client));
if (!waiting_for_login_)
client->StartDownload();
else
« no previous file with comments | « components/quirks/quirks_manager.h ('k') | components/rappor/log_uploader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698