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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:23:47 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit f7bcc66f6be70a83b399d538a7c23c03c5651279
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jul 11 04:59:02 2002 +0000

    	- fixed 2983025 -- crash in sendEvent on pages with flash playing
    
            * Plugins.subproj/IFPluginView.mm:
            (-[IFPluginView removeTrackingRect]): New, removes tracking rect and releases window.
            (-[IFPluginView resetTrackingRect]): New, adds tracking rect and retains window.
            (-[IFPluginView start]): Use resetTrackingRect.
            (-[IFPluginView stop]): Use removeTrackingRect.
            (-[IFPluginView viewWillMoveToWindow:]): Call removeTrackingRect because the window
    	will change by the time we get to viewDidMoveToWindow.
            (-[IFPluginView viewDidMoveToWindow]): Call resetTrackingRect.
            (-[IFPluginView viewHasMoved:]): Call resetTrackingRect.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1530 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index d6542d6..e00688d 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,19 @@
 2002-07-10  Darin Adler  <darin at apple.com>
 
+	- fixed 2983025 -- crash in sendEvent on pages with flash playing
+
+        * Plugins.subproj/IFPluginView.mm:
+        (-[IFPluginView removeTrackingRect]): New, removes tracking rect and releases window.
+        (-[IFPluginView resetTrackingRect]): New, adds tracking rect and retains window.
+        (-[IFPluginView start]): Use resetTrackingRect.
+        (-[IFPluginView stop]): Use removeTrackingRect.
+        (-[IFPluginView viewWillMoveToWindow:]): Call removeTrackingRect because the window
+	will change by the time we get to viewDidMoveToWindow.
+        (-[IFPluginView viewDidMoveToWindow]): Call resetTrackingRect.
+        (-[IFPluginView viewHasMoved:]): Call resetTrackingRect.
+
+2002-07-10  Darin Adler  <darin at apple.com>
+
         * WebView.subproj/IFWebViewPrivate.mm:
         (-[IFWebView _scrollToBottomLeft]): Fix this to use the document view to define what
 	the bottom left is, not the content view (which is often much smaller than the document).
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index d6542d6..e00688d 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,19 @@
 2002-07-10  Darin Adler  <darin at apple.com>
 
+	- fixed 2983025 -- crash in sendEvent on pages with flash playing
+
+        * Plugins.subproj/IFPluginView.mm:
+        (-[IFPluginView removeTrackingRect]): New, removes tracking rect and releases window.
+        (-[IFPluginView resetTrackingRect]): New, adds tracking rect and retains window.
+        (-[IFPluginView start]): Use resetTrackingRect.
+        (-[IFPluginView stop]): Use removeTrackingRect.
+        (-[IFPluginView viewWillMoveToWindow:]): Call removeTrackingRect because the window
+	will change by the time we get to viewDidMoveToWindow.
+        (-[IFPluginView viewDidMoveToWindow]): Call resetTrackingRect.
+        (-[IFPluginView viewHasMoved:]): Call resetTrackingRect.
+
+2002-07-10  Darin Adler  <darin at apple.com>
+
         * WebView.subproj/IFWebViewPrivate.mm:
         (-[IFWebView _scrollToBottomLeft]): Fix this to use the document view to define what
 	the bottom left is, not the content view (which is often much smaller than the document).
diff --git a/WebKit/Plugins.subproj/IFPluginView.mm b/WebKit/Plugins.subproj/IFPluginView.mm
index 90ea77a..66366e6 100644
--- a/WebKit/Plugins.subproj/IFPluginView.mm
+++ b/WebKit/Plugins.subproj/IFPluginView.mm
@@ -416,6 +416,26 @@ static char *newCString(NSString *string)
 #endif
 }
 
