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

Unified Diff: content/browser/device_sensors/data_fetcher_shared_memory_default.cc

Issue 680383007: DeviceOrientation API on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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_sensors/data_fetcher_shared_memory_default.cc
diff --git a/content/browser/device_sensors/data_fetcher_shared_memory_default.cc b/content/browser/device_sensors/data_fetcher_shared_memory_default.cc
index 5294e8ee5db1d40ce2092fd12e48b4b3768bcb7a..b111b7b1fc045c46f26ed7c18cac5574180a95c0 100644
--- a/content/browser/device_sensors/data_fetcher_shared_memory_default.cc
+++ b/content/browser/device_sensors/data_fetcher_shared_memory_default.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/metrics/histogram.h"
+#include "content/public/browser/sensor_manager.h"
namespace {
@@ -63,6 +64,8 @@ bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) {
static_cast<DeviceOrientationHardwareBuffer*>(buffer);
UMA_HISTOGRAM_BOOLEAN("InertialSensor.OrientationDefaultAvailable",
false);
+ SensorManager::GetInstance()->StartFetchingDeviceOrientationData(
timvolodine 2014/11/06 02:53:47 this line shouldn't be here. the purpose of _defau
jonross 2014/11/06 18:18:52 Done.
+ orientation_buffer_);
return SetOrientationBuffer(orientation_buffer_, true);
case CONSUMER_TYPE_LIGHT:
light_buffer_ = static_cast<DeviceLightHardwareBuffer*>(buffer);
@@ -79,6 +82,7 @@ bool DataFetcherSharedMemory::Stop(ConsumerType consumer_type) {
case CONSUMER_TYPE_MOTION:
return SetMotionBuffer(motion_buffer_, false);
case CONSUMER_TYPE_ORIENTATION:
+ SensorManager::GetInstance()->StopFetchingDeviceOrientationData();
return SetOrientationBuffer(orientation_buffer_, false);
case CONSUMER_TYPE_LIGHT:
return SetLightBuffer(light_buffer_, -1);

Powered by Google App Engine
This is Rietveld 408576698