| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/device_sensors/data_fetcher_shared_memory.h" | 5 #include "content/browser/device_sensors/data_fetcher_shared_memory.h" |
| 6 | 6 |
| 7 #include <GuidDef.h> | 7 #include <GuidDef.h> |
| 8 #include <InitGuid.h> | 8 #include <InitGuid.h> |
| 9 #include <PortableDeviceTypes.h> | 9 #include <PortableDeviceTypes.h> |
| 10 #include <Sensors.h> | 10 #include <Sensors.h> |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 253 |
| 254 return true; | 254 return true; |
| 255 } | 255 } |
| 256 | 256 |
| 257 private: | 257 private: |
| 258 DeviceLightHardwareBuffer* const buffer_; | 258 DeviceLightHardwareBuffer* const buffer_; |
| 259 | 259 |
| 260 DISALLOW_COPY_AND_ASSIGN(SensorEventSinkLight); | 260 DISALLOW_COPY_AND_ASSIGN(SensorEventSinkLight); |
| 261 }; | 261 }; |
| 262 | 262 |
| 263 DataFetcherSharedMemory::DataFetcherSharedMemory() | 263 DataFetcherSharedMemory::DataFetcherSharedMemory() {} |
| 264 : motion_buffer_(nullptr), | |
| 265 orientation_buffer_(nullptr), | |
| 266 orientation_absolute_buffer_(nullptr), | |
| 267 light_buffer_(nullptr) { | |
| 268 } | |
| 269 | 264 |
| 270 DataFetcherSharedMemory::~DataFetcherSharedMemory() { | 265 DataFetcherSharedMemory::~DataFetcherSharedMemory() { |
| 271 } | 266 } |
| 272 | 267 |
| 273 DataFetcherSharedMemory::FetcherType DataFetcherSharedMemory::GetType() const { | 268 DataFetcherSharedMemory::FetcherType DataFetcherSharedMemory::GetType() const { |
| 274 return FETCHER_TYPE_SEPARATE_THREAD; | 269 return FETCHER_TYPE_SEPARATE_THREAD; |
| 275 } | 270 } |
| 276 | 271 |
| 277 bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) { | 272 bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) { |
| 278 DCHECK(buffer); | 273 DCHECK(buffer); |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 motion_buffer_->data.allAvailableSensorsAreActive = enabled; | 488 motion_buffer_->data.allAvailableSensorsAreActive = enabled; |
| 494 motion_buffer_->seqlock.WriteEnd(); | 489 motion_buffer_->seqlock.WriteEnd(); |
| 495 } | 490 } |
| 496 break; | 491 break; |
| 497 default: | 492 default: |
| 498 NOTREACHED(); | 493 NOTREACHED(); |
| 499 } | 494 } |
| 500 } | 495 } |
| 501 | 496 |
| 502 } // namespace content | 497 } // namespace content |
| OLD | NEW |