| Index: content/browser/device_orientation/data_fetcher_impl_android.h
|
| diff --git a/content/browser/device_orientation/data_fetcher_impl_android.h b/content/browser/device_orientation/data_fetcher_impl_android.h
|
| index 16661b8e1e018f869a22b5bd7a997725fc5da016..ae7bee014889c87d1e76ecf3a910f7c3fe89243b 100644
|
| --- a/content/browser/device_orientation/data_fetcher_impl_android.h
|
| +++ b/content/browser/device_orientation/data_fetcher_impl_android.h
|
| @@ -10,17 +10,19 @@
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/synchronization/lock.h"
|
| #include "content/browser/device_orientation/data_fetcher.h"
|
| -#include "content/browser/device_orientation/orientation.h"
|
| +#include "content/browser/device_orientation/device_data.h"
|
|
|
| namespace device_orientation {
|
|
|
| +class Orientation;
|
| +
|
| // Android implementation of DeviceOrientation API.
|
|
|
| // Android's SensorManager has a push API, whereas Chrome wants to pull data.
|
| // To fit them together, we store incoming sensor events in a 1-element buffer.
|
| // SensorManager calls SetOrientation() which pushes a new value (discarding the
|
| -// previous value if any). Chrome calls GetOrientation() which reads the most
|
| -// recent value. Repeated calls to GetOrientation() will return the same value.
|
| +// previous value if any). Chrome calls GetDeviceData() which reads the most
|
| +// recent value. Repeated calls to GetDeviceData() will return the same value.
|
|
|
| class DataFetcherImplAndroid : public DataFetcher {
|
| public:
|
| @@ -38,21 +40,22 @@ class DataFetcherImplAndroid : public DataFetcher {
|
| double alpha, double beta, double gamma);
|
|
|
| // Implementation of DataFetcher.
|
| - virtual bool GetOrientation(Orientation* orientation) OVERRIDE;
|
| + virtual const DeviceData* GetDeviceData(DeviceData::Type type) OVERRIDE;
|
|
|
| private:
|
| DataFetcherImplAndroid();
|
| + const Orientation* GetOrientation();
|
|
|
| // Wrappers for JNI methods.
|
| bool Start(int rate_in_milliseconds);
|
| void Stop();
|
|
|
| - // Value returned by GetOrientation.
|
| - scoped_ptr<Orientation> current_orientation_;
|
| + // Value returned by GetDeviceData.
|
| + scoped_refptr<Orientation> current_orientation_;
|
|
|
| - // 1-element buffer, written by GotOrientation, read by GetOrientation.
|
| + // 1-element buffer, written by GotOrientation, read by GetDeviceData.
|
| base::Lock next_orientation_lock_;
|
| - scoped_ptr<Orientation> next_orientation_;
|
| + scoped_refptr<Orientation> next_orientation_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(DataFetcherImplAndroid);
|
| };
|
|
|