| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |