Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: content/browser/device_orientation/data_fetcher_impl_android.h

Issue 10755002: Refactors DeviceOrientation to make it more extensible (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 9ac498a5ccae1524dfa17005226e93ed0d2bc6e9..8a033bc2a10852aed2d6351b924af2a032ea7154 100644
--- a/content/browser/device_orientation/data_fetcher_impl_android.h
+++ b/content/browser/device_orientation/data_fetcher_impl_android.h
@@ -20,8 +20,8 @@ namespace device_orientation {
// 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:
@@ -39,19 +39,20 @@ class DataFetcherImplAndroid : public DataFetcher {
double alpha, double beta, double gamma);
// Implementation of DataFetcher.
- virtual bool GetOrientation(Orientation* orientation) OVERRIDE;
+ virtual bool GetDeviceData(DeviceData* device_data) OVERRIDE;
private:
DataFetcherImplAndroid();
+ bool GetOrientation(Orientation* orientation);
// 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_;
- // 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_;

Powered by Google App Engine
This is Rietveld 408576698