Changeset 204057 in webkit
- Timestamp:
- Aug 2, 2016, 6:22:25 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h (modified) (1 diff)
-
UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r204053 r204057 1 2016-08-02 Tim Horton <timothy_horton@apple.com> 2 3 REGRESSION (r203385): Frequent RELEASE_ASSERT in WebKit::RemoteLayerTreeDrawingArea::flushLayers() 4 https://bugs.webkit.org/show_bug.cgi?id=160481 5 <rdar://problem/27534205> 6 7 Reviewed by Simon Fraser. 8 9 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: 10 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: 11 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): 12 (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay): 13 (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): 14 If the UI process sends a didUpdate message while the Web process is in 15 the middle of flushing on a background thread, the drawing area will 16 allow another commit to start on the main thread, which then (rightfully) 17 causes the RELEASE_ASSERT. 18 19 This is normally not a problem, because didRefreshDisplay (which sends the didUpdate) 20 bails if m_didUpdateMessageState is anything other than NotSent, and m_didUpdateMessageState 21 is only NotSent if the Web process has sent a commit (and thus will not commit again until 22 it gets a didUpdate). This is the fundamental mechanism that avoids multiple commits being 23 in flight at once. 24 25 In r203385, I added a path where didRefreshDisplay could be called 26 before the first commit arrived (by way of 27 _applicationWillEnterForeground -> viewStateDidChange -> waitForDidUpdateViewState). 28 29 This caused trouble because m_didUpdateMessageState is initialized to NotSent, 30 which means that we could end up sending a didUpdate immediately, before the first 31 commit arrives - even worse, while the first commit is being flushed on a background thread, 32 leading the aforementioned RELEASE_ASSERT to fire. 33 34 Instead, initialize it to Sent (which I've renamed to DoesNotNeedDidUpdate), so that 35 we won't send a didUpdate until after the first commit arrives (at which point 36 the two processes are in agreement about the order of things). 37 38 It's not currently possible to API test this for multiple reasons, though it is fairly 39 easy to write a test app that reproduces reliably (by simulating suspend/resume notifications 40 inside the didFinishNavigation: callback). 41 1 42 2016-08-02 Enrica Casucci <enrica@apple.com> 2 43 -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h
r202291 r204057 92 92 RemoteLayerTreeHost m_remoteLayerTreeHost; 93 93 bool m_isWaitingForDidUpdateGeometry { false }; 94 enum DidUpdateMessageState { NotSent, Sent, MissedCommit };95 DidUpdateMessageState m_didUpdateMessageState { NotSent};94 enum DidUpdateMessageState { DoesNotNeedDidUpdate, NeedsDidUpdate, MissedCommit }; 95 DidUpdateMessageState m_didUpdateMessageState { DoesNotNeedDidUpdate }; 96 96 97 97 WebCore::IntSize m_lastSentSize; -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm
r203385 r204057 228 228 229 229 #if PLATFORM(IOS) 230 if (std::exchange(m_didUpdateMessageState, N otSent) == MissedCommit)230 if (std::exchange(m_didUpdateMessageState, NeedsDidUpdate) == MissedCommit) 231 231 didRefreshDisplay(monotonicallyIncreasingTime()); 232 232 [m_displayLinkHandler schedule]; 233 233 #else 234 m_didUpdateMessageState = N otSent;234 m_didUpdateMessageState = NeedsDidUpdate; 235 235 didRefreshDisplay(monotonicallyIncreasingTime()); 236 236 #endif … … 400 400 return; 401 401 402 if (m_didUpdateMessageState != N otSent) {402 if (m_didUpdateMessageState != NeedsDidUpdate) { 403 403 m_didUpdateMessageState = MissedCommit; 404 404 #if PLATFORM(IOS) … … 408 408 } 409 409 410 m_didUpdateMessageState = Sent;410 m_didUpdateMessageState = DoesNotNeedDidUpdate; 411 411 412 412 TraceScope tracingScope(RAFDidRefreshDisplayStart, RAFDidRefreshDisplayEnd); … … 426 426 // We must send the didUpdate message before blocking on the next commit, otherwise 427 427 // we can be guaranteed that the next commit won't come until after the waitForAndDispatchImmediately times out. 428 if (m_didUpdateMessageState != Sent)428 if (m_didUpdateMessageState != DoesNotNeedDidUpdate) 429 429 didRefreshDisplay(monotonicallyIncreasingTime()); 430 430
Note:
See TracChangeset
for help on using the changeset viewer.