Not every image is an animated image, so lazily creating m_animationStartTimer saves 56 bytes per instance of WebCore::Image.
Created attachment 340663 [details] Patch v1
<rdar://problem/40348570>
This bug improves the safety of using WebCore::Image in the UI Process since current uses do not include animated images. It also prevents a WebCore::Timer from being allocated for a nullImage.
Comment on attachment 340663 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=340663&action=review > Source/WebCore/platform/graphics/Image.cpp:351 > + std::call_once(onceFlag, [this] { Don't need call_once. Just if (!m_animationStartTimer) > Source/WebCore/platform/graphics/Image.h:203 > + std::once_flag onceFlag; Don't need this here.
Comment on attachment 340663 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=340663&action=review >> Source/WebCore/platform/graphics/Image.cpp:351 >> + std::call_once(onceFlag, [this] { > > Don't need call_once. Just if (!m_animationStartTimer) So we can assume Image::startAnimationAsynchronously() and Image::animationPending() are always called on the main thread? >> Source/WebCore/platform/graphics/Image.h:203 >> + std::once_flag onceFlag; > > Don't need this here. Saves another 8 bytes. WebCore::Image goes down from 104 bytes to just 40 bytes with this change.
Committed r231940: <https://trac.webkit.org/changeset/231940>