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

Side by Side Diff: components/variations/service/variations_service.cc

Issue 2430823002: Reduce usage of FOR_EACH_OBSERVER macro in components/ (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/variations/service/variations_service.h" 5 #include "components/variations/service/variations_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 } 619 }
620 620
621 DoActualFetch(); 621 DoActualFetch();
622 } 622 }
623 623
624 void VariationsService::NotifyObservers( 624 void VariationsService::NotifyObservers(
625 const variations::VariationsSeedSimulator::Result& result) { 625 const variations::VariationsSeedSimulator::Result& result) {
626 DCHECK(thread_checker_.CalledOnValidThread()); 626 DCHECK(thread_checker_.CalledOnValidThread());
627 627
628 if (result.kill_critical_group_change_count > 0) { 628 if (result.kill_critical_group_change_count > 0) {
629 FOR_EACH_OBSERVER(Observer, observer_list_, 629 for (auto& observer : observer_list_)
630 OnExperimentChangesDetected(Observer::CRITICAL)); 630 observer.OnExperimentChangesDetected(Observer::CRITICAL);
631 } else if (result.kill_best_effort_group_change_count > 0) { 631 } else if (result.kill_best_effort_group_change_count > 0) {
632 FOR_EACH_OBSERVER(Observer, observer_list_, 632 for (auto& observer : observer_list_)
633 OnExperimentChangesDetected(Observer::BEST_EFFORT)); 633 observer.OnExperimentChangesDetected(Observer::BEST_EFFORT);
634 } 634 }
635 } 635 }
636 636
637 void VariationsService::OnURLFetchComplete(const net::URLFetcher* source) { 637 void VariationsService::OnURLFetchComplete(const net::URLFetcher* source) {
638 DCHECK(thread_checker_.CalledOnValidThread()); 638 DCHECK(thread_checker_.CalledOnValidThread());
639 DCHECK_EQ(pending_seed_request_.get(), source); 639 DCHECK_EQ(pending_seed_request_.get(), source);
640 640
641 const bool is_first_request = !initial_request_completed_; 641 const bool is_first_request = !initial_request_completed_;
642 initial_request_completed_ = true; 642 initial_request_completed_ = true;
643 643
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 894
895 if (got_stored_country && stored_country == country_override) 895 if (got_stored_country && stored_country == country_override)
896 return false; 896 return false;
897 897
898 base::Version version(version_info::GetVersionNumber()); 898 base::Version version(version_info::GetVersionNumber());
899 StorePermanentCountry(version, country_override); 899 StorePermanentCountry(version, country_override);
900 return true; 900 return true;
901 } 901 }
902 902
903 } // namespace variations 903 } // namespace variations
OLDNEW
« no previous file with comments | « components/user_prefs/tracked/segregated_pref_store.cc ('k') | components/wallpaper/wallpaper_manager_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698