REGRESSION (r234980): Crash in -[WKWebView _restorePageStateToUnobscuredCenter:scale:]
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2018 03:54:32 +0000 (03:54 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2018 03:54:32 +0000 (03:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192127
rdar://problem/44194179

Reviewed by Tim Horton.

_restorePageStateToUnobscuredCenter: could receive an Optional<FloatRect> from the
web process, and unconditionally called .value() even though it may not be engaged.

No repro steps known, so no testcase.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238658 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

index 37bd2ac..2f9e3ae 100644 (file)
@@ -1,3 +1,19 @@
+2018-11-28  Simon Fraser  <simon.fraser@apple.com>
+
+        REGRESSION (r234980): Crash in -[WKWebView _restorePageStateToUnobscuredCenter:scale:]
+        https://bugs.webkit.org/show_bug.cgi?id=192127
+        rdar://problem/44194179
+
+        Reviewed by Tim Horton.
+        
+        _restorePageStateToUnobscuredCenter: could receive an Optional<FloatRect> from the
+        web process, and unconditionally called .value() even though it may not be engaged.
+        
+        No repro steps known, so no testcase.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
+
 2018-11-28  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r238653 and r238656.
 2018-11-28  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r238653 and r238656.
index 40a7d41..d9fca4d 100644 (file)
@@ -2039,7 +2039,7 @@ static inline bool areEssentiallyEqualAsFloat(float a, float b)
         return;
 
     _firstTransactionIDAfterPageRestore = downcast<WebKit::RemoteLayerTreeDrawingAreaProxy>(*_page->drawingArea()).nextLayerTreeTransactionID();
         return;
 
     _firstTransactionIDAfterPageRestore = downcast<WebKit::RemoteLayerTreeDrawingAreaProxy>(*_page->drawingArea()).nextLayerTreeTransactionID();
-    _unobscuredCenterToRestore = center.value();
+    _unobscuredCenterToRestore = center;
 
     _scaleToRestore = scale;
 }
 
     _scaleToRestore = scale;
 }