Bug 1249564 - Part 1: Assign the parent object of AnimationEffectTiming(ReadOnly). r=birtles,bz
authorBoris Chiou <boris.chiou@gmail.com>
Sun, 10 Apr 2016 13:51:32 +0800
changeset 331195 4f1cef92aec487f83ee1abbb119c6fac950aa989
parent 331194 d1c487cc4ef287f33f6e92779dcf8c2247197226
child 331196 d2b0f265bea515404964bdfdcf78f224bfabbe9e
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles, bz
bugs1249564
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1249564 - Part 1: Assign the parent object of AnimationEffectTiming(ReadOnly). r=birtles,bz Use the current document as the parent object of AnimationEffectTiming(ReadOnly). MozReview-Commit-ID: JfPLk95hsJ1
dom/animation/AnimationEffectTiming.h
dom/animation/AnimationEffectTimingReadOnly.h
dom/animation/KeyframeEffect.cpp
--- a/dom/animation/AnimationEffectTiming.h
+++ b/dom/animation/AnimationEffectTiming.h
@@ -12,18 +12,20 @@
 #include "nsStringFwd.h"
 
 namespace mozilla {
 namespace dom {
 
 class AnimationEffectTiming : public AnimationEffectTimingReadOnly
 {
 public:
-  AnimationEffectTiming(const TimingParams& aTiming, KeyframeEffect* aEffect)
-    : AnimationEffectTimingReadOnly(aTiming)
+  AnimationEffectTiming(nsISupports* aParent,
+                        const TimingParams& aTiming,
+                        KeyframeEffect* aEffect)
+    : AnimationEffectTimingReadOnly(aParent, aTiming)
     , mEffect(aEffect) { }
 
   JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
   void Unlink() override { mEffect = nullptr; }
 
   void SetDelay(double aDelay);
   void SetEndDelay(double aEndDelay);
--- a/dom/animation/AnimationEffectTimingReadOnly.h
+++ b/dom/animation/AnimationEffectTimingReadOnly.h
@@ -18,18 +18,20 @@
 
 namespace mozilla {
 namespace dom {
 
 class AnimationEffectTimingReadOnly : public nsWrapperCache
 {
 public:
   AnimationEffectTimingReadOnly() = default;
-  explicit AnimationEffectTimingReadOnly(const TimingParams& aTiming)
-    : mTiming(aTiming) { }
+  AnimationEffectTimingReadOnly(nsISupports* aParent,
+                                const TimingParams& aTiming)
+    : mParent(aParent)
+    , mTiming(aTiming) { }
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(AnimationEffectTimingReadOnly)
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AnimationEffectTimingReadOnly)
 
 protected:
   virtual ~AnimationEffectTimingReadOnly() = default;
 
 public:
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -75,17 +75,18 @@ NS_IMPL_ADDREF_INHERITED(KeyframeEffectR
 NS_IMPL_RELEASE_INHERITED(KeyframeEffectReadOnly, AnimationEffectReadOnly)
 
 KeyframeEffectReadOnly::KeyframeEffectReadOnly(
   nsIDocument* aDocument,
   Element* aTarget,
   CSSPseudoElementType aPseudoType,
   const TimingParams& aTiming)
   : KeyframeEffectReadOnly(aDocument, aTarget, aPseudoType,
-                           new AnimationEffectTimingReadOnly(aTiming))
+                           new AnimationEffectTimingReadOnly(aDocument,
+                                                             aTiming))
 {
 }
 
 KeyframeEffectReadOnly::KeyframeEffectReadOnly(
   nsIDocument* aDocument,
   Element* aTarget,
   CSSPseudoElementType aPseudoType,
   AnimationEffectTimingReadOnly* aTiming)
@@ -1338,17 +1339,17 @@ KeyframeEffectReadOnly::SetPerformanceWa
 //
 //---------------------------------------------------------------------
 
 KeyframeEffect::KeyframeEffect(nsIDocument* aDocument,
                                Element* aTarget,
                                CSSPseudoElementType aPseudoType,
                                const TimingParams& aTiming)
   : KeyframeEffectReadOnly(aDocument, aTarget, aPseudoType,
-                           new AnimationEffectTiming(aTiming, this))
+                           new AnimationEffectTiming(aDocument, aTiming, this))
 {
 }
 
 JSObject*
 KeyframeEffect::WrapObject(JSContext* aCx,
                            JS::Handle<JSObject*> aGivenProto)
 {
   return KeyframeEffectBinding::Wrap(aCx, this, aGivenProto);