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

Unified Diff: device/sensors/data_fetcher_shared_memory_mac.cc

Issue 2646093002: Move //content/browser/device_sensor/ into device/sensors (Closed)
Patch Set: gn format & code rebase Created 3 years, 11 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: 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 94%
rename from content/browser/device_sensors/data_fetcher_shared_memory_mac.cc
rename to device/sensors/data_fetcher_shared_memory_mac.cc
index ab455aa6949b9185c7134899a173a8272b2f04ad..1826068b7077df40e741b51aab3b48df55fa57b3 100644
--- a/content/browser/device_sensors/data_fetcher_shared_memory_mac.cc
+++ b/device/sensors/data_fetcher_shared_memory_mac.cc
@@ -2,23 +2,22 @@
// 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"
-namespace {
+namespace device {
const double kMeanGravity = 9.80665;
-void FetchLight(content::AmbientLightSensor* sensor,
- content::DeviceLightHardwareBuffer* buffer) {
+void FetchLight(AmbientLightSensor* sensor, DeviceLightHardwareBuffer* buffer) {
DCHECK(sensor);
DCHECK(buffer);
// Macbook pro has 2 lux values, left and right, we take the average.
@@ -28,14 +27,14 @@ void FetchLight(content::AmbientLightSensor* sensor,
if (!sensor->ReadSensorValue(lux_value))
return;
uint64_t mean = (lux_value[0] + lux_value[1]) / 2;
- double lux = device::LMUvalueToLux(mean);
+ double lux = LMUvalueToLux(mean);
buffer->seqlock.WriteBegin();
buffer->data.value = lux;
buffer->seqlock.WriteEnd();
}
void FetchMotion(SuddenMotionSensor* sensor,
- content::DeviceMotionHardwareBuffer* buffer) {
+ DeviceMotionHardwareBuffer* buffer) {
DCHECK(sensor);
DCHECK(buffer);
@@ -55,7 +54,7 @@ void FetchMotion(SuddenMotionSensor* sensor,
}
void FetchOrientation(SuddenMotionSensor* sensor,
- content::DeviceOrientationHardwareBuffer* buffer) {
+ DeviceOrientationHardwareBuffer* buffer) {
DCHECK(sensor);
DCHECK(buffer);
@@ -111,10 +110,6 @@ void FetchOrientation(SuddenMotionSensor* sensor,
buffer->seqlock.WriteEnd();
}
-} // namespace
-
-namespace content {
-
DataFetcherSharedMemory::DataFetcherSharedMemory() {
}
@@ -257,4 +252,4 @@ bool DataFetcherSharedMemory::Stop(ConsumerType consumer_type) {
return false;
}
-} // namespace content
+} // namespace device
« no previous file with comments | « device/sensors/data_fetcher_shared_memory_default.cc ('k') | device/sensors/data_fetcher_shared_memory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698