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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram_macros.h" |
9 | 9 |
10 namespace { | 10 namespace { |
11 | 11 |
12 bool SetMotionBuffer(content::DeviceMotionHardwareBuffer* buffer, | 12 bool SetMotionBuffer(content::DeviceMotionHardwareBuffer* buffer, |
13 bool enabled) { | 13 bool enabled) { |
14 if (!buffer) | 14 if (!buffer) |
15 return false; | 15 return false; |
16 buffer->seqlock.WriteBegin(); | 16 buffer->seqlock.WriteBegin(); |
17 buffer->data.allAvailableSensorsAreActive = enabled; | 17 buffer->data.allAvailableSensorsAreActive = enabled; |
18 buffer->seqlock.WriteEnd(); | 18 buffer->seqlock.WriteEnd(); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 return SetOrientationBuffer(orientation_absolute_buffer_, false); | 86 return SetOrientationBuffer(orientation_absolute_buffer_, false); |
87 case CONSUMER_TYPE_LIGHT: | 87 case CONSUMER_TYPE_LIGHT: |
88 return SetLightBuffer(light_buffer_, -1); | 88 return SetLightBuffer(light_buffer_, -1); |
89 default: | 89 default: |
90 NOTREACHED(); | 90 NOTREACHED(); |
91 } | 91 } |
92 return false; | 92 return false; |
93 } | 93 } |
94 | 94 |
95 } // namespace content | 95 } // namespace content |
OLD | NEW |