| 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 20 matching lines...) Expand all  Loading... | 
| 31 #include "wtf/RefCounted.h" | 31 #include "wtf/RefCounted.h" | 
| 32 #include "wtf/RefPtr.h" | 32 #include "wtf/RefPtr.h" | 
| 33 | 33 | 
| 34 namespace blink { | 34 namespace blink { | 
| 35 class WebDeviceMotionData; | 35 class WebDeviceMotionData; | 
| 36 } | 36 } | 
| 37 | 37 | 
| 38 namespace WebCore { | 38 namespace WebCore { | 
| 39 | 39 | 
| 40 class DeviceMotionData : public RefCountedWillBeGarbageCollected<DeviceMotionDat
     a> { | 40 class DeviceMotionData : public RefCountedWillBeGarbageCollected<DeviceMotionDat
     a> { | 
| 41     DECLARE_GC_INFO; |  | 
| 42 public: | 41 public: | 
| 43 | 42 | 
| 44     class Acceleration : public RefCountedWillBeGarbageCollected<DeviceMotionDat
     a::Acceleration> { | 43     class Acceleration : public RefCountedWillBeGarbageCollected<DeviceMotionDat
     a::Acceleration> { | 
| 45         DECLARE_GC_INFO; |  | 
| 46     public: | 44     public: | 
| 47         static PassRefPtrWillBeRawPtr<Acceleration> create(bool canProvideX, dou
     ble x, bool canProvideY, double y, bool canProvideZ, double z); | 45         static PassRefPtrWillBeRawPtr<Acceleration> create(bool canProvideX, dou
     ble x, bool canProvideY, double y, bool canProvideZ, double z); | 
| 48         void trace(Visitor*) { } | 46         void trace(Visitor*) { } | 
| 49 | 47 | 
| 50         bool canProvideX() const { return m_canProvideX; } | 48         bool canProvideX() const { return m_canProvideX; } | 
| 51         bool canProvideY() const { return m_canProvideY; } | 49         bool canProvideY() const { return m_canProvideY; } | 
| 52         bool canProvideZ() const { return m_canProvideZ; } | 50         bool canProvideZ() const { return m_canProvideZ; } | 
| 53 | 51 | 
| 54         double x() const { return m_x; } | 52         double x() const { return m_x; } | 
| 55         double y() const { return m_y; } | 53         double y() const { return m_y; } | 
| 56         double z() const { return m_z; } | 54         double z() const { return m_z; } | 
| 57 | 55 | 
| 58     private: | 56     private: | 
| 59         Acceleration(bool canProvideX, double x, bool canProvideY, double y, boo
     l canProvideZ, double z); | 57         Acceleration(bool canProvideX, double x, bool canProvideY, double y, boo
     l canProvideZ, double z); | 
| 60 | 58 | 
| 61         double m_x; | 59         double m_x; | 
| 62         double m_y; | 60         double m_y; | 
| 63         double m_z; | 61         double m_z; | 
| 64 | 62 | 
| 65         bool m_canProvideX; | 63         bool m_canProvideX; | 
| 66         bool m_canProvideY; | 64         bool m_canProvideY; | 
| 67         bool m_canProvideZ; | 65         bool m_canProvideZ; | 
| 68     }; | 66     }; | 
| 69 | 67 | 
| 70     class RotationRate : public RefCountedWillBeGarbageCollected<DeviceMotionDat
     a::RotationRate> { | 68     class RotationRate : public RefCountedWillBeGarbageCollected<DeviceMotionDat
     a::RotationRate> { | 
| 71         DECLARE_GC_INFO; |  | 
| 72     public: | 69     public: | 
| 73         static PassRefPtrWillBeRawPtr<RotationRate> create(bool canProvideAlpha,
      double alpha, bool canProvideBeta,  double beta, bool canProvideGamma, double g
     amma); | 70         static PassRefPtrWillBeRawPtr<RotationRate> create(bool canProvideAlpha,
      double alpha, bool canProvideBeta,  double beta, bool canProvideGamma, double g
     amma); | 
| 74         void trace(Visitor*) { } | 71         void trace(Visitor*) { } | 
| 75 | 72 | 
| 76         bool canProvideAlpha() const { return m_canProvideAlpha; } | 73         bool canProvideAlpha() const { return m_canProvideAlpha; } | 
| 77         bool canProvideBeta() const { return m_canProvideBeta; } | 74         bool canProvideBeta() const { return m_canProvideBeta; } | 
| 78         bool canProvideGamma() const { return m_canProvideGamma; } | 75         bool canProvideGamma() const { return m_canProvideGamma; } | 
| 79 | 76 | 
| 80         double alpha() const { return m_alpha; } | 77         double alpha() const { return m_alpha; } | 
| 81         double beta() const { return m_beta; } | 78         double beta() const { return m_beta; } | 
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 119     RefPtrWillBeMember<Acceleration> m_acceleration; | 116     RefPtrWillBeMember<Acceleration> m_acceleration; | 
| 120     RefPtrWillBeMember<Acceleration> m_accelerationIncludingGravity; | 117     RefPtrWillBeMember<Acceleration> m_accelerationIncludingGravity; | 
| 121     RefPtrWillBeMember<RotationRate> m_rotationRate; | 118     RefPtrWillBeMember<RotationRate> m_rotationRate; | 
| 122     bool m_canProvideInterval; | 119     bool m_canProvideInterval; | 
| 123     double m_interval; | 120     double m_interval; | 
| 124 }; | 121 }; | 
| 125 | 122 | 
| 126 } // namespace WebCore | 123 } // namespace WebCore | 
| 127 | 124 | 
| 128 #endif // DeviceMotionData_h | 125 #endif // DeviceMotionData_h | 
| OLD | NEW | 
|---|