ibtoold crash below -[WebView close]
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Jan 2015 21:40:02 +0000 (21:40 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Jan 2015 21:40:02 +0000 (21:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140782
-and corresponding-
rdar://problem/19558472

Reviewed by Tim Horton.

Retain the NSImmediateActionGestureRecognizer. This should not be necessary, but
Source/WebKit/mac:

it is because interface builder is messing with our views.
* WebView/WebImmediateActionController.h:
* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController webViewClosed]):
(-[WebImmediateActionController _cancelImmediateAction]):
(-[WebImmediateActionController immediateActionRecognizerWillPrepare:]):
(-[WebImmediateActionController _updateImmediateActionItem]):

Source/WebKit2:

it is because interface builder can mess with our views.
* UIProcess/mac/WKImmediateActionController.h:
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController willDestroyView:]):
(-[WKImmediateActionController _cancelImmediateAction]):
(-[WKImmediateActionController _cancelImmediateActionIfNeeded]):
(-[WKImmediateActionController _updateImmediateActionItem]):

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

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebImmediateActionController.h
Source/WebKit/mac/WebView/WebImmediateActionController.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WKImmediateActionController.h
Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm

index d0d52f8..3382978 100644 (file)
@@ -1,3 +1,21 @@
+2015-01-22  Beth Dakin  <bdakin@apple.com>
+
+        ibtoold crash below -[WebView close]
+        https://bugs.webkit.org/show_bug.cgi?id=140782
+        -and corresponding-
+        rdar://problem/19558472
+
+        Reviewed by Tim Horton.
+
+        Retain the NSImmediateActionGestureRecognizer. This should not be necessary, but 
+        it is because interface builder is messing with our views.
+        * WebView/WebImmediateActionController.h:
+        * WebView/WebImmediateActionController.mm:
+        (-[WebImmediateActionController webViewClosed]):
+        (-[WebImmediateActionController _cancelImmediateAction]):
+        (-[WebImmediateActionController immediateActionRecognizerWillPrepare:]):
+        (-[WebImmediateActionController _updateImmediateActionItem]):
+
 2015-01-21  Beth Dakin  <bdakin@apple.com>
 
         Crash in QuickLook preview delegate method
index be7166b..d1688f9 100644 (file)
@@ -38,7 +38,7 @@
     WebView *_webView;
     WebImmediateActionType _type;
     WebCore::HitTestResult _hitTestResult;
-    NSImmediateActionGestureRecognizer *_immediateActionRecognizer;
+    RetainPtr<NSImmediateActionGestureRecognizer> _immediateActionRecognizer;
 
     RetainPtr<DDActionContext> _currentActionContext;
     BOOL _isShowingTextIndicator;
