Title: [170963] trunk/Source
Revision
170963
Author
[email protected]
Date
2014-07-10 08:39:49 -0700 (Thu, 10 Jul 2014)

Log Message

Assertions or crashes under _takeViewSnapshot when restoring windows
https://bugs.webkit.org/show_bug.cgi?id=134792

Reviewed by Simon Fraser.

* UIProcess/API/mac/WKView.mm:
(-[WKView _takeViewSnapshot]):
Taking a window-server snapshot of a non-visible window tends to not succeed.

* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::createFromImage):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (170962 => 170963)


--- trunk/Source/WebCore/ChangeLog	2014-07-10 12:23:59 UTC (rev 170962)
+++ trunk/Source/WebCore/ChangeLog	2014-07-10 15:39:49 UTC (rev 170963)
@@ -1,3 +1,13 @@
+2014-07-10  Timothy Horton  <[email protected]>
+
+        Assertions or crashes under _takeViewSnapshot when restoring windows
+        https://bugs.webkit.org/show_bug.cgi?id=134792
+
+        Reviewed by Simon Fraser.
+
+        * platform/graphics/cocoa/IOSurface.mm:
+        (IOSurface::createFromImage):
+
 2014-07-10  Youenn Fablet  <[email protected]>
 
         [XHR] overrideMimeType() should be able to change encoding in HEADERS RECEIVED state

Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm (170962 => 170963)


--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm	2014-07-10 12:23:59 UTC (rev 170962)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm	2014-07-10 15:39:49 UTC (rev 170963)
@@ -72,6 +72,9 @@
 
 PassRefPtr<IOSurface> IOSurface::createFromImage(CGImageRef image)
 {
+    if (!image)
+        return nullptr;
+
     size_t width = CGImageGetWidth(image);
     size_t height = CGImageGetHeight(image);
 

Modified: trunk/Source/WebKit2/ChangeLog (170962 => 170963)


--- trunk/Source/WebKit2/ChangeLog	2014-07-10 12:23:59 UTC (rev 170962)
+++ trunk/Source/WebKit2/ChangeLog	2014-07-10 15:39:49 UTC (rev 170963)
@@ -1,3 +1,14 @@
+2014-07-10  Timothy Horton  <[email protected]>
+
+        Assertions or crashes under _takeViewSnapshot when restoring windows
+        https://bugs.webkit.org/show_bug.cgi?id=134792
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _takeViewSnapshot]):
+        Taking a window-server snapshot of a non-visible window tends to not succeed.
+
 2014-07-09  Pratik Solanki  <[email protected]>
 
         Buffer CSS and JS resources in network process before sending over to web process

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (170962 => 170963)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-07-10 12:23:59 UTC (rev 170962)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-07-10 15:39:49 UTC (rev 170963)
@@ -3108,7 +3108,7 @@
     ViewSnapshot snapshot;
 
     CGSWindowID windowID = (CGSWindowID)[window windowNumber];
-    if (!windowID)
+    if (!windowID || ![window isVisible])
         return snapshot;
 
     RetainPtr<CGImageRef> windowSnapshotImage = adoptCF(CGWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, windowID, kCGWindowImageBoundsIgnoreFraming | kCGWindowImageShouldBeOpaque));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to