OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * * Redistributions in binary form must reproduce the above copyright | 9 * * Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 13 matching lines...) Expand all Loading... |
24 */ | 24 */ |
25 | 25 |
26 #ifndef DeviceMotionData_h | 26 #ifndef DeviceMotionData_h |
27 #define DeviceMotionData_h | 27 #define DeviceMotionData_h |
28 | 28 |
29 #include "platform/heap/Handle.h" | 29 #include "platform/heap/Handle.h" |
30 #include "wtf/RefCounted.h" | 30 #include "wtf/RefCounted.h" |
31 #include "wtf/RefPtr.h" | 31 #include "wtf/RefPtr.h" |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
| 34 |
34 class WebDeviceMotionData; | 35 class WebDeviceMotionData; |
35 } | |
36 | |
37 namespace blink { | |
38 | 36 |
39 class DeviceMotionData : public RefCountedWillBeGarbageCollected<DeviceMotionDat
a> { | 37 class DeviceMotionData : public RefCountedWillBeGarbageCollected<DeviceMotionDat
a> { |
40 public: | 38 public: |
41 | 39 |
42 class Acceleration : public RefCountedWillBeGarbageCollected<DeviceMotionDat
a::Acceleration> { | 40 class Acceleration : public RefCountedWillBeGarbageCollected<DeviceMotionDat
a::Acceleration> { |
43 public: | 41 public: |
44 static PassRefPtrWillBeRawPtr<Acceleration> create(bool canProvideX, dou
ble x, bool canProvideY, double y, bool canProvideZ, double z); | 42 static PassRefPtrWillBeRawPtr<Acceleration> create(bool canProvideX, dou
ble x, bool canProvideY, double y, bool canProvideZ, double z); |
45 void trace(Visitor*) { } | 43 void trace(Visitor*) { } |
46 | 44 |
47 bool canProvideX() const { return m_canProvideX; } | 45 bool canProvideX() const { return m_canProvideX; } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 bool m_canProvideGamma; | 87 bool m_canProvideGamma; |
90 }; | 88 }; |
91 | 89 |
92 static PassRefPtrWillBeRawPtr<DeviceMotionData> create(); | 90 static PassRefPtrWillBeRawPtr<DeviceMotionData> create(); |
93 static PassRefPtrWillBeRawPtr<DeviceMotionData> create( | 91 static PassRefPtrWillBeRawPtr<DeviceMotionData> create( |
94 PassRefPtrWillBeRawPtr<Acceleration>, | 92 PassRefPtrWillBeRawPtr<Acceleration>, |
95 PassRefPtrWillBeRawPtr<Acceleration> accelerationIncludingGravity, | 93 PassRefPtrWillBeRawPtr<Acceleration> accelerationIncludingGravity, |
96 PassRefPtrWillBeRawPtr<RotationRate>, | 94 PassRefPtrWillBeRawPtr<RotationRate>, |
97 bool canProvideInterval, | 95 bool canProvideInterval, |
98 double interval); | 96 double interval); |
99 static PassRefPtrWillBeRawPtr<DeviceMotionData> create(const blink::WebDevic
eMotionData&); | 97 static PassRefPtrWillBeRawPtr<DeviceMotionData> create(const WebDeviceMotion
Data&); |
100 void trace(Visitor*); | 98 void trace(Visitor*); |
101 | 99 |
102 Acceleration* acceleration() const { return m_acceleration.get(); } | 100 Acceleration* acceleration() const { return m_acceleration.get(); } |
103 Acceleration* accelerationIncludingGravity() const { return m_accelerationIn
cludingGravity.get(); } | 101 Acceleration* accelerationIncludingGravity() const { return m_accelerationIn
cludingGravity.get(); } |
104 RotationRate* rotationRate() const { return m_rotationRate.get(); } | 102 RotationRate* rotationRate() const { return m_rotationRate.get(); } |
105 | 103 |
106 bool canProvideInterval() const { return m_canProvideInterval; } | 104 bool canProvideInterval() const { return m_canProvideInterval; } |
107 double interval() const { return m_interval; } | 105 double interval() const { return m_interval; } |
108 | 106 |
109 bool canProvideEventData() const; | 107 bool canProvideEventData() const; |
110 | 108 |
111 private: | 109 private: |
112 DeviceMotionData(); | 110 DeviceMotionData(); |
113 DeviceMotionData(PassRefPtrWillBeRawPtr<Acceleration>, PassRefPtrWillBeRawPt
r<Acceleration> accelerationIncludingGravity, PassRefPtrWillBeRawPtr<RotationRat
e>, bool canProvideInterval, double interval); | 111 DeviceMotionData(PassRefPtrWillBeRawPtr<Acceleration>, PassRefPtrWillBeRawPt
r<Acceleration> accelerationIncludingGravity, PassRefPtrWillBeRawPtr<RotationRat
e>, bool canProvideInterval, double interval); |
114 | 112 |
115 RefPtrWillBeMember<Acceleration> m_acceleration; | 113 RefPtrWillBeMember<Acceleration> m_acceleration; |
116 RefPtrWillBeMember<Acceleration> m_accelerationIncludingGravity; | 114 RefPtrWillBeMember<Acceleration> m_accelerationIncludingGravity; |
117 RefPtrWillBeMember<RotationRate> m_rotationRate; | 115 RefPtrWillBeMember<RotationRate> m_rotationRate; |
118 bool m_canProvideInterval; | 116 bool m_canProvideInterval; |
119 double m_interval; | 117 double m_interval; |
120 }; | 118 }; |
121 | 119 |
122 } // namespace blink | 120 } // namespace blink |
123 | 121 |
124 #endif // DeviceMotionData_h | 122 #endif // DeviceMotionData_h |
OLD | NEW |