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

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: mattm 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..9498d8838a5ee0bb38dd8d1ebf78ce1308e32872 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"
@@ -155,42 +156,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));
+ base::MakeUnique<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));
+ base::MakeUnique<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::MakeUnique<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::MakeUnique<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));
+ base::MakeUnique<ClientSideDetectionService::CacheState>(true, time);
csd_service_->UpdateCache();
« no previous file with comments | « chrome/browser/safe_browsing/client_side_detection_service.cc ('k') | components/spellcheck/browser/spelling_service_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698