Crash under WKPageCreateSnapshotOfVisibleContent if there is no response from the...
authorjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Apr 2011 22:01:48 +0000 (22:01 +0000)
committerjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Apr 2011 22:01:48 +0000 (22:01 +0000)
in the allotted time.
https://bugs.webkit.org/show_bug.cgi?id=59738

Reviewed by Darin Adler.

If the handle is null, don't try to create a ShareableBitmap and then a WebImage out of it.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::createSnapshotOfVisibleContent):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.cpp

index 2fb527d..e6b081c 100644 (file)
@@ -1,3 +1,16 @@
+2011-04-28  Jessie Berlin  <jberlin@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Crash under WKPageCreateSnapshotOfVisibleContent if there is no response from the Web Process
+        in the allotted time.
+        https://bugs.webkit.org/show_bug.cgi?id=59738
+
+        If the handle is null, don't try to create a ShareableBitmap and then a WebImage out of it.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::createSnapshotOfVisibleContent):
+
 2011-04-28  Xan Lopez  <xlopez@igalia.com>
 
         Reviewed by Martin Robinson.
index 186c130..e7b06b1 100644 (file)
@@ -3077,6 +3077,8 @@ PassRefPtr<WebImage> WebPageProxy::createSnapshotOfVisibleContent()
     // that the UI Process is not permanently stuck waiting on a potentially crashing Web Process.
     static const double createSnapshotOfVisibleContentSyncMessageTimeout = 1.0;
     process()->sendSync(Messages::WebPage::CreateSnapshotOfVisibleContent(), Messages::WebPage::CreateSnapshotOfVisibleContent::Reply(snapshotHandle), m_pageID, createSnapshotOfVisibleContentSyncMessageTimeout);
+    if (snapshotHandle.isNull())
+        return 0;
     return WebImage::create(ShareableBitmap::create(snapshotHandle));
 }