- Revision
- 170460
- Author
- benja...@webkit.org
- Date
- 2014-06-25 21:15:32 -0700 (Wed, 25 Jun 2014)
Log Message
REGRESSION (r170325): UI process crashes in lastCommittedLayerTreeTransactionID() when the Web Content process crashes
https://bugs.webkit.org/show_bug.cgi?id=134284
Patch by Benjamin Poulain <bpoul...@apple.com> on 2014-06-25
Reviewed by Simon Fraser.
The crash was caused by the access to the Drawing Area after the crash.
This lead to discovering another bug: m_lastVisibleContentRectUpdate could have been updated after WebPageProxy::resetState(),
which in turn would prevent valid updates when a new WebProcess is created.
This patch fixes both issues by moving the VisibleContentRectUpdateInfo to be internal to WebPageProxy,
then early return if we get there in an invalid state.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::updateVisibleContentRects):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (170459 => 170460)
--- trunk/Source/WebKit2/ChangeLog 2014-06-26 03:59:10 UTC (rev 170459)
+++ trunk/Source/WebKit2/ChangeLog 2014-06-26 04:15:32 UTC (rev 170460)
@@ -1,3 +1,23 @@
+2014-06-25 Benjamin Poulain <bpoul...@apple.com>
+
+ REGRESSION (r170325): UI process crashes in lastCommittedLayerTreeTransactionID() when the Web Content process crashes
+ https://bugs.webkit.org/show_bug.cgi?id=134284
+
+ Reviewed by Simon Fraser.
+
+ The crash was caused by the access to the Drawing Area after the crash.
+ This lead to discovering another bug: m_lastVisibleContentRectUpdate could have been updated after WebPageProxy::resetState(),
+ which in turn would prevent valid updates when a new WebProcess is created.
+
+ This patch fixes both issues by moving the VisibleContentRectUpdateInfo to be internal to WebPageProxy,
+ then early return if we get there in an invalid state.
+
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/ios/WKContentView.mm:
+ (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::updateVisibleContentRects):
+
2014-06-25 Brady Eidson <beid...@apple.com>
Add new platform gamepad abstractions
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (170459 => 170460)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2014-06-26 03:59:10 UTC (rev 170459)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2014-06-26 04:15:32 UTC (rev 170460)
@@ -382,7 +382,7 @@
const WebCore::FloatRect& exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedRect(); }
const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredRect(); }
- bool updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
+ void updateVisibleContentRects(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate);
enum class UnobscuredRectConstraint { ConstrainedToDocumentRect, Unconstrained };
WebCore::FloatRect computeCustomFixedPositionRect(const WebCore::FloatRect& unobscuredContentRect, double displayedContentScale, UnobscuredRectConstraint = UnobscuredRectConstraint::Unconstrained) const;
Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (170459 => 170460)
--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm 2014-06-26 03:59:10 UTC (rev 170459)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm 2014-06-26 04:15:32 UTC (rev 170460)
@@ -564,8 +564,8 @@
_historicalKinematicData.clear();
FloatRect fixedPositionRectForLayout = _page->computeCustomFixedPositionRect(unobscuredRect, zoomScale, WebPageProxy::UnobscuredRectConstraint::ConstrainedToDocumentRect);
- _page->updateVisibleContentRects(VisibleContentRectUpdateInfo(visibleRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, fixedPositionRectForLayout,
- zoomScale, isStableState, isChangingObscuredInsetsInteractively, timestamp, velocityData.horizontalVelocity, velocityData.verticalVelocity, velocityData.scaleChangeRate, toRemoteLayerTreeDrawingAreaProxy(_page->drawingArea())->lastCommittedLayerTreeTransactionID()));
+ _page->updateVisibleContentRects(visibleRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, fixedPositionRectForLayout,
+ zoomScale, isStableState, isChangingObscuredInsetsInteractively, timestamp, velocityData.horizontalVelocity, velocityData.verticalVelocity, velocityData.scaleChangeRate);
RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page->scrollingCoordinatorProxy();
scrollingCoordinator->viewportChangedViaDelegatedScrolling(scrollingCoordinator->rootScrollingNodeID(), _page->computeCustomFixedPositionRect(_page->unobscuredContentRect(), zoomScale), zoomScale);
Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (170459 => 170460)
--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2014-06-26 03:59:10 UTC (rev 170459)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2014-06-26 04:15:32 UTC (rev 170460)
@@ -33,6 +33,7 @@
#import "EditingRange.h"
#import "NativeWebKeyboardEvent.h"
#import "PageClient.h"
+#import "RemoteLayerTreeDrawingAreaProxy.h"
#import "RemoteLayerTreeDrawingAreaProxyMessages.h"
#import "RemoteLayerTreeTransaction.h"
#import "ViewUpdateDispatcherMessages.h"
@@ -186,14 +187,19 @@
callback->performCallbackWithReturnValue(beforeText, markedText, selectedText, afterText, location, length);
}
-bool WebPageProxy::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visibleContentRectUpdateInfo)
+void WebPageProxy::updateVisibleContentRects(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate)
{
+ if (!isValid())
+ return;
+
+ VisibleContentRectUpdateInfo visibleContentRectUpdateInfo(exposedRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, customFixedPositionRect, scale, inStableState, isChangingObscuredInsetsInteractively, timestamp, horizontalVelocity, verticalVelocity, scaleChangeRate, toRemoteLayerTreeDrawingAreaProxy(drawingArea())->lastCommittedLayerTreeTransactionID());
+
if (visibleContentRectUpdateInfo == m_lastVisibleContentRectUpdate)
- return false;
+ return;
m_lastVisibleContentRectUpdate = visibleContentRectUpdateInfo;
m_process->send(Messages::ViewUpdateDispatcher::VisibleContentRectUpdate(m_pageID, visibleContentRectUpdateInfo), 0);
- return true;
+ return;
}
static inline float adjustedUnexposedEdge(float documentEdge, float exposedRectEdge, float factor)