Index: content/browser/device_orientation/data_fetcher_shared_memory_base.cc |
diff --git a/content/browser/device_orientation/data_fetcher_shared_memory_base.cc b/content/browser/device_orientation/data_fetcher_shared_memory_base.cc |
index 690d1f8aa7f83e3b83369312efa102632434c837..01e9580944e38801b843cbfb994cc2a985f70ce9 100644 |
--- a/content/browser/device_orientation/data_fetcher_shared_memory_base.cc |
+++ b/content/browser/device_orientation/data_fetcher_shared_memory_base.cc |
@@ -9,6 +9,7 @@ |
#include "base/stl_util.h" |
#include "base/threading/thread.h" |
#include "base/timer/timer.h" |
+#include "content/common/device_light/device_light_hardware_buffer.h" |
#include "content/common/device_orientation/device_motion_hardware_buffer.h" |
#include "content/common/device_orientation/device_orientation_hardware_buffer.h" |
@@ -22,13 +23,15 @@ static size_t GetConsumerSharedMemoryBufferSize(ConsumerType consumer_type) { |
return sizeof(DeviceMotionHardwareBuffer); |
case CONSUMER_TYPE_ORIENTATION: |
return sizeof(DeviceOrientationHardwareBuffer); |
+ case CONSUMER_TYPE_LIGHT: |
+ return sizeof(DeviceLightHardwareBuffer); |
default: |
NOTREACHED(); |
} |
return 0; |
} |
-} |
+} // namespace |
class DataFetcherSharedMemoryBase::PollingThread : public base::Thread { |
public: |
@@ -42,7 +45,6 @@ class DataFetcherSharedMemoryBase::PollingThread : public base::Thread { |
bool IsTimerRunning() const { return timer_ ? timer_->IsRunning() : false; } |
private: |
- |
void DoPoll(); |
unsigned consumers_bitmask_; |
@@ -89,7 +91,7 @@ void DataFetcherSharedMemoryBase::PollingThread::RemoveConsumer( |
consumers_bitmask_ ^= consumer_type; |
if (!consumers_bitmask_) |
- timer_.reset(); // will also stop the timer. |
+ timer_.reset(); // will also stop the timer. |
} |
void DataFetcherSharedMemoryBase::PollingThread::DoPoll() { |
@@ -107,6 +109,7 @@ DataFetcherSharedMemoryBase::DataFetcherSharedMemoryBase() |
DataFetcherSharedMemoryBase::~DataFetcherSharedMemoryBase() { |
StopFetchingDeviceData(CONSUMER_TYPE_MOTION); |
StopFetchingDeviceData(CONSUMER_TYPE_ORIENTATION); |
+ StopFetchingDeviceData(CONSUMER_TYPE_LIGHT); |
// make sure polling thread stops asap. |
if (polling_thread_) |