WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
185752
Lazily create WebCore::Timer for WebCore::Image
https://bugs.webkit.org/show_bug.cgi?id=185752
Summary
Lazily create WebCore::Timer for WebCore::Image
David Kilzer (:ddkilzer)
Reported
2018-05-17 15:49:38 PDT
Not every image is an animated image, so lazily creating m_animationStartTimer saves 56 bytes per instance of WebCore::Image.
Attachments
Patch v1
(3.27 KB, patch)
2018-05-17 15:54 PDT
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
David Kilzer (:ddkilzer)
Comment 1
2018-05-17 15:54:03 PDT
Created
attachment 340663
[details]
Patch v1
Radar WebKit Bug Importer
Comment 2
2018-05-17 16:02:37 PDT
<
rdar://problem/40348570
>
David Kilzer (:ddkilzer)
Comment 3
2018-05-17 16:10:30 PDT
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.
Simon Fraser (smfr)
Comment 4
2018-05-17 16:20:38 PDT
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.
David Kilzer (:ddkilzer)
Comment 5
2018-05-17 19:39:28 PDT
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.
David Kilzer (:ddkilzer)
Comment 6
2018-05-17 20:29:43 PDT
Committed
r231940
: <
https://trac.webkit.org/changeset/231940
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug