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

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

Issue 18572014: Implement Android shared memory data fetcher for Device Motion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@renderer-sync-12June-tryASYNC-2-bis-tryRebase-6
Patch Set: added OWNERS file Created 7 years, 6 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_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
new file mode 100644
index 0000000000000000000000000000000000000000..296308d1b80df11aa4b824d52fb4c729149360d3
--- /dev/null
+++ b/content/browser/device_orientation/data_fetcher_shared_memory.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_
+#define CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_
+
+#include "content/browser/device_orientation/device_data.h"
+#include "content/common/device_motion_hardware_buffer.h"
+
+namespace WebKit {
+class WebDeviceMotionData;
+}
+
+namespace content {
+
+class DataFetcherSharedMemory {
bulach 2013/07/04 08:23:36 in the "vibration API" review, jam@ pointed out to
timvolodine 2013/07/04 12:02:52 hmm, yes that looks like the normal way to go. How
+ public:
+ virtual ~DataFetcherSharedMemory() {}
+
+ // Returns true if this fetcher needs explicit calls to fetch the data.
+ virtual bool NeedsPolling() = 0;
+
+ // 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.
+ virtual bool FetchDeviceMotionDataIntoBuffer() = 0;
+
+ // Returns true if the relevant sensors could be successfully activated.
+ // This method should be called before any calls to
+ // FetchDeviceMotionDataIntoBuffer().
+ virtual bool StartFetchingDeviceMotionData(
+ DeviceMotionHardwareBuffer* buffer) = 0;
+
+ // Indicates to the fetcher to stop fetching device data.
+ virtual void StopFetchingDeviceMotionData() = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_

Powered by Google App Engine
This is Rietveld 408576698