[iOS WK2] Speculative fix for crash in PlatformCALayerRemote::recursiveBuildTransaction
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 May 2014 22:15:08 +0000 (22:15 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 May 2014 22:15:08 +0000 (22:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132666

Reviewed by Tim Horton.

Crash reports suggest that owner() can be null. Assert and protect
against this.

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::recursiveBuildTransaction):

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp

index 0c9eba8..6506746 100644 (file)
@@ -1,3 +1,16 @@
+2014-05-07  Simon Fraser  <simon.fraser@apple.com>
+
+        [iOS WK2] Speculative fix for crash in PlatformCALayerRemote::recursiveBuildTransaction
+        https://bugs.webkit.org/show_bug.cgi?id=132666
+
+        Reviewed by Tim Horton.
+        
+        Crash reports suggest that owner() can be null. Assert and protect
+        against this.
+
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+        (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
+
 2014-05-07  Dan Bernstein  <mitz@apple.com>
 
         <rdar://problem/16831276> [iOS] Unparenting a WKWebView that’s loading pauses it
index 193d25c..e0d8cc8 100644 (file)
@@ -118,7 +118,8 @@ PlatformCALayerRemote::~PlatformCALayerRemote()
 
 void PlatformCALayerRemote::recursiveBuildTransaction(RemoteLayerTreeTransaction& transaction)
 {
-    if (m_properties.backingStore && !owner()->platformCALayerDrawsContent()) {
+    ASSERT(owner());
+    if (m_properties.backingStore && (!owner() || !owner()->platformCALayerDrawsContent())) {
         m_properties.backingStore = nullptr;
         m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::BackingStoreChanged);
     }