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/sensor_manager_android.h" | 5 #include "content/browser/device_sensors/sensor_manager_android.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/android/context_utils.h" | 9 #include "base/android/context_utils.h" |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 buffer->data.hasBeta = true; | 33 buffer->data.hasBeta = true; |
34 buffer->data.gamma = gamma; | 34 buffer->data.gamma = gamma; |
35 buffer->data.hasGamma = true; | 35 buffer->data.hasGamma = true; |
36 buffer->seqlock.WriteEnd(); | 36 buffer->seqlock.WriteEnd(); |
37 } | 37 } |
38 | 38 |
39 void SetOrientationBufferStatus( | 39 void SetOrientationBufferStatus( |
40 content::DeviceOrientationHardwareBuffer* buffer, | 40 content::DeviceOrientationHardwareBuffer* buffer, |
41 bool ready, bool absolute) { | 41 bool ready, bool absolute) { |
42 buffer->seqlock.WriteBegin(); | 42 buffer->seqlock.WriteBegin(); |
43 buffer->data.absolute = absolute; | 43 buffer->data.absolute = absolute; |
philipj_slow
2016/02/26 03:54:01
Should I make this absolute && ready, so that case
timvolodine
2016/03/01 22:36:25
the spec doesn't mention the value of absolute in
philipj_slow
2016/03/02 07:30:42
I looked at all the call sites, and it turns out t
| |
44 buffer->data.hasAbsolute = ready; | |
45 buffer->data.allAvailableSensorsAreActive = ready; | 44 buffer->data.allAvailableSensorsAreActive = ready; |
46 buffer->seqlock.WriteEnd(); | 45 buffer->seqlock.WriteEnd(); |
47 } | 46 } |
48 | 47 |
49 } // namespace | 48 } // namespace |
50 | 49 |
51 namespace content { | 50 namespace content { |
52 | 51 |
53 SensorManagerAndroid::SensorManagerAndroid() | 52 SensorManagerAndroid::SensorManagerAndroid() |
54 : number_active_device_motion_sensors_(0), | 53 : number_active_device_motion_sensors_(0), |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
543 } | 542 } |
544 } | 543 } |
545 } | 544 } |
546 | 545 |
547 void SensorManagerAndroid::Shutdown() { | 546 void SensorManagerAndroid::Shutdown() { |
548 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 547 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
549 is_shutdown_ = true; | 548 is_shutdown_ = true; |
550 } | 549 } |
551 | 550 |
552 } // namespace content | 551 } // namespace content |
OLD | NEW |