Chromium Code Reviews| Index: content/browser/device_sensors/data_fetcher_shared_memory_chromeos.cc |
| diff --git a/content/browser/device_sensors/data_fetcher_shared_memory_chromeos.cc b/content/browser/device_sensors/data_fetcher_shared_memory_chromeos.cc |
| index 6dc0336e7a509eda48d0432ca73581006aa73379..76349d2a37d37726b80f8bcde6cef78c181e6e30 100644 |
| --- a/content/browser/device_sensors/data_fetcher_shared_memory_chromeos.cc |
| +++ b/content/browser/device_sensors/data_fetcher_shared_memory_chromeos.cc |
| @@ -21,12 +21,13 @@ bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) { |
| switch (consumer_type) { |
| case CONSUMER_TYPE_MOTION: |
| - // TODO(jonross): Implement Device Motion API. (crbug.com/427662) |
| - NOTIMPLEMENTED(); |
| - return false; |
| + sensor_manager_->StartFetchingDeviceMotionData( |
| + static_cast<DeviceMotionHardwareBuffer*>(buffer)); |
| + return true; |
|
timvolodine
2015/03/09 15:55:57
is there any reason to ignore the return value of
flackr
2015/03/09 16:21:19
Oh, I had suggested since the function could not r
jonross
2015/03/09 16:35:26
I'll update the functions to be void
jonross
2015/03/09 20:46:24
Done.
timvolodine
2015/03/10 13:03:08
curious: so there is always an accelerometer avail
jonross
2015/03/10 15:03:58
It is possible for there to be no sensor on Chrome
flackr
2015/03/10 17:21:11
If this *should* fail (return false) when there is
timvolodine
2015/03/10 17:31:32
Yes so in case there is no sensor the API should a
|
| case CONSUMER_TYPE_ORIENTATION: |
| - return sensor_manager_->StartFetchingDeviceOrientationData( |
| + sensor_manager_->StartFetchingDeviceOrientationData( |
| static_cast<DeviceOrientationHardwareBuffer*>(buffer)); |
| + return true; |
|
timvolodine
2015/03/09 15:55:57
same question here
jonross
2015/03/09 20:46:24
Done.
|
| case CONSUMER_TYPE_LIGHT: |
| NOTIMPLEMENTED(); |
| return false; |
| @@ -38,8 +39,7 @@ bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) { |
| bool DataFetcherSharedMemory::Stop(ConsumerType consumer_type) { |
| switch (consumer_type) { |
| case CONSUMER_TYPE_MOTION: |
| - NOTIMPLEMENTED(); |
| - return false; |
| + return sensor_manager_->StopFetchingDeviceMotionData(); |
| case CONSUMER_TYPE_ORIENTATION: |
| return sensor_manager_->StopFetchingDeviceOrientationData(); |
| case CONSUMER_TYPE_LIGHT: |