Crashes after 163116 in [WKView takeViewSnapshot]
https://bugs.webkit.org/show_bug.cgi?id=127973

Reviewed by Alexey Proskuryakov.

* UIProcess/API/mac/WKView.mm:
(-[WKView _takeViewSnapshot]):
Make the ViewGestureController before using it, if we need one.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 741b46f..634dc2b 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,14 @@
+2014-01-30  Tim Horton  <timothy_horton@apple.com>
+
+        Crashes after 163116 in [WKView takeViewSnapshot]
+        https://bugs.webkit.org/show_bug.cgi?id=127973
+
+        Reviewed by Alexey Proskuryakov.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _takeViewSnapshot]):
+        Make the ViewGestureController before using it, if we need one.
+
 2014-01-30  Anders Carlsson  <andersca@apple.com>
 
         Add a webView:didCommitNavigation: delegate method
diff --git a/Source/WebKit2/UIProcess/API/mac/WKView.mm b/Source/WebKit2/UIProcess/API/mac/WKView.mm
index aa0bdfb..8a72b5b 100644
--- a/Source/WebKit2/UIProcess/API/mac/WKView.mm
+++ b/Source/WebKit2/UIProcess/API/mac/WKView.mm
@@ -2549,6 +2549,8 @@
     CGSCaptureWindowsContentsToRect(CGSMainConnectionID(), &windowID, 1, CGRectNull, &cgWindowImage);
     RetainPtr<CGImageRef> windowSnapshotImage = adoptCF(cgWindowImage);
 
+    [self _ensureGestureController];
+
     NSRect windowCaptureRect;
     FloatRect boundsForCustomSwipeViews = _data->_gestureController->windowRelativeBoundsForCustomSwipeViews();
     if (!boundsForCustomSwipeViews.isEmpty())