Chromium Code Reviews| Index: content/browser/device_orientation/data_fetcher_impl_android.cc |
| diff --git a/content/browser/device_orientation/data_fetcher_impl_android.cc b/content/browser/device_orientation/data_fetcher_impl_android.cc |
| index 03546359ae0fe8ff3e2f8638307f33d9f3408165..6f35e5bae00fe94966677fc321284bca4701ac4b 100644 |
| --- a/content/browser/device_orientation/data_fetcher_impl_android.cc |
| +++ b/content/browser/device_orientation/data_fetcher_impl_android.cc |
| @@ -54,7 +54,17 @@ DataFetcherImplAndroid::~DataFetcherImplAndroid() { |
| Stop(); |
| } |
| -bool DataFetcherImplAndroid::GetOrientation(Orientation* orientation) { |
| +DeviceData* DataFetcherImplAndroid::GetDeviceData( |
| + DeviceData::DeviceDataType* device_data_type) { |
| + switch (device_data_type) { |
|
bulach
2012/07/12 10:43:27
nit: as above..
aousterh
2012/07/12 17:13:57
Actually for this one, I will (hopefully) be addin
|
| + case DeviceData::kDeviceOrientationData: |
| + return GetOrientation(); |
| + default: |
| + return NULL; |
| + } |
| +} |
| + |
| +Orientation* DataFetcherImplAndroid::GetOrientation() { |
| // Do we have a new orientation value? (It's safe to do this outside the lock |
| // because we only skip the lock if the value is null. We always enter the |
| // lock if we're going to make use of the new value.) |
| @@ -62,9 +72,10 @@ bool DataFetcherImplAndroid::GetOrientation(Orientation* orientation) { |
| base::AutoLock autolock(next_orientation_lock_); |
| next_orientation_.swap(current_orientation_); |
| } |
| + scoped_ptr<Orientation> orientation(new Orientation()); |
| if (current_orientation_.get()) |
| *orientation = *current_orientation_; |
| - return true; |
| + return orientation.release(); |
| } |
| void DataFetcherImplAndroid::GotOrientation( |