Summary: | WebCore::DOMTimerFireState constructor fails to initialize m_initialDOMTreeVersion, m_previous on worker threads | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> | ||||||
Component: | DOM | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | cdumez, darin, rniwa, webkit-bug-importer, youennf | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | Other | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
David Kilzer (:ddkilzer)
2020-09-02 11:27:24 PDT
Created attachment 407780 [details]
Patch v1
Comment on attachment 407780 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=407780&action=review > Source/WebCore/page/DOMTimer.cpp:100 > bool m_contextIsDocument; Why not initialize this to false, too? I know it’s not necessary, but seems worth doing. Keep in mind that those other two are never used when m_contextIsDocument is false, so all of this is just "defensive programming". Another way to do this is to write the constructor differently, like this: , m_initialDOMTreeVersion(m_contextIsDocument ? downcast<Document>(context).domTreeVersion() : 0) , m_previous(m_contextIsDocument ? std::exchange(current, this) : nullptr) And reorder the members so m_contextIsDocument comes first. Created attachment 407894 [details]
Patch for landing
Comment on attachment 407894 [details]
Patch for landing
Adding cq+ since all bubbles passed.
Committed r266608: <https://trac.webkit.org/changeset/266608> All reviewed patches have been landed. Closing bug and clearing flags on attachment 407894 [details]. |