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

Unified Diff: content/browser/device_orientation/data_fetcher_platform.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_platform.h
diff --git a/content/browser/device_orientation/data_fetcher_platform.h b/content/browser/device_orientation/data_fetcher_platform.h
new file mode 100644
index 0000000000000000000000000000000000000000..86765a5a13accbe8ed503708940ac4170ee04354
--- /dev/null
+++ b/content/browser/device_orientation/data_fetcher_platform.h
@@ -0,0 +1,49 @@
+// 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 CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_PLATFORM_H_
+#define CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_PLATFORM_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "content/browser/device_orientation/data_fetcher_shared_memory.h"
+
+#if defined(OS_ANDROID)
+#include "content/browser/device_orientation/data_fetcher_impl_android.h"
+#endif
+
+namespace content {
+
+#if defined(OS_ANDROID)
+
+typedef DataFetcherImplAndroid SharedMemoryPlatformDataFetcher;
+
+#else
+
+typedef SharedMemoryPlatformDataFetcherEmpty SharedMemoryPlatformDataFetcher;
+
+#endif
+
+class SharedMemoryPlatformDataFetcherEmpty : public DataFetcherSharedMemory {
+ public:
+ static SharedMemoryPlatformDataFetcherEmpty* instance();
+
+ virtual bool NeedsPolling() OVERRIDE;
+ virtual bool FetchDeviceMotionDataIntoBuffer() OVERRIDE;
+ virtual bool StartFetchingDeviceMotionData(
+ DeviceMotionHardwareBuffer* buffer) OVERRIDE;
+ virtual void StopFetchingDeviceMotionData() OVERRIDE;
+
+ private:
+ SharedMemoryPlatformDataFetcherEmpty();
+ virtual ~SharedMemoryPlatformDataFetcherEmpty() { }
+
+ DeviceMotionHardwareBuffer* device_motion_buffer_;
+
+ DISALLOW_COPY_AND_ASSIGN(SharedMemoryPlatformDataFetcherEmpty);
+};
+
+} // namespace content
+
+#endif // CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_PLATFORM_H_

Powered by Google App Engine
This is Rietveld 408576698