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

Unified Diff: components/search_engines/template_url_service.cc

Issue 855633002: [Clean-up] Replace the final straggler use of MockTimeProvider with Clock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore position of moved code, and extract a helper function for comparing timestamps Created 5 years, 11 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: components/search_engines/template_url_service.cc
diff --git a/components/search_engines/template_url_service.cc b/components/search_engines/template_url_service.cc
index 86f6ceeaebdb287a6c97dd7d5f78d263de59e52a..46c53fe2fa5a7d7ef6ba701cdb9cda4b18663a21 100644
--- a/components/search_engines/template_url_service.cc
+++ b/components/search_engines/template_url_service.cc
@@ -20,6 +20,7 @@
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/time/default_clock.h"
#include "base/time/time.h"
#include "components/rappor/rappor_service.h"
#include "components/search_engines/search_engines_pref_names.h"
@@ -198,7 +199,7 @@ TemplateURLService::TemplateURLService(
load_handle_(0),
default_search_provider_(NULL),
next_id_(kInvalidTemplateURLID + 1),
- time_provider_(&base::Time::Now),
+ clock_(new base::DefaultClock),
models_associated_(false),
processing_syncer_changes_(false),
dsp_change_origin_(DSP_CHANGE_OTHER),
@@ -223,7 +224,7 @@ TemplateURLService::TemplateURLService(const Initializer* initializers,
load_handle_(0),
default_search_provider_(NULL),
next_id_(kInvalidTemplateURLID + 1),
- time_provider_(&base::Time::Now),
+ clock_(new base::DefaultClock),
models_associated_(false),
processing_syncer_changes_(false),
dsp_change_origin_(DSP_CHANGE_OTHER),
@@ -2067,7 +2068,7 @@ bool TemplateURLService::ResetTemplateURLNoNotify(
data.favicon_url = GURL();
}
data.safe_for_autoreplace = false;
- data.last_modified = time_provider_();
+ data.last_modified = clock_->Now();
return UpdateNoNotify(url, TemplateURL(data));
}

Powered by Google App Engine
This is Rietveld 408576698