diff options
author | tedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-20 21:22:02 +0000 |
---|---|---|
committer | tedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-20 21:22:02 +0000 |
commit | 2d2118e9ebf9c85974e6299680253598a7a5610d (patch) | |
tree | 378eefc1a7f5b4e5eb33466a462ca3780a8655fe | |
parent | 8809f144c378ccfe77ae574d47418aba7cf55491 (diff) | |
download | chromium_src-2d2118e9ebf9c85974e6299680253598a7a5610d.zip chromium_src-2d2118e9ebf9c85974e6299680253598a7a5610d.tar.gz chromium_src-2d2118e9ebf9c85974e6299680253598a7a5610d.tar.bz2 |
Convert use of int ms to TimeDelta in files owned by bulach.
BUG=108171
TEST=
Review URL: http://codereview.chromium.org/9195028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118502 0039d316-1c4b-4281-b951-d872f2087c98
6 files changed, 17 insertions, 16 deletions
diff --git a/content/browser/device_orientation/provider_impl.cc b/content/browser/device_orientation/provider_impl.cc index e60cf20..8f111e3 100644 --- a/content/browser/device_orientation/provider_impl.cc +++ b/content/browser/device_orientation/provider_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// 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. @@ -154,7 +154,7 @@ void ProviderImpl::ScheduleDoPoll() { polling_loop->PostDelayedTask( FROM_HERE, base::Bind(&ProviderImpl::DoPoll, weak_factory_.GetWeakPtr()), - SamplingIntervalMs()); + SamplingInterval()); } namespace { @@ -192,14 +192,14 @@ bool ProviderImpl::SignificantlyDifferent(const Orientation& o1, o2.gamma_); } -int ProviderImpl::SamplingIntervalMs() const { +base::TimeDelta ProviderImpl::SamplingInterval() const { DCHECK(MessageLoop::current() == polling_thread_->message_loop()); DCHECK(data_fetcher_.get()); // TODO(erg): There used to be unused code here, that called a default // implementation on the DataFetcherInterface that was never defined. I'm // removing unused methods from headers. - return kDesiredSamplingIntervalMs; + return base::TimeDelta::FromMilliseconds(kDesiredSamplingIntervalMs); } } // namespace device_orientation diff --git a/content/browser/device_orientation/provider_impl.h b/content/browser/device_orientation/provider_impl.h index 4fb5ebd..c7c12eb 100644 --- a/content/browser/device_orientation/provider_impl.h +++ b/content/browser/device_orientation/provider_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. @@ -10,6 +10,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" +#include "base/time.h" #include "content/browser/device_orientation/data_fetcher.h" #include "content/browser/device_orientation/orientation.h" #include "content/browser/device_orientation/provider.h" @@ -61,7 +62,7 @@ class ProviderImpl : public Provider { const Orientation& orientation2); enum { kDesiredSamplingIntervalMs = 100 }; - int SamplingIntervalMs() const; + base::TimeDelta SamplingInterval() const; // The Message Loop on which this object was created. // Typically the I/O loop, but may be something else during testing. diff --git a/content/browser/geolocation/device_data_provider_unittest.cc b/content/browser/geolocation/device_data_provider_unittest.cc index 3fb5cc4..640a8fc 100644 --- a/content/browser/geolocation/device_data_provider_unittest.cc +++ b/content/browser/geolocation/device_data_provider_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// 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. @@ -27,12 +27,12 @@ TEST(GeolocationDeviceDataProviderWifiData, CreateDestroy) { for (int i = 0; i < 10; i++) { DeviceDataProvider<WifiData>::Register(&listener); for (int j = 0; j < 10; j++) { - base::PlatformThread::Sleep(0); + base::PlatformThread::Sleep(base::TimeDelta()); main_message_loop.RunAllPending(); // See comment above } DeviceDataProvider<WifiData>::Unregister(&listener); for (int j = 0; j < 10; j++) { - base::PlatformThread::Sleep(0); + base::PlatformThread::Sleep(base::TimeDelta()); main_message_loop.RunAllPending(); // See comment above } } diff --git a/content/browser/geolocation/gps_location_provider_linux.cc b/content/browser/geolocation/gps_location_provider_linux.cc index 9b53999..1c00d69 100644 --- a/content/browser/geolocation/gps_location_provider_linux.cc +++ b/content/browser/geolocation/gps_location_provider_linux.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. @@ -125,7 +125,7 @@ void GpsLocationProviderLinux::ScheduleNextGpsPoll(int interval) { FROM_HERE, base::Bind(&GpsLocationProviderLinux::DoGpsPollTask, weak_factory_.GetWeakPtr()), - interval); + base::TimeDelta::FromMilliseconds(interval)); } LocationProviderBase* NewSystemLocationProvider() { diff --git a/content/browser/geolocation/network_location_provider.cc b/content/browser/geolocation/network_location_provider.cc index d4c83fe..aebbf08 100644 --- a/content/browser/geolocation/network_location_provider.cc +++ b/content/browser/geolocation/network_location_provider.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. @@ -14,7 +14,7 @@ using content::AccessTokenStore; namespace { // The maximum period of time we'll wait for a complete set of device data // before sending the request. -const int kDataCompleteWaitPeriod = 1000 * 2; // 2 seconds +const int kDataCompleteWaitSeconds = 2; } // namespace // static @@ -213,7 +213,7 @@ bool NetworkLocationProvider::StartProvider(bool high_accuracy) { FROM_HERE, base::Bind(&NetworkLocationProvider::RequestPosition, weak_factory_.GetWeakPtr()), - kDataCompleteWaitPeriod); + base::TimeDelta::FromSeconds(kDataCompleteWaitSeconds)); // Get the device data. is_radio_data_complete_ = radio_data_provider_->GetData(&radio_data_); is_wifi_data_complete_ = wifi_data_provider_->GetData(&wifi_data_); diff --git a/content/browser/geolocation/wifi_data_provider_common.cc b/content/browser/geolocation/wifi_data_provider_common.cc index 16c11df..7156d12 100644 --- a/content/browser/geolocation/wifi_data_provider_common.cc +++ b/content/browser/geolocation/wifi_data_provider_common.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. @@ -105,5 +105,5 @@ void WifiDataProviderCommon::ScheduleNextScan(int interval) { FROM_HERE, base::Bind(&WifiDataProviderCommon::DoWifiScanTask, weak_factory_.GetWeakPtr()), - interval); + base::TimeDelta::FromMilliseconds(interval)); } |