Bug 1366956 part 2 - Replace IsFramesTimingEnabled FFI function with direct pref cache access. r?heycam draft
authorXidorn Quan <me@upsuper.org>
Tue, 18 Jul 2017 10:55:36 +1000
changeset 618268 bc5a581357dd701580a44f126aae08afd9dfa921
parent 618267 10399428e862e63467a2a972210672d49abddda1
child 618269 8ed3a5b60546aa2f7cfea18b475d9fd1acfca107
push id71275
push userxquan@mozilla.com
push dateMon, 31 Jul 2017 04:43:17 +0000
reviewersheycam
bugs1366956
milestone56.0a1
Bug 1366956 part 2 - Replace IsFramesTimingEnabled FFI function with direct pref cache access. r?heycam MozReview-Commit-ID: 3pVCEmuxf9D
layout/style/ServoBindings.cpp
layout/style/ServoBindings.h
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -49,17 +49,16 @@
 
 #include "mozilla/DeclarationBlockInlines.h"
 #include "mozilla/EffectCompositor.h"
 #include "mozilla/EffectSet.h"
 #include "mozilla/EventStates.h"
 #include "mozilla/GeckoStyleContext.h"
 #include "mozilla/Keyframe.h"
 #include "mozilla/Mutex.h"
-#include "mozilla/Preferences.h"
 #include "mozilla/ServoElementSnapshot.h"
 #include "mozilla/ServoRestyleManager.h"
 #include "mozilla/StyleAnimationValue.h"
 #include "mozilla/SystemGroup.h"
 #include "mozilla/ServoMediaList.h"
 #include "mozilla/RWLock.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ElementInlines.h"
@@ -85,18 +84,16 @@ using namespace mozilla::dom;
   }
 #include "mozilla/ServoArcTypeList.h"
 SERVO_ARC_TYPE(StyleContext, ServoStyleContext)
 #undef SERVO_ARC_TYPE
 
 static Mutex* sServoFontMetricsLock = nullptr;
 static RWLock* sServoLangFontPrefsLock = nullptr;
 
-static bool sFramesTimingFunctionEnabled;
-
 static
 const nsFont*
 ThreadSafeGetDefaultFontHelper(const nsPresContext* aPresContext,
                                nsIAtom* aLanguage, uint8_t aGenericId)
 {
   bool needsCache = false;
   const nsFont* retval;
 
@@ -825,21 +822,16 @@ Gecko_GetPositionInSegment(RawGeckoAnima
   double positionInSegment =
     (aProgress - aSegment->mFromKey) / (aSegment->mToKey - aSegment->mFromKey);
 
   return ComputedTimingFunction::GetPortion(aSegment->mTimingFunction,
                                             positionInSegment,
                                             aBeforeFlag);
 }
 
-bool
-Gecko_IsFramesTimingEnabled() {
-  return sFramesTimingFunctionEnabled;
-}
-
 RawServoAnimationValueBorrowedOrNull
 Gecko_AnimationGetBaseStyle(void* aBaseStyles, nsCSSPropertyID aProperty)
 {
   auto base =
     static_cast<nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>*>
       (aBaseStyles);
   return base->GetWeak(aProperty);
 }
@@ -2413,19 +2405,16 @@ Gecko_XBLBinding_InheritsStyle(RawGeckoX
 void
 InitializeServo()
 {
   URLExtraData::InitDummy();
   Servo_Initialize(URLExtraData::Dummy());
 
   sServoFontMetricsLock = new Mutex("Gecko_GetFontMetrics");
   sServoLangFontPrefsLock = new RWLock("nsPresContext::GetDefaultFont");
-
-  Preferences::AddBoolVarCache(&sFramesTimingFunctionEnabled,
-                               "layout.css.frames-timing.enabled");
 }
 
 void
 ShutdownServo()
 {
   delete sServoFontMetricsLock;
   delete sServoLangFontPrefsLock;
   Servo_Shutdown();
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -259,17 +259,16 @@ nsCSSPropertyID Gecko_ElementTransitions
 RawServoAnimationValueBorrowedOrNull Gecko_ElementTransitions_EndValueAt(
   RawGeckoElementBorrowed aElementOrPseudo,
   size_t aIndex);
 double Gecko_GetProgressFromComputedTiming(RawGeckoComputedTimingBorrowed aComputedTiming);
 double Gecko_GetPositionInSegment(
   RawGeckoAnimationPropertySegmentBorrowed aSegment,
   double aProgress,
   mozilla::ComputedTimingFunction::BeforeFlag aBeforeFlag);
-bool Gecko_IsFramesTimingEnabled();
 // Get servo's AnimationValue for |aProperty| from the cached base style
 // |aBaseStyles|.
 // |aBaseStyles| is nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>.
 // We use void* to avoid exposing nsRefPtrHashtable in FFI.
 RawServoAnimationValueBorrowedOrNull Gecko_AnimationGetBaseStyle(
   void* aBaseStyles,
   nsCSSPropertyID aProperty);
 void Gecko_StyleTransition_SetUnsupportedProperty(