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

Unified Diff: device/geolocation/wifi_data_provider_common.h

Issue 2192683003: Revert of Reland: Geolocation: move from content/browser to device/ (patchset #2 id:20001 of https:… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2810
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
Index: device/geolocation/wifi_data_provider_common.h
diff --git a/device/geolocation/wifi_data_provider_common.h b/device/geolocation/wifi_data_provider_common.h
deleted file mode 100644
index 68f9c4c6f491155830d6e2a2706036b3d6c8b074..0000000000000000000000000000000000000000
--- a/device/geolocation/wifi_data_provider_common.h
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (c) 2012 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_DATA_PROVIDER_COMMON_H_
-#define DEVICE_GEOLOCATION_WIFI_DATA_PROVIDER_COMMON_H_
-
-#include <assert.h>
-#include <stdint.h>
-
-#include <memory>
-
-#include "base/logging.h"
-#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
-#include "base/strings/string16.h"
-#include "device/geolocation/geolocation_export.h"
-#include "device/geolocation/wifi_data_provider.h"
-#include "device/geolocation/wifi_polling_policy.h"
-
-namespace device {
-
-// Converts a MAC address stored as an array of uint8_t to a string.
-base::string16 MacAddressAsString16(const uint8_t mac_as_int[6]);
-
-// Base class to promote code sharing between platform specific wifi data
-// providers. It's optional for specific platforms to derive this, but if they
-// do polling behavior is taken care of by this base class, and all the platform
-// need do is provide the underlying WLAN access API and polling policy.
-// Also designed this way for ease of testing the cross-platform behavior.
-class DEVICE_GEOLOCATION_EXPORT WifiDataProviderCommon
- : public WifiDataProvider {
- public:
- // Interface to abstract the low level data OS library call, and to allow
- // mocking (hence public).
- class WlanApiInterface {
- public:
- virtual ~WlanApiInterface() {}
- // Gets wifi data for all visible access points.
- virtual bool GetAccessPointData(WifiData::AccessPointDataSet* data) = 0;
- };
-
- WifiDataProviderCommon();
-
- // WifiDataProvider implementation
- void StartDataProvider() override;
- void StopDataProvider() override;
- bool GetData(WifiData* data) override;
-
- protected:
- ~WifiDataProviderCommon() override;
-
- // Returns ownership.
- virtual WlanApiInterface* NewWlanApi() = 0;
-
- // Returns ownership.
- virtual WifiPollingPolicy* NewPollingPolicy() = 0;
-
- private:
- // Runs a scan. Calls the callbacks if new data is found.
- void DoWifiScanTask();
-
- // Will schedule a scan; i.e. enqueue DoWifiScanTask deferred task.
- void ScheduleNextScan(int interval);
-
- WifiData wifi_data_;
-
- // Whether we've successfully completed a scan for WiFi data.
- bool is_first_scan_complete_;
-
- // Underlying OS wifi API.
- std::unique_ptr<WlanApiInterface> wlan_api_;
-
- // Controls the polling update interval.
- std::unique_ptr<WifiPollingPolicy> polling_policy_;
-
- // Holder for delayed tasks; takes care of cleanup.
- base::WeakPtrFactory<WifiDataProviderCommon> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(WifiDataProviderCommon);
-};
-
-} // namespace device
-
-#endif // DEVICE_GEOLOCATION_WIFI_DATA_PROVIDER_COMMON_H_
« no previous file with comments | « device/geolocation/wifi_data_provider_chromeos_unittest.cc ('k') | device/geolocation/wifi_data_provider_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698