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

Unified Diff: device/geolocation/wifi_polling_policy.h

Issue 2181183004: Revert of Geolocation: move from content/browser to device/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « device/geolocation/wifi_data_provider_win_unittest.cc ('k') | device/test/run_all_unittests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/geolocation/wifi_polling_policy.h
diff --git a/device/geolocation/wifi_polling_policy.h b/device/geolocation/wifi_polling_policy.h
deleted file mode 100644
index 2d820403d925d4615f75d41c979877605b21c7fa..0000000000000000000000000000000000000000
--- a/device/geolocation/wifi_polling_policy.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef DEVICE_GEOLOCATION_WIFI_POLLING_POLICY_H_
-#define DEVICE_GEOLOCATION_WIFI_POLLING_POLICY_H_
-
-#include "base/macros.h"
-
-namespace device {
-
-// Allows sharing and mocking of the update polling policy function.
-class WifiPollingPolicy {
- public:
- WifiPollingPolicy() {}
- virtual ~WifiPollingPolicy() {}
- // Calculates the new polling interval for wiFi scans, given the previous
- // interval and whether the last scan produced new results.
- virtual void UpdatePollingInterval(bool scan_results_differ) = 0;
- virtual int PollingInterval() = 0;
- virtual int NoWifiInterval() = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(WifiPollingPolicy);
-};
-
-// Generic polling policy, constants are compile-time parameterized to allow
-// tuning on a per-platform basis.
-template<int DEFAULT_INTERVAL,
- int NO_CHANGE_INTERVAL,
- int TWO_NO_CHANGE_INTERVAL,
- int NO_WIFI_INTERVAL>
-class GenericWifiPollingPolicy : public WifiPollingPolicy {
- public:
- GenericWifiPollingPolicy() : polling_interval_(DEFAULT_INTERVAL) {}
- // WifiPollingPolicy
- void UpdatePollingInterval(bool scan_results_differ) override {
- if (scan_results_differ) {
- polling_interval_ = DEFAULT_INTERVAL;
- } else if (polling_interval_ == DEFAULT_INTERVAL) {
- polling_interval_ = NO_CHANGE_INTERVAL;
- } else {
- DCHECK(polling_interval_ == NO_CHANGE_INTERVAL ||
- polling_interval_ == TWO_NO_CHANGE_INTERVAL);
- polling_interval_ = TWO_NO_CHANGE_INTERVAL;
- }
- }
- int PollingInterval() override { return polling_interval_; }
- int NoWifiInterval() override { return NO_WIFI_INTERVAL; }
-
- private:
- int polling_interval_;
-};
-
-} // namespace device
-
-#endif // DEVICE_GEOLOCATION_WIFI_POLLING_POLICY_H_
« no previous file with comments | « device/geolocation/wifi_data_provider_win_unittest.cc ('k') | device/test/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698