Index: device/sensors/data_fetcher_shared_memory_mac.cc |
diff --git a/content/browser/device_sensors/data_fetcher_shared_memory_mac.cc b/device/sensors/data_fetcher_shared_memory_mac.cc |
similarity index 92% |
rename from content/browser/device_sensors/data_fetcher_shared_memory_mac.cc |
rename to device/sensors/data_fetcher_shared_memory_mac.cc |
index ab455aa6949b9185c7134899a173a8272b2f04ad..09140f4efd9b00299eeaf226bf0471020729440d 100644 |
--- a/content/browser/device_sensors/data_fetcher_shared_memory_mac.cc |
+++ b/device/sensors/data_fetcher_shared_memory_mac.cc |
@@ -2,14 +2,14 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "content/browser/device_sensors/data_fetcher_shared_memory.h" |
+#include "device/sensors/data_fetcher_shared_memory.h" |
#include <stdint.h> |
#include "base/logging.h" |
#include "base/metrics/histogram_macros.h" |
#include "base/single_thread_task_runner.h" |
-#include "content/browser/device_sensors/ambient_light_mac.h" |
+#include "device/sensors/ambient_light_mac.h" |
#include "device/sensors/public/cpp/device_util_mac.h" |
#include "third_party/sudden_motion_sensor/sudden_motion_sensor_mac.h" |
@@ -17,8 +17,8 @@ namespace { |
const double kMeanGravity = 9.80665; |
-void FetchLight(content::AmbientLightSensor* sensor, |
- content::DeviceLightHardwareBuffer* buffer) { |
+void FetchLight(device::AmbientLightSensor* sensor, |
+ device::DeviceLightHardwareBuffer* buffer) { |
DCHECK(sensor); |
DCHECK(buffer); |
// Macbook pro has 2 lux values, left and right, we take the average. |
@@ -35,7 +35,7 @@ void FetchLight(content::AmbientLightSensor* sensor, |
} |
void FetchMotion(SuddenMotionSensor* sensor, |
- content::DeviceMotionHardwareBuffer* buffer) { |
+ device::DeviceMotionHardwareBuffer* buffer) { |
DCHECK(sensor); |
DCHECK(buffer); |
@@ -55,7 +55,7 @@ void FetchMotion(SuddenMotionSensor* sensor, |
} |
void FetchOrientation(SuddenMotionSensor* sensor, |
- content::DeviceOrientationHardwareBuffer* buffer) { |
+ device::DeviceOrientationHardwareBuffer* buffer) { |
DCHECK(sensor); |
DCHECK(buffer); |
@@ -98,9 +98,9 @@ void FetchOrientation(SuddenMotionSensor* sensor, |
// At this point, DCHECKing is paranoia. Never hurts. |
DCHECK_GE(beta, -180.0); |
- DCHECK_LT(beta, 180.0); |
+ DCHECK_LT(beta, 180.0); |
DCHECK_GE(gamma, -90.0); |
- DCHECK_LT(gamma, 90.0); |
+ DCHECK_LT(gamma, 90.0); |
buffer->seqlock.WriteBegin(); |
buffer->data.beta = beta; |
@@ -113,13 +113,11 @@ void FetchOrientation(SuddenMotionSensor* sensor, |
} // namespace |
-namespace content { |
+namespace device { |
-DataFetcherSharedMemory::DataFetcherSharedMemory() { |
-} |
+DataFetcherSharedMemory::DataFetcherSharedMemory() {} |
-DataFetcherSharedMemory::~DataFetcherSharedMemory() { |
-} |
+DataFetcherSharedMemory::~DataFetcherSharedMemory() {} |
void DataFetcherSharedMemory::Fetch(unsigned consumer_bitmask) { |
DCHECK(GetPollingMessageLoop()->task_runner()->BelongsToCurrentThread()); |
@@ -152,7 +150,7 @@ bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) { |
motion_buffer_ = static_cast<DeviceMotionHardwareBuffer*>(buffer); |
UMA_HISTOGRAM_BOOLEAN("InertialSensor.MotionMacAvailable", |
- sudden_motion_sensor_available); |
+ sudden_motion_sensor_available); |
if (!sudden_motion_sensor_available) { |
// No motion sensor available, fire an all-null event. |
motion_buffer_->seqlock.WriteBegin(); |
@@ -170,7 +168,7 @@ bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) { |
orientation_buffer_ = |
static_cast<DeviceOrientationHardwareBuffer*>(buffer); |
UMA_HISTOGRAM_BOOLEAN("InertialSensor.OrientationMacAvailable", |
- sudden_motion_sensor_available); |
+ sudden_motion_sensor_available); |
if (sudden_motion_sensor_available) { |
// On Mac we cannot provide absolute orientation. |
orientation_buffer_->seqlock.WriteBegin(); |
@@ -257,4 +255,4 @@ bool DataFetcherSharedMemory::Stop(ConsumerType consumer_type) { |
return false; |
} |
-} // namespace content |
+} // namespace device |