diff options
author | Chris Craik <ccraik@google.com> | 2012-10-23 11:44:21 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-23 11:44:22 -0700 |
commit | cbc18c589df65272fabd2652b1b3f4d1af519579 (patch) | |
tree | 4e3c6cd9076014aba54bd970fbc8217e4ffd033a /Source/WebCore/platform/graphics/android/layers/AndroidAnimation.h | |
parent | a464817e995321cae99f09266e27d4fa322d9b31 (diff) | |
parent | 21251e4e2304e2d8ed5040c4d42245eeea5f0143 (diff) | |
download | external_webkit-cbc18c589df65272fabd2652b1b3f4d1af519579.zip external_webkit-cbc18c589df65272fabd2652b1b3f4d1af519579.tar.gz external_webkit-cbc18c589df65272fabd2652b1b3f4d1af519579.tar.bz2 |
Merge "Ensure AndroidAnimation's copy of its name string is unique" into jb-mr1-dev
Diffstat (limited to 'Source/WebCore/platform/graphics/android/layers/AndroidAnimation.h')
-rw-r--r-- | Source/WebCore/platform/graphics/android/layers/AndroidAnimation.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/android/layers/AndroidAnimation.h b/Source/WebCore/platform/graphics/android/layers/AndroidAnimation.h index dca769f..704f89a 100644 --- a/Source/WebCore/platform/graphics/android/layers/AndroidAnimation.h +++ b/Source/WebCore/platform/graphics/android/layers/AndroidAnimation.h @@ -50,8 +50,14 @@ public: bool evaluate(LayerAndroid* layer, double time); virtual void applyForProgress(LayerAndroid* layer, float progress) = 0; static long instancesCount(); - void setName(const String& name) { m_name = name; } - String name() { return m_name; } + + // Since this class is shared between WebKit/UI thread, deep copy the name in the setter and + // don't share the value of m_name - this way this AndroidAnimation can be safely destroyed on + //any thread, since it is deref'd on both + void setName(const String& name) { m_name = name.threadsafeCopy(); } + bool isNamed(const String& name) { return m_name == name; } + String nameCopy() { return m_name.threadsafeCopy(); } + AnimatedPropertyID type() { return m_type; } bool fillsBackwards() { return m_fillsBackwards; } bool fillsForwards() { return m_fillsForwards; } @@ -65,7 +71,7 @@ protected: int m_iterationCount; int m_direction; RefPtr<TimingFunction> m_timingFunction; - String m_name; + String m_name; // Unique to this object, see comments for 'name' functions above AnimatedPropertyID m_type; KeyframeValueList* m_operations; int m_uniqueId; |