| Index: content/browser/geolocation/wifi_data_provider_chromeos.cc
|
| diff --git a/device/geolocation/wifi_data_provider_chromeos.cc b/content/browser/geolocation/wifi_data_provider_chromeos.cc
|
| similarity index 90%
|
| rename from device/geolocation/wifi_data_provider_chromeos.cc
|
| rename to content/browser/geolocation/wifi_data_provider_chromeos.cc
|
| index 9f25def765ea1fadbc1c6cb7b6493760a42ffeb3..4f148667f6357abfb87d4cdc5d978e3236d91e36 100644
|
| --- a/device/geolocation/wifi_data_provider_chromeos.cc
|
| +++ b/content/browser/geolocation/wifi_data_provider_chromeos.cc
|
| @@ -4,18 +4,17 @@
|
|
|
| // Provides wifi scan API binding for chromeos, using proprietary APIs.
|
|
|
| -#include "device/geolocation/wifi_data_provider_chromeos.h"
|
| +#include "content/browser/geolocation/wifi_data_provider_chromeos.h"
|
|
|
| #include <stdint.h>
|
|
|
| #include "base/bind.h"
|
| -#include "base/single_thread_task_runner.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| -#include "base/threading/thread_task_runner_handle.h"
|
| #include "chromeos/network/geolocation_handler.h"
|
| -#include "device/geolocation/wifi_data_provider_manager.h"
|
| +#include "content/browser/geolocation/wifi_data_provider_manager.h"
|
| +#include "content/public/browser/browser_thread.h"
|
|
|
| -namespace device {
|
| +namespace content {
|
|
|
| namespace {
|
|
|
| @@ -28,9 +27,8 @@ const int kNoWifiPollingIntervalMilliseconds = 20 * 1000; // 20s
|
| } // namespace
|
|
|
| WifiDataProviderChromeOs::WifiDataProviderChromeOs()
|
| - : started_(false),
|
| - is_first_scan_complete_(false),
|
| - main_task_runner_(base::ThreadTaskRunnerHandle::Get()) {}
|
| + : started_(false), is_first_scan_complete_(false) {
|
| +}
|
|
|
| WifiDataProviderChromeOs::~WifiDataProviderChromeOs() {
|
| }
|
| @@ -63,12 +61,12 @@ bool WifiDataProviderChromeOs::GetData(WifiData* data) {
|
| }
|
|
|
| void WifiDataProviderChromeOs::DoStartTaskOnUIThread() {
|
| - CHECK(main_task_runner_->BelongsToCurrentThread());
|
| + CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| DoWifiScanTaskOnUIThread();
|
| }
|
|
|
| void WifiDataProviderChromeOs::DoWifiScanTaskOnUIThread() {
|
| - CHECK(main_task_runner_->BelongsToCurrentThread());
|
| + CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
|
|
| // This method could be scheduled after a ScheduleStop.
|
| if (!started_)
|
| @@ -115,7 +113,8 @@ void WifiDataProviderChromeOs::DidWifiScanTask(const WifiData& new_data) {
|
| void WifiDataProviderChromeOs::ScheduleNextScan(int interval) {
|
| DCHECK(CalledOnClientThread());
|
| DCHECK(started_);
|
| - main_task_runner_->PostDelayedTask(
|
| + BrowserThread::PostDelayedTask(
|
| + BrowserThread::UI,
|
| FROM_HERE,
|
| base::Bind(&WifiDataProviderChromeOs::DoWifiScanTaskOnUIThread, this),
|
| base::TimeDelta::FromMilliseconds(interval));
|
| @@ -133,7 +132,8 @@ void WifiDataProviderChromeOs::ScheduleStart() {
|
| started_ = true;
|
| // Perform first scan ASAP regardless of the polling policy. If this scan
|
| // fails we'll retry at a rate in line with the polling policy.
|
| - main_task_runner_->PostTask(
|
| + BrowserThread::PostTask(
|
| + BrowserThread::UI,
|
| FROM_HERE,
|
| base::Bind(&WifiDataProviderChromeOs::DoStartTaskOnUIThread, this));
|
| }
|
| @@ -172,4 +172,4 @@ WifiDataProvider* WifiDataProviderManager::DefaultFactoryFunction() {
|
| return new WifiDataProviderChromeOs();
|
| }
|
|
|
| -} // namespace device
|
| +} // namespace content
|
|
|