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

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

Issue 19833005: Implement PollingThread for Device Motion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed comments Created 7 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
« no previous file with comments | « no previous file | content/browser/device_orientation/data_fetcher_shared_memory_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/device_orientation/data_fetcher_shared_memory.h
diff --git a/content/browser/device_orientation/data_fetcher_shared_memory.h b/content/browser/device_orientation/data_fetcher_shared_memory.h
index 8168e87134e9b119ec881f4f4da4d698320bbe2b..dc5e92ae160d633d7f011f938946da7b05ef461b 100644
--- a/content/browser/device_orientation/data_fetcher_shared_memory.h
+++ b/content/browser/device_orientation/data_fetcher_shared_memory.h
@@ -14,31 +14,39 @@ class WebDeviceMotionData;
namespace content {
-class DataFetcherSharedMemory {
+class CONTENT_EXPORT DataFetcherSharedMemory {
public:
- DataFetcherSharedMemory() : device_motion_buffer_(NULL) { }
+ DataFetcherSharedMemory()
+ : device_motion_buffer_(NULL),
+ started_(false) { }
virtual ~DataFetcherSharedMemory();
// Returns true if this fetcher needs explicit calls to fetch the data.
+ // Called from any thread.
virtual bool NeedsPolling();
// If this fetcher NeedsPolling() is true, this method will update the
// buffer with the latest device motion data.
- // This method will do nothing if NeedsPolling() is false.
// Returns true if there was any motion data to update the buffer with.
+ // Called from the DeviceMotionProvider::PollingThread.
virtual bool FetchDeviceMotionDataIntoBuffer();
// Returns true if the relevant sensors could be successfully activated.
// This method should be called before any calls to
// FetchDeviceMotionDataIntoBuffer().
+ // If NeedsPolling() is true this method should be called from the
+ // PollingThread.
virtual bool StartFetchingDeviceMotionData(
DeviceMotionHardwareBuffer* buffer);
// Indicates to the fetcher to stop fetching device data.
+ // If NeedsPolling() is true this method should be called from the
+ // PollingThread.
virtual void StopFetchingDeviceMotionData();
private:
DeviceMotionHardwareBuffer* device_motion_buffer_;
+ bool started_;
DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemory);
};
« no previous file with comments | « no previous file | content/browser/device_orientation/data_fetcher_shared_memory_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698