index 4593841..da583f0 100644 (file)
@@ -83,7 +83,7 @@ using namespace WebCore;
 {
     _webView = nil;
 
-    id animationController = _immediateActionRecognizer.animationController;
+    id animationController = [_immediateActionRecognizer animationController];
     if ([animationController isKindOfClass:NSClassFromString(@"QLPreviewMenuItem")]) {
         QLPreviewMenuItem *menuItem = (QLPreviewMenuItem *)animationController;
         menuItem.delegate = nil;
@@ -101,8 +101,8 @@ using namespace WebCore;
 - (void)_cancelImmediateAction
 {
     // Reset the recognizer by turning it off and on again.
-    _immediateActionRecognizer.enabled = NO;
-    _immediateActionRecognizer.enabled = YES;
+    [_immediateActionRecognizer setEnabled:NO];
+    [_immediateActionRecognizer setEnabled:YES];
 
     [self _clearImmediateActionState];
 }
@@ -140,7 +140,7 @@ using namespace WebCore;
     [self performHitTestAtPoint:locationInDocumentView];
     [self _updateImmediateActionItem];
 
-    if (!_immediateActionRecognizer.animationController) {
+    if (![_immediateActionRecognizer animationController]) {
         // FIXME: We should be able to remove the dispatch_async when rdar://problem/19502927 is resolved.
         dispatch_async(dispatch_get_main_queue(), ^{
             [self _cancelImmediateAction];
@@ -241,9 +241,9 @@ using namespace WebCore;
         return;
     }
     if (customClientAnimationController && [customClientAnimationController conformsToProtocol:@protocol(NSImmediateActionAnimationController)])
-        _immediateActionRecognizer.animationController = (id <NSImmediateActionAnimationController>)customClientAnimationController;
+        [_immediateActionRecognizer setAnimationController:(id <NSImmediateActionAnimationController>)customClientAnimationController];
     else
-        _immediateActionRecognizer.animationController = defaultAnimationController;
+        [_immediateActionRecognizer setAnimationController:defaultAnimationController];
 }
 
 #pragma mark QLPreviewMenuItemDelegate implementation
index 1f03ff1..c35e20c 100644 (file)
@@ -1,3 +1,21 @@
+2015-01-22  Beth Dakin  <bdakin@apple.com>
+
+        ibtoold crash below -[WebView close]
+        https://bugs.webkit.org/show_bug.cgi?id=140782
+        -and corresponding-
+        rdar://problem/19558472
+
+        Reviewed by Tim Horton.
+
+        Retain the NSImmediateActionGestureRecognizer. This should not be necessary, but 
+        it is because interface builder can mess with our views.
+        * UIProcess/mac/WKImmediateActionController.h:
+        * UIProcess/mac/WKImmediateActionController.mm:
+        (-[WKImmediateActionController willDestroyView:]):
+        (-[WKImmediateActionController _cancelImmediateAction]):
+        (-[WKImmediateActionController _cancelImmediateActionIfNeeded]):
+        (-[WKImmediateActionController _updateImmediateActionItem]):
+
 2015-01-22  David Kilzer  <ddkilzer@apple.com>
 
         [iOS] Fix iphoneos SDK builds for ios-ews queue
index 212cdb8..1543d67 100644 (file)
@@ -56,7 +56,7 @@ enum class ImmediateActionState {
     WebKit::ActionMenuHitTestResult _hitTestResult;
     RefPtr<API::Object> _userData;
     _WKImmediateActionType _type;
-    NSImmediateActionGestureRecognizer *_immediateActionRecognizer;
+    RetainPtr<NSImmediateActionGestureRecognizer> _immediateActionRecognizer;
 
     BOOL _hasActivatedActionContext;
     RetainPtr<DDActionContext> _currentActionContext;
index 950b529..082bd0c 100644 (file)
@@ -76,7 +76,7 @@ using namespace WebKit;
     _wkView = nil;
     _hitTestResult = ActionMenuHitTestResult();
 
-    id animationController = _immediateActionRecognizer.animationController;
+    id animationController = [_immediateActionRecognizer animationController];
     if ([animationController isKindOfClass:NSClassFromString(@"QLPreviewMenuItem")]) {
         QLPreviewMenuItem *menuItem = (QLPreviewMenuItem *)animationController;
         menuItem.delegate = nil;
@@ -94,15 +94,15 @@ using namespace WebKit;
 - (void)_cancelImmediateAction
 {
     // Reset the recognizer by turning it off and on again.
-    _immediateActionRecognizer.enabled = NO;
-    _immediateActionRecognizer.enabled = YES;
+    [_immediateActionRecognizer setEnabled:NO];
+    [_immediateActionRecognizer setEnabled:YES];
 
     [self _clearImmediateActionState];
 }
 
 - (void)_cancelImmediateActionIfNeeded
 {
-    if (!_immediateActionRecognizer.animationController)
+    if (![_immediateActionRecognizer animationController])
         [self _cancelImmediateAction];
 
     if (_currentActionContext) {
@@ -268,9 +268,9 @@ using namespace WebKit;
         return;
     }
     if (customClientAnimationController && [customClientAnimationController conformsToProtocol:@protocol(NSImmediateActionAnimationController)])
-        _immediateActionRecognizer.animationController = (id <NSImmediateActionAnimationController>)customClientAnimationController;
+        [_immediateActionRecognizer setAnimationController:(id <NSImmediateActionAnimationController>)customClientAnimationController];
     else
-        _immediateActionRecognizer.animationController = defaultAnimationController;
+        [_immediateActionRecognizer setAnimationController:defaultAnimationController];
 }
 
 #pragma mark QLPreviewMenuItemDelegate implementation