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

Unified Diff: components/doodle/doodle_service.cc

Issue 2843403003: OnDoodleConfigRevalidated (Closed)
Patch Set: Created 3 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/doodle/doodle_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/doodle/doodle_service.cc
diff --git a/components/doodle/doodle_service.cc b/components/doodle/doodle_service.cc
index cd4b053edf1c7083b14f13e6c7f8db6e290bd971..ee7c1787b5420a742fc82c40980b0f8fa115fb4c 100644
--- a/components/doodle/doodle_service.cc
+++ b/components/doodle/doodle_service.cc
@@ -192,10 +192,16 @@ DoodleService::DownloadOutcome DoodleService::HandleNewConfig(
DownloadOutcome outcome =
DetermineDownloadOutcome(cached_config_, new_config, state, expired);
- // If the config changed, update our cache and notify observers.
// Note that this checks both for existence changes as well as changes of the
// configs themselves.
- if (cached_config_ != new_config) {
+ if (cached_config_ == new_config) {
+ for (auto& observer : observers_) {
+ observer.OnDoodleConfigRevalidated();
+ }
+ } else {
+ // The config changed. Update our cache and the prefs, and notify observers.
+ cached_config_ = new_config;
+
UpdateCachedConfig(time_to_live, new_config);
for (auto& observer : observers_) {
« no previous file with comments | « components/doodle/doodle_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698