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

Unified Diff: chrome/browser/geolocation/wifi_data_provider_common.cc

Issue 2971006: Landing patch 2825039 (Closed)
Patch Set: Tests passed Created 10 years, 5 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/geolocation/wifi_data_provider_common.cc
diff --git a/chrome/browser/geolocation/wifi_data_provider_common.cc b/chrome/browser/geolocation/wifi_data_provider_common.cc
index a4c6a69194508a07f227100ad1cf710604c14bc2..39df876f83404e2bfed8c62ff734ed3683916531 100644
--- a/chrome/browser/geolocation/wifi_data_provider_common.cc
+++ b/chrome/browser/geolocation/wifi_data_provider_common.cc
@@ -76,19 +76,21 @@ void WifiDataProviderCommon::CleanUp() {
void WifiDataProviderCommon::DoWifiScanTask() {
bool update_available = false;
WifiData new_data;
- if (wlan_api_->GetAccessPointData(&new_data.access_point_data)) {
+ if (!wlan_api_->GetAccessPointData(&new_data.access_point_data)) {
+ ScheduleNextScan(polling_policy_->NoWifiInterval());
+ } else {
{
AutoLock lock(data_mutex_);
update_available = wifi_data_.DiffersSignificantly(new_data);
wifi_data_ = new_data;
}
- if (update_available || !is_first_scan_complete_) {
- is_first_scan_complete_ = true;
- NotifyListeners();
- }
+ polling_policy_->UpdatePollingInterval(update_available);
+ ScheduleNextScan(polling_policy_->PollingInterval());
+ }
+ if (update_available || !is_first_scan_complete_) {
+ is_first_scan_complete_ = true;
+ NotifyListeners();
}
- polling_policy_->UpdatePollingInterval(update_available);
- ScheduleNextScan(polling_policy_->PollingInterval());
}
void WifiDataProviderCommon::ScheduleNextScan(int interval) {

Powered by Google App Engine
This is Rietveld 408576698