[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:56:04 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 3476e81d4a041ccbd7d8ede6060b7a99f52d4ef7
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 12 22:48:49 2003 +0000

    	Fixed: <rdar://problem/3420112>: Reproducible Safari crash in in -[WebBaseNetscapePluginView sendEvent:]
    
            Reviewed by darin.
    
            * Plugins.subproj/WebBaseNetscapePluginView.m:
            (-[WebBaseNetscapePluginView sendEvent:]): temporarily retain self in case the plug-in view is released while sending an event.
            (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:targetFrame:]): don't deliver the return value of the JS evaluation if stringByEvaluatingJavaScriptFromString caused the plug-in to stop.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4976 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 1f0e637..ce916a8 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,13 @@
+2003-09-12  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed: <rdar://problem/3420112>: Reproducible Safari crash in in -[WebBaseNetscapePluginView sendEvent:]
+
+        Reviewed by darin.
+
+        * Plugins.subproj/WebBaseNetscapePluginView.m:
+        (-[WebBaseNetscapePluginView sendEvent:]): temporarily retain self in case the plug-in view is released while sending an event. 
+        (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:targetFrame:]): don't deliver the return value of the JS evaluation if stringByEvaluatingJavaScriptFromString caused the plug-in to stop.
+
 === WebKit-102 ===
 
 2003-09-11  Maciej Stachowiak  <mjs at apple.com>
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
index 711c256..3955449 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
@@ -325,15 +325,22 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
         ForeColor(blackColor);
     }
 #endif
+    
+    // Temporarily retain self in case the plug-in view is released while sending an event. 
+    [self retain];
 
     BOOL acceptedEvent = NPP_HandleEvent(instance, event);
 
-    [self restorePortState:portState];
+    if ([self currentWindow]) {
+        [self restorePortState:portState];
+    }
 
     if (!defers) {
         [[self webView] setDefersCallbacks:NO];
     }
     
+    [self release];
+    
     return acceptedEvent;
 }
 
@@ -1194,6 +1201,9 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
 
 - (void)evaluateJavaScriptPluginRequest:(WebPluginRequest *)JSPluginRequest targetFrame:(WebFrame *)targetFrame
 {
+    // FIXME: Is this isStarted check needed here? evaluateJavaScriptPluginRequest should not be called
+    // if we are stopped since this method is called after a delay and we call 
+    // cancelPreviousPerformRequestsWithTarget inside of stop.
     if (!isStarted) {
         return;
     }
@@ -1204,6 +1214,12 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
     
     WebFrame *evaluatingFrame = targetFrame ? targetFrame : [self webFrame];
     NSString *result = [[evaluatingFrame _bridge] stringByEvaluatingJavaScriptFromString:JSString];
+    
+    // Don't continue if stringByEvaluatingJavaScriptFromString caused the plug-in to stop.
+    if (!isStarted) {
+        return;
+    }
+    
     void *notifyData = [JSPluginRequest notifyData];
     
     if (targetFrame) {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list