Changeset 170787 in webkit
- Timestamp:
- Jul 4, 2014, 12:10:10 AM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 9 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/WebPageProxy.cpp (modified) (5 diffs)
-
UIProcess/WebPageProxy.h (modified) (3 diffs)
-
UIProcess/ios/WKContentView.mm (modified) (1 diff)
-
WebProcess/WebPage/DrawingArea.h (modified) (1 diff)
-
WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h (modified) (1 diff)
-
WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm (modified) (3 diffs)
-
WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (modified) (1 diff)
-
WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r170785 r170787 1 2014-07-04 Timothy Horton <timothy_horton@apple.com> 2 3 [iOS][WK2] Black web view after un-suspending process 4 https://bugs.webkit.org/show_bug.cgi?id=134623 5 <rdar://problem/17513223> 6 7 Reviewed by Simon Fraser. 8 9 * UIProcess/WebPageProxy.cpp: 10 (WebKit::WebPageProxy::viewStateDidChange): 11 Add an argument to viewStateDidChange that allows callers (-[WKContentView _applicationWillEnterForeground:]) 12 to force us to wait for a synchronous reply from the Web process after performing a view state change. 13 14 (WebKit::WebPageProxy::dispatchViewStateChange): 15 Move the has-been-in-window-and-now-is-newly-in-window check into dispatchViewStateChange. 16 Adjust the logic surrounding going into/out of window by factoring out the IsInWindow-did-change check, for clarity. 17 18 * UIProcess/WebPageProxy.h: 19 * UIProcess/ios/WKContentView.mm: 20 (-[WKContentView _applicationWillEnterForeground:]): 21 As previously mentioned, wait for a reply when foregrounding. 22 23 * WebProcess/WebPage/DrawingArea.h: 24 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: 25 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: 26 (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately): 27 (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush): 28 (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange): 29 Make sure to schedule a commit immediately if the UI process is waiting for a reply. 30 Previously we assumed that a commit would be scheduled anyway because we would have to reparent the 31 layer tree, but that doesn't happen in the suspension-without-unparenting case. Also, we want to skip 32 all throttling in this case. 33 34 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: 35 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 36 (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately): 37 1 38 2014-07-03 Gavin Barraclough <baraclough@apple.com> 2 39 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r170776 r170787 367 367 , m_configurationPreferenceValues(configuration.preferenceValues) 368 368 , m_potentiallyChangedViewStateFlags(ViewState::NoFlags) 369 , m_viewStateChangeWantsReply( WantsReplyOrNot::DoesNotWantReply)369 , m_viewStateChangeWantsReply(false) 370 370 { 371 371 if (m_process->state() == WebProcessProxy::State::Running) { … … 1102 1102 } 1103 1103 1104 void WebPageProxy::viewStateDidChange(ViewState::Flags mayHaveChanged) 1105 { 1106 bool isNewlyInWindow = !isInWindow() && (mayHaveChanged & ViewState::IsInWindow) && m_pageClient.isViewInWindow(); 1107 1104 void WebPageProxy::viewStateDidChange(ViewState::Flags mayHaveChanged, bool wantsReply) 1105 { 1108 1106 m_potentiallyChangedViewStateFlags |= mayHaveChanged; 1109 m_viewStateChangeWantsReply = ((m_viewWasEverInWindow && isNewlyInWindow) || m_viewStateChangeWantsReply == WantsReplyOrNot::DoesWantReply) ? WantsReplyOrNot::DoesWantReply : WantsReplyOrNot::DoesNotWantReply;1107 m_viewStateChangeWantsReply = m_viewStateChangeWantsReply || wantsReply; 1110 1108 1111 1109 #if PLATFORM(COCOA) 1112 if ( isNewlyInWindow) {1110 if (!isInWindow() && (mayHaveChanged & ViewState::IsInWindow) && m_pageClient.isViewInWindow()) { 1113 1111 dispatchViewStateChange(); 1114 1112 return; … … 1118 1116 dispatchViewStateChange(); 1119 1117 #endif 1118 } 1119 1120 void WebPageProxy::viewDidLeaveWindow() 1121 { 1122 #if ENABLE(INPUT_TYPE_COLOR_POPOVER) 1123 // When leaving the current page, close the popover color well. 1124 if (m_colorPicker) 1125 endColorPicker(); 1126 #endif 1127 #if PLATFORM(IOS) 1128 // When leaving the current page, close the video fullscreen. 1129 if (m_videoFullscreenManager) 1130 m_videoFullscreenManager->requestHideAndExitFullscreen(); 1131 #endif 1132 } 1133 1134 void WebPageProxy::viewDidEnterWindow() 1135 { 1136 LayerHostingMode layerHostingMode = m_pageClient.viewLayerHostingMode(); 1137 if (m_layerHostingMode != layerHostingMode) { 1138 m_layerHostingMode = layerHostingMode; 1139 m_process->send(Messages::WebPage::SetLayerHostingMode(static_cast<unsigned>(layerHostingMode)), m_pageID); 1140 } 1120 1141 } 1121 1142 … … 1139 1160 ViewState::Flags changed = m_viewState ^ previousViewState; 1140 1161 1162 // We always want to wait for the Web process to reply if we've been in-window before and are coming back in-window. 1163 if (m_viewWasEverInWindow && (changed & ViewState::IsInWindow) && isInWindow()) 1164 m_viewStateChangeWantsReply = true; 1165 1141 1166 if (changed) 1142 m_process->send(Messages::WebPage::SetViewState(m_viewState, m_viewStateChangeWantsReply == WantsReplyOrNot::DoesWantReply), m_pageID);1167 m_process->send(Messages::WebPage::SetViewState(m_viewState, m_viewStateChangeWantsReply), m_pageID); 1143 1168 1144 1169 // This must happen after the SetViewState message is sent, to ensure the page visibility event can fire. … … 1154 1179 m_process->responsivenessTimer()->stop(); 1155 1180 1156 if ((m_potentiallyChangedViewStateFlags & ViewState::IsInWindow) && (m_viewState & ViewState::IsInWindow)) { 1157 LayerHostingMode layerHostingMode = m_pageClient.viewLayerHostingMode(); 1158 if (m_layerHostingMode != layerHostingMode) { 1159 m_layerHostingMode = layerHostingMode; 1160 m_process->send(Messages::WebPage::SetLayerHostingMode(static_cast<unsigned>(layerHostingMode)), m_pageID); 1161 } 1162 } 1163 1164 if ((m_potentiallyChangedViewStateFlags & ViewState::IsInWindow) && !(m_viewState & ViewState::IsInWindow)) { 1165 #if ENABLE(INPUT_TYPE_COLOR_POPOVER) 1166 // When leaving the current page, close the popover color well. 1167 if (m_colorPicker) 1168 endColorPicker(); 1169 #endif 1170 #if PLATFORM(IOS) 1171 // When leaving the current page, close the video fullscreen. 1172 if (m_videoFullscreenManager) 1173 m_videoFullscreenManager->requestHideAndExitFullscreen(); 1174 #endif 1181 if (changed & ViewState::IsInWindow) { 1182 if (isInWindow()) 1183 viewDidEnterWindow(); 1184 else 1185 viewDidLeaveWindow(); 1175 1186 } 1176 1187 1177 1188 updateBackingStoreDiscardableState(); 1178 1189 1179 if (m_viewStateChangeWantsReply == WantsReplyOrNot::DoesWantReply)1190 if (m_viewStateChangeWantsReply) 1180 1191 waitForDidUpdateViewState(); 1181 1192 1182 1193 m_potentiallyChangedViewStateFlags = ViewState::NoFlags; 1183 m_viewStateChangeWantsReply = WantsReplyOrNot::DoesNotWantReply;1194 m_viewStateChangeWantsReply = false; 1184 1195 } 1185 1196 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r170782 r170787 361 361 bool delegatesScrolling() const { return m_delegatesScrolling; } 362 362 363 enum class WantsReplyOrNot { DoesNotWantReply, DoesWantReply }; 364 void viewStateDidChange(WebCore::ViewState::Flags mayHaveChanged); 363 void viewStateDidChange(WebCore::ViewState::Flags mayHaveChanged, bool wantsReply = false); 365 364 bool isInWindow() const { return m_viewState & WebCore::ViewState::IsInWindow; } 366 365 void waitForDidUpdateViewState(); … … 1267 1266 1268 1267 void dispatchViewStateChange(); 1268 void viewDidLeaveWindow(); 1269 void viewDidEnterWindow(); 1269 1270 1270 1271 PageClient& m_pageClient; … … 1514 1515 WebPreferencesStore::ValueMap m_configurationPreferenceValues; 1515 1516 WebCore::ViewState::Flags m_potentiallyChangedViewStateFlags; 1516 WantsReplyOrNotm_viewStateChangeWantsReply;1517 bool m_viewStateChangeWantsReply; 1517 1518 }; 1518 1519 -
trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm
r170783 r170787 761 761 { 762 762 _page->applicationWillEnterForeground(); 763 _page->viewStateDidChange(ViewState::AllFlags & ~ViewState::IsInWindow );763 _page->viewStateDidChange(ViewState::AllFlags & ~ViewState::IsInWindow, true); 764 764 } 765 765 -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
r170761 r170787 102 102 virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) = 0; 103 103 virtual void scheduleCompositingLayerFlush() = 0; 104 virtual void scheduleCompositingLayerFlushImmediately() = 0; 104 105 105 106 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
r170761 r170787 67 67 virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) override; 68 68 virtual void scheduleCompositingLayerFlush() override; 69 virtual void scheduleCompositingLayerFlushImmediately() override; 69 70 70 71 virtual void addTransactionCallbackID(uint64_t callbackID) override; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
r170774 r170787 240 240 } 241 241 242 void RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately() 243 { 244 m_layerFlushTimer.startOneShot(0_ms); 245 } 246 242 247 void RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush() 243 248 { … … 249 254 if (m_isLayerFlushThrottlingTemporarilyDisabledForInteraction) { 250 255 m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = false; 251 m_layerFlushTimer.startOneShot(0_ms);256 scheduleCompositingLayerFlushImmediately(); 252 257 return; 253 258 } … … 428 433 { 429 434 // FIXME: Should we suspend painting while not visible, like TiledCoreAnimationDrawingArea? Probably. 435 436 if (wantsDidUpdateViewState) 437 scheduleCompositingLayerFlushImmediately(); 430 438 } 431 439 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
r170319 r170787 68 68 virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) override; 69 69 virtual void scheduleCompositingLayerFlush() override; 70 virtual void scheduleCompositingLayerFlushImmediately() override; 70 71 71 72 virtual void updatePreferences(const WebPreferencesStore&) override; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
r170557 r170787 175 175 } 176 176 177 void TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately() 178 { 179 scheduleCompositingLayerFlush(); 180 } 181 177 182 void TiledCoreAnimationDrawingArea::updatePreferences(const WebPreferencesStore&) 178 183 {
Note:
See TracChangeset
for help on using the changeset viewer.