Log Message
-[_WKThumbnailView _requestSnapshotIfNeeded] assumes that taking a snapshot will always succeed <https://webkit.org/b/132489> / <rdar://problem/16704660>
Reviewed by Tim Horton. * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView _requestSnapshotIfNeeded]): Don't attempt to create a CGImageRef if we failed to create a ShareableBitmap. This handles both the callback receiving a null Handle and a failure within ShareableBitmap::create.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (168194 => 168195)
--- trunk/Source/WebKit2/ChangeLog 2014-05-02 21:58:55 UTC (rev 168194)
+++ trunk/Source/WebKit2/ChangeLog 2014-05-02 22:04:02 UTC (rev 168195)
@@ -1,3 +1,15 @@
+2014-05-02 Mark Rowe <mr...@apple.com>
+
+ -[_WKThumbnailView _requestSnapshotIfNeeded] assumes that taking a snapshot will always succeed
+ <https://webkit.org/b/132489> / <rdar://problem/16704660>
+
+ Reviewed by Tim Horton.
+
+ * UIProcess/API/Cocoa/_WKThumbnailView.mm:
+ (-[_WKThumbnailView _requestSnapshotIfNeeded]): Don't attempt to create a CGImageRef if we failed
+ to create a ShareableBitmap. This handles both the callback receiving a null Handle and a failure
+ within ShareableBitmap::create.
+
2014-05-02 Anders Carlsson <ander...@apple.com>
Clean up FormDataElement
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm (168194 => 168195)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm 2014-05-02 21:58:55 UTC (rev 168194)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm 2014-05-02 22:04:02 UTC (rev 168195)
@@ -131,7 +131,7 @@
_lastSnapshotScale = _scale;
_webPageProxy->takeSnapshot(snapshotRect, bitmapSize, options, [thumbnailView](bool, const ShareableBitmap::Handle& imageHandle) {
RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(imageHandle, SharedMemory::ReadOnly);
- RetainPtr<CGImageRef> cgImage = bitmap->makeCGImage();
+ RetainPtr<CGImageRef> cgImage = bitmap ? bitmap->makeCGImage() : nullptr;
[thumbnailView _didTakeSnapshot:cgImage.get()];
});
}
_______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes