Index: content/browser/device_orientation/data_fetcher_shared_memory_default.cc |
diff --git a/content/browser/device_orientation/data_fetcher_shared_memory_default.cc b/content/browser/device_orientation/data_fetcher_shared_memory_default.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f426657e9384e4cb9070676d5086a5bbdd69a27b |
--- /dev/null |
+++ b/content/browser/device_orientation/data_fetcher_shared_memory_default.cc |
@@ -0,0 +1,44 @@ |
+// 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. |
+ |
+#include "base/logging.h" |
+#include "data_fetcher_shared_memory.h" |
+ |
+namespace content { |
+ |
+DataFetcherSharedMemory::~DataFetcherSharedMemory() { |
+} |
+ |
+DataFetcherSharedMemory* |
+DataFetcherSharedMemory::instance() { |
+ CR_DEFINE_STATIC_LOCAL(SharedMemoryPlatformDataFetcherEmpty, |
+ s_data_fetcher, ()); |
+ return &s_data_fetcher; |
+} |
+ |
+bool DataFetcherSharedMemory::NeedsPolling() { |
+ return false; |
+} |
+ |
+bool DataFetcherSharedMemory::FetchDeviceMotionDataIntoBuffer() { |
+ DCHECK(NeedsPolling()); |
bulach
2013/07/09 09:03:29
nit: NOTREACHED() ?
timvolodine
2013/07/09 18:59:56
Done.
|
+ return false; |
+} |
+ |
+bool DataFetcherSharedMemory::StartFetchingDeviceMotionData( |
+ DeviceMotionHardwareBuffer* buffer) { |
+ DCHECK(buffer); |
+ device_motion_buffer_->seqlock.WriteBegin(); |
+ device_motion_buffer_->data.allAvailableSensorsAreActive = true; |
+ device_motion_buffer_->seqlock.WriteEnd(); |
+ return true; |
+} |
+ |
+void DataFetcherSharedMemory::StopFetchingDeviceMotionData() { |
+ device_motion_buffer_->seqlock.WriteBegin(); |
+ device_motion_buffer_->data.allAvailableSensorsAreActive = false; |
+ device_motion_buffer_->seqlock.WriteEnd(); |
+} |
+ |
+} // namespace content |