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

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

Issue 2240083004: Remove stl_util's STLDeleteContainerPairPointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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/client_side_detection_service_unittest.cc
diff --git a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
index cea82c8adc5110fbab7d2e43217e990b8c5ac860..6761f9059effb1019b8f61ee365866f14797a2aa 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
@@ -15,6 +15,7 @@
#include "base/callback.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/field_trial.h"
#include "base/run_loop.h"
@@ -154,43 +155,40 @@ class ClientSideDetectionServiceTest : public testing::Test {
}
void SetCache(const GURL& gurl, bool is_phishing, base::Time time) {
- csd_service_->cache_[gurl] =
- make_linked_ptr(new ClientSideDetectionService::CacheState(is_phishing,
- time));
+ csd_service_->cache_[gurl] = base::WrapUnique(
mattm 2016/08/16 20:41:22 Use MakeUnique instead of WrapUnique? (see chromiu
Avi (use Gerrit) 2016/08/17 18:25:37 Sometimes MakeUnique works, sometimes it fails for
mattm 2016/08/17 21:28:34 nit: Could you update the other ones in here too?
Avi (use Gerrit) 2016/08/17 21:34:55 Done.
+ new ClientSideDetectionService::CacheState(is_phishing, time));
}
void TestCache() {
- ClientSideDetectionService::PhishingCache& cache = csd_service_->cache_;
+ auto& cache = csd_service_->cache_;
base::Time now = base::Time::Now();
base::Time time =
now - base::TimeDelta::FromDays(
ClientSideDetectionService::kNegativeCacheIntervalDays) +
base::TimeDelta::FromMinutes(5);
- cache[GURL("http://first.url.com/")] =
- make_linked_ptr(new ClientSideDetectionService::CacheState(false,
- time));
+ cache[GURL("http://first.url.com/")] = base::WrapUnique(
+ new ClientSideDetectionService::CacheState(false, time));
time =
now - base::TimeDelta::FromDays(
ClientSideDetectionService::kNegativeCacheIntervalDays) -
base::TimeDelta::FromHours(1);
- cache[GURL("http://second.url.com/")] =
- make_linked_ptr(new ClientSideDetectionService::CacheState(false,
- time));
+ cache[GURL("http://second.url.com/")] = base::WrapUnique(
+ new ClientSideDetectionService::CacheState(false, time));
time =
now - base::TimeDelta::FromMinutes(
ClientSideDetectionService::kPositiveCacheIntervalMinutes) -
base::TimeDelta::FromMinutes(5);
- cache[GURL("http://third.url.com/")] =
- make_linked_ptr(new ClientSideDetectionService::CacheState(true, time));
+ cache[GURL("http://third.url.com/")] = base::WrapUnique(
+ new ClientSideDetectionService::CacheState(true, time));
time =
now - base::TimeDelta::FromMinutes(
ClientSideDetectionService::kPositiveCacheIntervalMinutes) +
base::TimeDelta::FromMinutes(5);
- cache[GURL("http://fourth.url.com/")] =
- make_linked_ptr(new ClientSideDetectionService::CacheState(true, time));
+ cache[GURL("http://fourth.url.com/")] = base::WrapUnique(
+ new ClientSideDetectionService::CacheState(true, time));
csd_service_->UpdateCache();

Powered by Google App Engine
This is Rietveld 408576698