Home | History | Annotate | Download | only in device_orientation
      1 // Copyright 2013 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "data_fetcher_shared_memory.h"
      6 
      7 #include "base/logging.h"
      8 #include "data_fetcher_impl_android.h"
      9 
     10 namespace content {
     11 
     12 DataFetcherSharedMemory::~DataFetcherSharedMemory() {
     13   if (started_)
     14     StopFetchingDeviceMotionData();
     15 }
     16 
     17 bool DataFetcherSharedMemory::NeedsPolling() {
     18   return false;
     19 }
     20 
     21 bool DataFetcherSharedMemory::FetchDeviceMotionDataIntoBuffer() {
     22   NOTREACHED();
     23   return false;
     24 }
     25 
     26 bool DataFetcherSharedMemory::StartFetchingDeviceMotionData(
     27     DeviceMotionHardwareBuffer* buffer) {
     28   DCHECK(buffer);
     29   device_motion_buffer_ = buffer;
     30   started_ = DataFetcherImplAndroid::GetInstance()->
     31       StartFetchingDeviceMotionData(buffer);
     32   return started_;
     33 }
     34 
     35 void DataFetcherSharedMemory::StopFetchingDeviceMotionData() {
     36   DataFetcherImplAndroid::GetInstance()->StopFetchingDeviceMotionData();
     37   started_ = false;
     38 }
     39 
     40 }  // namespace content
     41