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 "data_fetcher_shared_memory.h" | 5 #include "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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 DISALLOW_COPY_AND_ASSIGN(SensorEventSinkMotion); | 222 DISALLOW_COPY_AND_ASSIGN(SensorEventSinkMotion); |
223 }; | 223 }; |
224 | 224 |
225 | 225 |
226 DataFetcherSharedMemory::DataFetcherSharedMemory() | 226 DataFetcherSharedMemory::DataFetcherSharedMemory() |
227 : motion_buffer_(NULL), | 227 : motion_buffer_(NULL), |
228 orientation_buffer_(NULL) { | 228 orientation_buffer_(NULL) { |
229 } | 229 } |
230 | 230 |
231 DataFetcherSharedMemory::~DataFetcherSharedMemory() { | 231 DataFetcherSharedMemory::~DataFetcherSharedMemory() { |
| 232 StopFetchingAllDeviceData(); |
232 } | 233 } |
233 | 234 |
234 DataFetcherSharedMemory::FetcherType DataFetcherSharedMemory::GetType() const { | 235 DataFetcherSharedMemory::FetcherType DataFetcherSharedMemory::GetType() const { |
235 return FETCHER_TYPE_SEPARATE_THREAD; | 236 return FETCHER_TYPE_SEPARATE_THREAD; |
236 } | 237 } |
237 | 238 |
238 bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) { | 239 bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) { |
239 DCHECK(buffer); | 240 DCHECK(buffer); |
240 | 241 |
241 switch (consumer_type) { | 242 switch (consumer_type) { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 motion_buffer_->data.allAvailableSensorsAreActive = enabled; | 392 motion_buffer_->data.allAvailableSensorsAreActive = enabled; |
392 motion_buffer_->seqlock.WriteEnd(); | 393 motion_buffer_->seqlock.WriteEnd(); |
393 } | 394 } |
394 break; | 395 break; |
395 default: | 396 default: |
396 NOTREACHED(); | 397 NOTREACHED(); |
397 } | 398 } |
398 } | 399 } |
399 | 400 |
400 } // namespace content | 401 } // namespace content |
OLD | NEW |