REGRESSION (r171045): Reproducible crash on navigation in PageClientImpl::willRecordN...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Jul 2014 18:31:54 +0000 (18:31 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Jul 2014 18:31:54 +0000 (18:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134887

Reviewed by Tim Horton.

* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::navigationGestureDidBegin): nil-check m_webView. It can be nil when
the client is using WKView directly.
(WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
(WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
(WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/PageClientImpl.mm

index ff41aed204f95cb3edb683c65ee7cc08f37cb639..b544e5e61fdf22233f051ec47dfd0fc0d65500ab 100644 (file)
@@ -1,3 +1,17 @@
+2014-07-14  Dan Bernstein  <mitz@apple.com>
+
+        REGRESSION (r171045): Reproducible crash on navigation in PageClientImpl::willRecordNavigationSnapshot
+        https://bugs.webkit.org/show_bug.cgi?id=134887
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::navigationGestureDidBegin): nil-check m_webView. It can be nil when
+        the client is using WKView directly.
+        (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
+        (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
+        (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.
+
 2014-07-14  Eric Carlson  <eric.carlson@apple.com>
 
         [Mac] don't enable low power audio mode on external output devices
index 38c43cb98408ce1e6382cf72bd6bca89bf67fb3a..fdf26d1d83e6af9fe73796137cbf753c202b7a79 100644 (file)
@@ -690,14 +690,16 @@ void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntR
 void PageClientImpl::navigationGestureDidBegin()
 {
 #if WK_API_ENABLED
-    NavigationState::fromWebPage(*m_webView->_page).navigationGestureDidBegin();
+    if (m_webView)
+        NavigationState::fromWebPage(*m_webView->_page).navigationGestureDidBegin();
 #endif
 }
 
 void PageClientImpl::navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem& item)
 {
 #if WK_API_ENABLED
-    NavigationState::fromWebPage(*m_webView->_page).navigationGestureWillEnd(willNavigate, item);
+    if (m_webView)
+        NavigationState::fromWebPage(*m_webView->_page).navigationGestureWillEnd(willNavigate, item);
 #else
     UNUSED_PARAM(willNavigate);
     UNUSED_PARAM(item);
@@ -707,7 +709,8 @@ void PageClientImpl::navigationGestureWillEnd(bool willNavigate, WebBackForwardL
 void PageClientImpl::navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem& item)
 {
 #if WK_API_ENABLED
-    NavigationState::fromWebPage(*m_webView->_page).navigationGestureDidEnd(willNavigate, item);
+    if (m_webView)
+        NavigationState::fromWebPage(*m_webView->_page).navigationGestureDidEnd(willNavigate, item);
 #else
     UNUSED_PARAM(willNavigate);
     UNUSED_PARAM(item);
@@ -717,7 +720,8 @@ void PageClientImpl::navigationGestureDidEnd(bool willNavigate, WebBackForwardLi
 void PageClientImpl::willRecordNavigationSnapshot(WebBackForwardListItem& item)
 {
 #if WK_API_ENABLED
-    NavigationState::fromWebPage(*m_webView->_page).willRecordNavigationSnapshot(item);
+    if (m_webView)
+        NavigationState::fromWebPage(*m_webView->_page).willRecordNavigationSnapshot(item);
 #else
     UNUSED_PARAM(item);
 #endif