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

Side by Side Diff: content/browser/geolocation/wifi_data_provider_chromeos.cc

Issue 474433003: Cleaner organization of WifiDataProvider code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rabase and rename arguments to manager Created 6 years, 4 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 | Annotate | Revision Log
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 // Provides wifi scan API binding for chromeos, using proprietary APIs. 5 // Provides wifi scan API binding for chromeos, using proprietary APIs.
6 6
7 #include "content/browser/geolocation/wifi_data_provider_chromeos.h" 7 #include "content/browser/geolocation/wifi_data_provider_chromeos.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "chromeos/network/geolocation_handler.h" 11 #include "chromeos/network/geolocation_handler.h"
12 #include "content/browser/geolocation/wifi_data_provider_manager.h"
12 #include "content/public/browser/browser_thread.h" 13 #include "content/public/browser/browser_thread.h"
13 14
14 namespace content { 15 namespace content {
15 16
16 namespace { 17 namespace {
17 18
18 // The time periods between successive polls of the wifi data. 19 // The time periods between successive polls of the wifi data.
19 const int kDefaultPollingIntervalMilliseconds = 10 * 1000; // 10s 20 const int kDefaultPollingIntervalMilliseconds = 10 * 1000; // 10s
20 const int kNoChangePollingIntervalMilliseconds = 2 * 60 * 1000; // 2 mins 21 const int kNoChangePollingIntervalMilliseconds = 2 * 60 * 1000; // 2 mins
21 const int kTwoNoChangePollingIntervalMilliseconds = 10 * 60 * 1000; // 10 mins 22 const int kTwoNoChangePollingIntervalMilliseconds = 10 * 60 * 1000; // 10 mins
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 result->insert(ap_data); 160 result->insert(ap_data);
160 } 161 }
161 // If the age is significantly longer than our long polling time, assume the 162 // If the age is significantly longer than our long polling time, assume the
162 // data is stale and return false which will trigger a faster update. 163 // data is stale and return false which will trigger a faster update.
163 if (age_ms > kTwoNoChangePollingIntervalMilliseconds * 2) 164 if (age_ms > kTwoNoChangePollingIntervalMilliseconds * 2)
164 return false; 165 return false;
165 return true; 166 return true;
166 } 167 }
167 168
168 // static 169 // static
169 WifiDataProviderImplBase* WifiDataProvider::DefaultFactoryFunction() { 170 WifiDataProvider* WifiDataProviderManager::DefaultFactoryFunction() {
170 return new WifiDataProviderChromeOs(); 171 return new WifiDataProviderChromeOs();
171 } 172 }
172 173
173 } // namespace content 174 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/geolocation/wifi_data_provider_chromeos.h ('k') | content/browser/geolocation/wifi_data_provider_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698