Bug 1195180 part 2 - Make DocumentTimeline inherit from nsARefreshObserver; r=heycam
authorBrian Birtles <birtles@gmail.com>
Mon, 28 Sep 2015 12:38:40 +0900
changeset 264666 33cbe1ef4956c93d6b9658656f0ec65a005b4100
parent 264665 fb2854a40e71ef7ed5c87a5fe99660f26cef9025
child 264667 9e72573ef43fef77a0d641721b91799876be2fab
push id29444
push usercbook@mozilla.com
push dateMon, 28 Sep 2015 12:17:21 +0000
treeherdermozilla-central@031db40e2b55 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1195180
milestone44.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 1195180 part 2 - Make DocumentTimeline inherit from nsARefreshObserver; r=heycam
dom/animation/DocumentTimeline.cpp
dom/animation/DocumentTimeline.h
--- a/dom/animation/DocumentTimeline.cpp
+++ b/dom/animation/DocumentTimeline.cpp
@@ -86,16 +86,21 @@ DocumentTimeline::ToTimelineTime(const T
   if (MOZ_UNLIKELY(!timing)) {
     return result;
   }
 
   result.SetValue(aTimeStamp - timing->GetNavigationStartTimeStamp());
   return result;
 }
 
+void
+DocumentTimeline::WillRefresh(mozilla::TimeStamp aTime)
+{
+}
+
 TimeStamp
 DocumentTimeline::ToTimeStamp(const TimeDuration& aTimeDuration) const
 {
   TimeStamp result;
   nsRefPtr<nsDOMNavigationTiming> timing = mDocument->GetNavigationTiming();
   if (MOZ_UNLIKELY(!timing)) {
     return result;
   }
--- a/dom/animation/DocumentTimeline.h
+++ b/dom/animation/DocumentTimeline.h
@@ -12,17 +12,19 @@
 #include "nsIDocument.h"
 #include "nsRefreshDriver.h"
 
 struct JSContext;
 
 namespace mozilla {
 namespace dom {
 
-class DocumentTimeline final : public AnimationTimeline
+class DocumentTimeline final
+  : public AnimationTimeline
+  , public nsARefreshObserver
 {
 public:
   explicit DocumentTimeline(nsIDocument* aDocument)
     : AnimationTimeline(aDocument->GetParentObject())
     , mDocument(aDocument)
   {
   }
 
@@ -45,16 +47,19 @@ public:
     nsRefreshDriver* refreshDriver = GetRefreshDriver();
     return !refreshDriver ||
            !refreshDriver->IsTestControllingRefreshesEnabled();
   }
   Nullable<TimeDuration> ToTimelineTime(const TimeStamp& aTimeStamp) const
                                                                      override;
   TimeStamp ToTimeStamp(const TimeDuration& aTimelineTime) const override;
 
+  // nsARefreshObserver methods
+  void WillRefresh(TimeStamp aTime) override;
+
 protected:
   TimeStamp GetCurrentTimeStamp() const;
   nsRefreshDriver* GetRefreshDriver() const;
 
   nsCOMPtr<nsIDocument> mDocument;
 
   // The most recently used refresh driver time. This is used in cases where
   // we don't have a refresh driver (e.g. because we are in a display:none