| 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
|
|
|