+- (void)removeTrackingRect
+{
+    if (trackingTag) {
+        [self removeTrackingRect:trackingTag];
+        // Must release the window to balance the retain in resetTrackingRect.
+        [[self window] release];
+        trackingTag = 0;
+    }
+}
+
+- (void)resetTrackingRect
+{
+    [self removeTrackingRect];
+    if (isStarted) {
+        // Must retain the window so that removeTrackingRect can work after the window is closed.
+        [[self window] retain];
+        trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO];
+    }
+}
+
 -(void)start
 {
     NSNotificationCenter *notificationCenter;
@@ -472,17 +492,17 @@ static char *newCString(NSString *string)
     
     eventSender = [[IFPluginNullEventSender alloc] initializeWithNPP:instance functionPointer:NPP_HandleEvent window:theWindow];
     [eventSender sendNullEvents];
-    trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO];
+    [self resetTrackingRect];
 }
 
 - (void)stop
 {
+    [self removeTrackingRect];
+    
     if (!isStarted)
         return;
     isStarted = NO;
 
-    [self removeTrackingRect:trackingTag];
-    
     // Stop any active streams
     [streams makeObjectsPerformSelector:@selector(stop)];
     
@@ -604,10 +624,19 @@ static char *newCString(NSString *string)
     return YES;
 }
 
+- (void)viewWillMoveToWindow:(NSWindow *)newWindow
+{
+    // We must remove the tracking rect before we move to the new window.
+    // Once we move to the new window, it will be too late.
+    [self removeTrackingRect];
+    [super viewWillMoveToWindow:newWindow];
+}
+
 - (void)viewDidMoveToWindow
 {
     if (![self window])
         [self stop];
+    [self resetTrackingRect];
     [super viewDidMoveToWindow];
 }
 
@@ -618,8 +647,7 @@ static char *newCString(NSString *string)
     [self setUpWindowAndPort];
 
     // reset the tracking rect
-    [self removeTrackingRect:trackingTag];
-    trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO];
+    [self resetTrackingRect];
 }
 
 -(void) windowBecameKey:(NSNotification *)notification
diff --git a/WebKit/Plugins.subproj/WebPluginView.m b/WebKit/Plugins.subproj/WebPluginView.m
index 90ea77a..66366e6 100644
--- a/WebKit/Plugins.subproj/WebPluginView.m
+++ b/WebKit/Plugins.subproj/WebPluginView.m
@@ -416,6 +416,26 @@ static char *newCString(NSString *string)
 #endif
 }
 
+- (void)removeTrackingRect
+{
+    if (trackingTag) {
+        [self removeTrackingRect:trackingTag];
+        // Must release the window to balance the retain in resetTrackingRect.
+        [[self window] release];
+        trackingTag = 0;
+    }
+}
+
+- (void)resetTrackingRect
+{
+    [self removeTrackingRect];
+    if (isStarted) {
+        // Must retain the window so that removeTrackingRect can work after the window is closed.
+        [[self window] retain];
+        trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO];
+    }
+}
+
 -(void)start
 {
     NSNotificationCenter *notificationCenter;
@@ -472,17 +492,17 @@ static char *newCString(NSString *string)
     
     eventSender = [[IFPluginNullEventSender alloc] initializeWithNPP:instance functionPointer:NPP_HandleEvent window:theWindow];
     [eventSender sendNullEvents];
-    trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO];
+    [self resetTrackingRect];
 }
 
 - (void)stop
 {
+    [self removeTrackingRect];
+    
     if (!isStarted)
         return;
     isStarted = NO;
 
-    [self removeTrackingRect:trackingTag];
-    
     // Stop any active streams
     [streams makeObjectsPerformSelector:@selector(stop)];
     
@@ -604,10 +624,19 @@ static char *newCString(NSString *string)
     return YES;
 }
 
+- (void)viewWillMoveToWindow:(NSWindow *)newWindow
+{
+    // We must remove the tracking rect before we move to the new window.
+    // Once we move to the new window, it will be too late.
+    [self removeTrackingRect];
+    [super viewWillMoveToWindow:newWindow];
+}
+
 - (void)viewDidMoveToWindow
 {
     if (![self window])
         [self stop];
+    [self resetTrackingRect];
     [super viewDidMoveToWindow];
 }
 
@@ -618,8 +647,7 @@ static char *newCString(NSString *string)
     [self setUpWindowAndPort];
 
     // reset the tracking rect
-    [self removeTrackingRect:trackingTag];
-    trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO];
+    [self resetTrackingRect];
 }
 
 -(void) windowBecameKey:(NSNotification *)notification

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list