RESOLVED FIXED 193195
[Web Animations] Audit Web Animations classes for memory reduction
https://bugs.webkit.org/show_bug.cgi?id=193195
Summary [Web Animations] Audit Web Animations classes for memory reduction
Antoine Quint
Reported 2019-01-07 07:21:44 PST
[Web Animations] Audit Web Animations classes for memory reduction
Attachments
Patch (24.57 KB, patch)
2019-01-07 07:39 PST, Antoine Quint
no flags
Patch (32.89 KB, patch)
2019-01-09 05:13 PST, Antoine Quint
ysuzuki: review+
Antoine Quint
Comment 1 2019-01-07 07:39:15 PST
EWS Watchlist
Comment 2 2019-01-07 07:41:56 PST
Attachment 358494 [details] did not pass style-queue: ERROR: Source/WebCore/animation/WebAnimation.h:136: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] Total errors found: 1 in 20 files If any of these errors are false positives, please file a bug against check-webkit-style.
Simon Fraser (smfr)
Comment 3 2019-01-07 12:47:03 PST
Comment on attachment 358494 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=358494&action=review > Source/WebCore/animation/ComputedEffectTiming.h:36 > Optional<double> localTime; > Optional<double> progress; > Optional<double> currentIteration; Can these be Markable<>? > Source/WebCore/animation/OptionalEffectTiming.h:40 > Optional<double> delay; > Optional<double> endDelay; > - Optional<FillMode> fill; > Optional<double> iterationStart; > Optional<double> iterations; Can these be Markable<>? > Source/WebCore/animation/OptionalEffectTiming.h:41 > String easing; What is this String for? Could it be an enum here? > Source/WebCore/animation/OptionalEffectTiming.h:43 > + Optional<FillMode> fill; > + Optional<PlaybackDirection> direction; Can these be Markable<>?
Antoine Quint
Comment 4 2019-01-09 01:21:59 PST
(In reply to Simon Fraser (smfr) from comment #3) > Comment on attachment 358494 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=358494&action=review > > > Source/WebCore/animation/ComputedEffectTiming.h:36 > > Optional<double> localTime; > > Optional<double> progress; > > Optional<double> currentIteration; > > Can these be Markable<>? > > > Source/WebCore/animation/OptionalEffectTiming.h:40 > > Optional<double> delay; > > Optional<double> endDelay; > > - Optional<FillMode> fill; > > Optional<double> iterationStart; > > Optional<double> iterations; > > Can these be Markable<>? I think we can safely convert all Optional<double> to Markable where we'd use NaN as an empty marker since NaN would never be a valid value for any of those. I'll look into this. > > Source/WebCore/animation/OptionalEffectTiming.h:41 > > String easing; > > What is this String for? Could it be an enum here? > > > Source/WebCore/animation/OptionalEffectTiming.h:43 > > + Optional<FillMode> fill; > > + Optional<PlaybackDirection> direction; > > Can these be Markable<>? Yes, we can use EnumMarkableTraits but this just increases the padding there. I'll still make that change.
Antoine Quint
Comment 5 2019-01-09 05:13:32 PST
EWS Watchlist
Comment 6 2019-01-09 05:16:04 PST
Attachment 358696 [details] did not pass style-queue: ERROR: Source/WebCore/animation/WebAnimation.h:137: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] Total errors found: 1 in 23 files If any of these errors are false positives, please file a bug against check-webkit-style.
Yusuke Suzuki
Comment 7 2019-01-09 23:40:44 PST
Comment on attachment 358696 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=358696&action=review r=me with some suggestions. > Source/WebCore/animation/FillMode.h:34 > +typedef Markable<FillMode, EnumMarkableTraits<FillMode, 5>> OptionalFillMode; Use `using` instead. And you can omit this `5`. EnumMarkableTraits automatically selects 255 for the empty mark since the underlying type is uint8_t and it picks the maximum value of the underlying type. So, using OptionalFillMode = Markable<FillMode, EnumMarkableTraits<FillMode>>; works. > Source/WebCore/animation/PlaybackDirection.h:34 > +typedef Markable<PlaybackDirection, EnumMarkableTraits<PlaybackDirection, 4>> OptionalPlaybackDirection; Use `using` instead. And you can omit `4` here. > Source/WebCore/animation/WebAnimationUtilities.h:61 > +typedef Markable<double, WebAnimationsMarkableDoubleTraits> MarkableDouble; Use `using` instead.
Antoine Quint
Comment 8 2019-01-10 00:19:47 PST
Radar WebKit Bug Importer
Comment 9 2019-01-10 00:21:29 PST
Note You need to log in before you can comment on or make changes to this bug.