Summary: | ASSERTION FAILED: m_wrapper on fast/events/scoped/editing-commands.html | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alexey Proskuryakov <ap> | ||||||||
Component: | WebCore JavaScript | Assignee: | Chris Dumez <cdumez> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | cdumez, darin, esprehn+autocc, ews-watchlist, ggaren, kangil.han, rniwa, sihui_liu, webkit-bot-watchers-bugzilla, webkit-bug-importer, ysuzuki | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | Other | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Alexey Proskuryakov
2020-04-01 10:43:22 PDT
Created attachment 399876 [details]
Patch
Comment on attachment 399876 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=399876&action=review > Source/WebCore/ChangeLog:10 > + so that it keeps alive alive both the target and its JS wrapper. double "alive" > Source/WebCore/dom/ScopedEventQueue.cpp:64 > + Vector<ScopedEvent> queuedEvents = WTFMove(m_queuedEvents); Is there a difference between releasing wrapper after all events are dispatched and releasing wrapper after each event is dispatched? Created attachment 399959 [details]
Patch
Comment on attachment 399959 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=399959&action=review > Source/WebCore/dom/ScopedEventQueue.cpp:50 > + ScopedEvent scopedEvent = { WTFMove(event), target }; 3 ways to write this: 1: ScopedEvent scopedEvent { WTFMove(event), target }; 2: ScopedEvent scopedEvent = { WTFMove(event), target }; 3: auto scopedEvent = ScopedEvent { WTFMove(event), target }; Style (1) seems like the most "normal". Antti convinced me to use style (3) in new WebKit code I am writing. > Source/WebCore/dom/ScopedEventQueue.cpp:64 > + Vector<ScopedEvent> queuedEvents = WTFMove(m_queuedEvents); I suggest using auto here. > Source/WebCore/dom/ScopedEventQueue.h:59 > + void dispatchEvent(ScopedEvent&) const; Why does this take a reference? Is this an in/out in some way? Comment on attachment 399959 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=399959&action=review >> Source/WebCore/dom/ScopedEventQueue.cpp:64 >> + Vector<ScopedEvent> queuedEvents = WTFMove(m_queuedEvents); > > I suggest using auto here. Technically, based on your recent comments, it is supposed to use std::exchange() instead of WTFMove() too since m_queuedEvents is reused after that. Comment on attachment 399959 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=399959&action=review >>> Source/WebCore/dom/ScopedEventQueue.cpp:64 >>> + Vector<ScopedEvent> queuedEvents = WTFMove(m_queuedEvents); >> >> I suggest using auto here. > > Technically, based on your recent comments, it is supposed to use std::exchange() instead of WTFMove() too since m_queuedEvents is reused after that. Good point! Created attachment 399961 [details]
Patch
Committed r262016: <https://trac.webkit.org/changeset/262016> All reviewed patches have been landed. Closing bug and clearing flags on attachment 399961 [details]. |