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

Unified Diff: device/device_sensors/device_inertial_sensor_service.cc

Issue 1164563003: Extract device_sensors to /device via Mojofication (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « device/device_sensors/device_inertial_sensor_service.h ('k') | device/device_sensors/device_light_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/device_sensors/device_inertial_sensor_service.cc
diff --git a/content/browser/device_sensors/device_inertial_sensor_service.cc b/device/device_sensors/device_inertial_sensor_service.cc
similarity index 84%
rename from content/browser/device_sensors/device_inertial_sensor_service.cc
rename to device/device_sensors/device_inertial_sensor_service.cc
index 37952475532c921f47312f0f2b7139ce37b74222..2e2bf5ff33d886490e9854ce61fbdd19705b6c48 100644
--- a/content/browser/device_sensors/device_inertial_sensor_service.cc
+++ b/device/device_sensors/device_inertial_sensor_service.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/device_inertial_sensor_service.h"
+#include "device/device_sensors/device_inertial_sensor_service.h"
#include "base/bind.h"
#include "base/logging.h"
#include "base/memory/singleton.h"
-#include "content/browser/device_sensors/data_fetcher_shared_memory.h"
+#include "device/device_sensors/data_fetcher_shared_memory.h"
-namespace content {
+namespace device {
DeviceInertialSensorService::DeviceInertialSensorService()
: num_light_readers_(0),
@@ -23,10 +23,11 @@ DeviceInertialSensorService::~DeviceInertialSensorService() {
DeviceInertialSensorService* DeviceInertialSensorService::GetInstance() {
return Singleton<DeviceInertialSensorService,
- LeakySingletonTraits<DeviceInertialSensorService> >::get();
+ LeakySingletonTraits<DeviceInertialSensorService>>::get();
}
void DeviceInertialSensorService::AddConsumer(ConsumerType consumer_type) {
+ LOG(WARNING) << "AddConsumer " << consumer_type;
if (!ChangeNumberConsumers(consumer_type, 1))
return;
@@ -38,15 +39,16 @@ void DeviceInertialSensorService::AddConsumer(ConsumerType consumer_type) {
}
void DeviceInertialSensorService::RemoveConsumer(ConsumerType consumer_type) {
+ LOG(WARNING) << "RemoveConsumer " << consumer_type;
if (!ChangeNumberConsumers(consumer_type, -1))
return;
if (GetNumberConsumers(consumer_type) == 0)
data_fetcher_->StopFetchingDeviceData(consumer_type);
}
-
bool DeviceInertialSensorService::ChangeNumberConsumers(
- ConsumerType consumer_type, int delta) {
+ ConsumerType consumer_type,
+ int delta) {
DCHECK(thread_checker_.CalledOnValidThread());
if (is_shutdown_)
return false;
@@ -58,7 +60,7 @@ bool DeviceInertialSensorService::ChangeNumberConsumers(
return true;
case CONSUMER_TYPE_ORIENTATION:
num_orientation_readers_ += delta;
- DCHECK_GE(num_orientation_readers_ , 0);
+ DCHECK_GE(num_orientation_readers_, 0);
return true;
case CONSUMER_TYPE_LIGHT:
num_light_readers_ += delta;
@@ -87,7 +89,9 @@ int DeviceInertialSensorService::GetNumberConsumers(
base::SharedMemoryHandle
DeviceInertialSensorService::GetSharedMemoryHandleForProcess(
- ConsumerType consumer_type, base::ProcessHandle handle) {
+ ConsumerType consumer_type,
+ base::ProcessHandle handle) {
+ LOG(WARNING) << "GetSharedMemoryHandleForProcess " << consumer_type;
DCHECK(thread_checker_.CalledOnValidThread());
return data_fetcher_->GetSharedMemoryHandleForProcess(consumer_type, handle);
}
@@ -107,4 +111,4 @@ void DeviceInertialSensorService::SetDataFetcherForTesting(
data_fetcher_.reset(test_data_fetcher);
}
-} // namespace content
+} // namespace device
« no previous file with comments | « device/device_sensors/device_inertial_sensor_service.h ('k') | device/device_sensors/device_light_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698