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

Unified Diff: chrome/browser/safe_browsing/browser_feature_extractor.cc

Issue 1870003002: Convert //chrome/browser/safe_browsing from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and address comments 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
Index: chrome/browser/safe_browsing/browser_feature_extractor.cc
diff --git a/chrome/browser/safe_browsing/browser_feature_extractor.cc b/chrome/browser/safe_browsing/browser_feature_extractor.cc
index 27b880c7b39f88f8d16e618ec77995c895ef9ee5..089b017a440e3d90663bcc06fae485adb2a68a33 100644
--- a/chrome/browser/safe_browsing/browser_feature_extractor.cc
+++ b/chrome/browser/safe_browsing/browser_feature_extractor.cc
@@ -238,9 +238,9 @@ void BrowserFeatureExtractor::ExtractFeatures(const BrowseInfo* info,
request);
}
- // The API doesn't take a scoped_ptr because the API gets mocked and we
- // cannot mock an API that takes scoped_ptr as arguments.
- scoped_ptr<ClientPhishingRequest> req(request);
+ // The API doesn't take a std::unique_ptr because the API gets mocked and we
+ // cannot mock an API that takes std::unique_ptr as arguments.
+ std::unique_ptr<ClientPhishingRequest> req(request);
ExtractBrowseInfoFeatures(*info, request);
base::ThreadTaskRunnerHandle::Get()->PostTask(
@@ -258,14 +258,14 @@ void BrowserFeatureExtractor::ExtractMalwareFeatures(
// Grab the IPs because they might go away before we're done
// checking them against the IP blacklist on the IO thread.
- scoped_ptr<IPUrlMap> ips(new IPUrlMap);
+ std::unique_ptr<IPUrlMap> ips(new IPUrlMap);
ips->swap(info->ips);
IPUrlMap* ips_ptr = ips.get();
- // The API doesn't take a scoped_ptr because the API gets mocked and we
- // cannot mock an API that takes scoped_ptr as arguments.
- scoped_ptr<ClientMalwareRequest> req(request);
+ // The API doesn't take a std::unique_ptr because the API gets mocked and we
+ // cannot mock an API that takes std::unique_ptr as arguments.
+ std::unique_ptr<ClientMalwareRequest> req(request);
// IP blacklist lookups have to happen on the IO thread.
BrowserThread::PostTaskAndReply(
@@ -305,7 +305,7 @@ void BrowserFeatureExtractor::ExtractBrowseInfoFeatures(
}
void BrowserFeatureExtractor::StartExtractFeatures(
- scoped_ptr<ClientPhishingRequest> request,
+ std::unique_ptr<ClientPhishingRequest> request,
const DoneCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
history::HistoryService* history;
@@ -324,7 +324,7 @@ void BrowserFeatureExtractor::StartExtractFeatures(
}
void BrowserFeatureExtractor::QueryUrlHistoryDone(
- scoped_ptr<ClientPhishingRequest> request,
+ std::unique_ptr<ClientPhishingRequest> request,
const DoneCallback& callback,
bool success,
const history::URLRow& row,
@@ -391,7 +391,7 @@ void BrowserFeatureExtractor::QueryUrlHistoryDone(
}
void BrowserFeatureExtractor::QueryHttpHostVisitsDone(
- scoped_ptr<ClientPhishingRequest> request,
+ std::unique_ptr<ClientPhishingRequest> request,
const DoneCallback& callback,
bool success,
int num_visits,
@@ -422,7 +422,7 @@ void BrowserFeatureExtractor::QueryHttpHostVisitsDone(
}
void BrowserFeatureExtractor::QueryHttpsHostVisitsDone(
- scoped_ptr<ClientPhishingRequest> request,
+ std::unique_ptr<ClientPhishingRequest> request,
const DoneCallback& callback,
bool success,
int num_visits,
@@ -475,9 +475,9 @@ bool BrowserFeatureExtractor::GetHistoryService(
}
void BrowserFeatureExtractor::FinishExtractMalwareFeatures(
- scoped_ptr<IPUrlMap> bad_ips,
+ std::unique_ptr<IPUrlMap> bad_ips,
MalwareDoneCallback callback,
- scoped_ptr<ClientMalwareRequest> request) {
+ std::unique_ptr<ClientMalwareRequest> request) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
int matched_bad_ips = 0;
for (IPUrlMap::const_iterator it = bad_ips->begin();

Powered by Google App Engine
This is Rietveld 408576698