| Index: content/browser/device_orientation/data_fetcher_shared_memory_android.cc
|
| diff --git a/content/browser/device_orientation/data_fetcher_shared_memory_android.cc b/content/browser/device_orientation/data_fetcher_shared_memory_android.cc
|
| index 5a87c6d32e4b859130482bbb610901492bec7765..b0515576707de64cdc6a4972d07b3502b526c390 100644
|
| --- a/content/browser/device_orientation/data_fetcher_shared_memory_android.cc
|
| +++ b/content/browser/device_orientation/data_fetcher_shared_memory_android.cc
|
| @@ -10,7 +10,8 @@
|
| namespace content {
|
|
|
| DataFetcherSharedMemory::~DataFetcherSharedMemory() {
|
| - StopFetchingDeviceMotionData();
|
| + if (started_)
|
| + StopFetchingDeviceMotionData();
|
| }
|
|
|
| bool DataFetcherSharedMemory::NeedsPolling() {
|
| @@ -24,13 +25,16 @@ bool DataFetcherSharedMemory::FetchDeviceMotionDataIntoBuffer() {
|
|
|
| bool DataFetcherSharedMemory::StartFetchingDeviceMotionData(
|
| DeviceMotionHardwareBuffer* buffer) {
|
| + DCHECK(buffer);
|
| device_motion_buffer_ = buffer;
|
| return DataFetcherImplAndroid::GetInstance()->
|
| StartFetchingDeviceMotionData(buffer);
|
| + started_ = true;
|
| }
|
|
|
| void DataFetcherSharedMemory::StopFetchingDeviceMotionData() {
|
| - DataFetcherImplAndroid::GetInstance()->StopFetchingDeviceMotionData();
|
| + DataFetcherImplAndroid::GetInstance()->StopFetchingDeviceMotionData();
|
| + started_ = false;
|
| }
|
|
|
| } // namespace content
|
|
|