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

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

Issue 14678012: Implement the content/renderer and content/browser part of the Device Motion API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: factored out as much code as possible from the templated reader 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..d3150e2bc00a2f6b1afb113fd4f8e2de01427213
--- /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 {
+ public:
+ virtual ~DataFetcherSharedMemory() {}
+
+ // Returns true if this fetcher needs explicit calls to
+ 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