Summary: | Crash under DisplayRefreshMonitorManager::displayWasUpdated() | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||
Component: | WebCore Misc. | Assignee: | Chris Dumez <cdumez> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | achristensen, commit-queue, ggaren, pvollan, rniwa, sabouhallawa, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Bug Depends on: | 199847 | ||||||
Bug Blocks: | |||||||
Attachments: |
|
Description
Chris Dumez
2019-07-15 14:22:24 PDT
Created attachment 374151 [details]
Patch
Comment on attachment 374151 [details]
Patch
r=me
Comment on attachment 374151 [details] Patch Clearing flags on attachment: 374151 Committed r247459: <https://trac.webkit.org/changeset/247459> All reviewed patches have been landed. Closing bug. Comment on attachment 374151 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=374151&action=review > Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp:134 > - for (const auto& monitorWrapper : m_monitors) { > - auto& monitor = monitorWrapper.monitor; > + Vector<RefPtr<DisplayRefreshMonitor>> monitors = WTF::map(m_monitors, [](auto& monitorWrapper) { > + return monitorWrapper.monitor; > + }); > + for (auto& monitor : monitors) { Isn't PlatformDisplayID unique for every monitor? If so, why do we need to loop through all the monitors if we find one whose displayID matches the argument displayID? Can't we just break/return when we find the first one: if (displayID == monitor->displayID()) { if (monitor->hasRequestedRefreshCallback()) monitor->displayLinkFired(); break; } DisplayRefreshMonitorManager::unregisterClient() has similar logic like the proposed one so it does not need to copy the monitors before looping through them. |