Chromium Code Reviews| 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..423ca12624099f188831e85cedf8e7fbdabd1eba 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,19 +40,20 @@ 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. |
| + // Value returned by GetDeviceData. |
| scoped_ptr<Orientation> current_orientation_; |
|
hans
2012/08/03 13:05:41
should this be a scoped_refptr?
aousterh
2012/08/03 13:42:18
Done.
|
| - // 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_; |