[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 07:39:09 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 52d218acaab31d9e9cf5439b50d1edeb4df46c37
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Apr 29 17:02:44 2003 +0000

            Reviewed by Ken.
    
    	- fixed 3242460 -- crash in NSPopUpButtonCell at acheter-moins-cher.com
    
            * kwq/KWQComboBox.mm: (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
            Defer QObject timers too as well as loading while tracking a pop-up.
    
            * kwq/KWQObject.h: Add defersTimers and setDefersTimers functions.
            * kwq/KWQObject.mm:
            (QObject::setDefersTimers): Added. When called with true starts deferring timers. When called
            with false schedules a "delay 0" task to deliver all the timers and stop deferring them.
            (-[KWQObjectTimerTarget sendTimerEvent]): Added. Contains guts of the old timerFired method.
            (-[KWQObjectTimerTarget timerFired]): Puts timer on the deferred timers list or calls sendTimerEvent.
            (+[KWQObjectTimerTarget stopDeferringTimers]): Remove timers items from the deferred timers list,
            and makes them fire, then stops deferring timers.
    
            * WebCore.pbproj/project.pbxproj: Reorder things a bit.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4205 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 98381f6..6d00abd 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -2,6 +2,26 @@
 
         Reviewed by Ken.
 
+	- fixed 3242460 -- crash in NSPopUpButtonCell at acheter-moins-cher.com
+
+        * kwq/KWQComboBox.mm: (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
+        Defer QObject timers too as well as loading while tracking a pop-up.
+        
+        * kwq/KWQObject.h: Add defersTimers and setDefersTimers functions.
+        * kwq/KWQObject.mm:
+        (QObject::setDefersTimers): Added. When called with true starts deferring timers. When called
+        with false schedules a "delay 0" task to deliver all the timers and stop deferring them.
+        (-[KWQObjectTimerTarget sendTimerEvent]): Added. Contains guts of the old timerFired method.
+        (-[KWQObjectTimerTarget timerFired]): Puts timer on the deferred timers list or calls sendTimerEvent.
+        (+[KWQObjectTimerTarget stopDeferringTimers]): Remove timers items from the deferred timers list,
+        and makes them fire, then stops deferring timers.
+
+        * WebCore.pbproj/project.pbxproj: Reorder things a bit.
+
+2003-04-29  Darin Adler  <darin at apple.com>
+
+        Reviewed by Ken.
+
 	- fixed 3230885 -- crash loading hixie test page in -[WebSubresourceClient connection:didReceiveData:]
 
         * khtml/rendering/render_style.cpp: (RenderStyle::setContent):
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 98381f6..6d00abd 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -2,6 +2,26 @@
 
         Reviewed by Ken.
 
+	- fixed 3242460 -- crash in NSPopUpButtonCell at acheter-moins-cher.com
+
+        * kwq/KWQComboBox.mm: (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
+        Defer QObject timers too as well as loading while tracking a pop-up.
+        
+        * kwq/KWQObject.h: Add defersTimers and setDefersTimers functions.
+        * kwq/KWQObject.mm:
+        (QObject::setDefersTimers): Added. When called with true starts deferring timers. When called
+        with false schedules a "delay 0" task to deliver all the timers and stop deferring them.
+        (-[KWQObjectTimerTarget sendTimerEvent]): Added. Contains guts of the old timerFired method.
+        (-[KWQObjectTimerTarget timerFired]): Puts timer on the deferred timers list or calls sendTimerEvent.
+        (+[KWQObjectTimerTarget stopDeferringTimers]): Remove timers items from the deferred timers list,
+        and makes them fire, then stops deferring timers.
+
+        * WebCore.pbproj/project.pbxproj: Reorder things a bit.
+
+2003-04-29  Darin Adler  <darin at apple.com>
+
+        Reviewed by Ken.
+
 	- fixed 3230885 -- crash loading hixie test page in -[WebSubresourceClient connection:didReceiveData:]
 
         * khtml/rendering/render_style.cpp: (RenderStyle::setContent):
diff --git a/WebCore/WebCore.pbproj/project.pbxproj b/WebCore/WebCore.pbproj/project.pbxproj
index f4a04fc..25e8821 100644
--- a/WebCore/WebCore.pbproj/project.pbxproj
+++ b/WebCore/WebCore.pbproj/project.pbxproj
@@ -8060,10 +8060,10 @@
 				F587851A02DE375901EA4122,
 				F587869E02DE3B8601EA4122,
 				F587869F02DE3B8601EA4122,
-				F5117BC902F9FFEF018635CE,
-				F5117BCB02F9FFEF018635CE,
 				F587851D02DE375901EA4122,
+				F5117BC902F9FFEF018635CE,
 				F5117BCA02F9FFEF018635CE,
+				F5117BCB02F9FFEF018635CE,
 				F5117BCC02F9FFEF018635CE,
 				F58786A102DE3B8601EA4122,
 				F58786A202DE3B8601EA4122,
diff --git a/WebCore/kwq/KWQComboBox.mm b/WebCore/kwq/KWQComboBox.mm
index 740f959..9e5c6ea 100644
--- a/WebCore/kwq/KWQComboBox.mm
+++ b/WebCore/kwq/KWQComboBox.mm
@@ -215,18 +215,25 @@ int QComboBox::currentItem() const
 
 - (BOOL)trackMouse:(NSEvent *)event inRect:(NSRect)rect ofView:(NSView *)view untilMouseUp:(BOOL)flag
 {
-    // We need to "defer loading" while we are tracking the menu.
+    // We need to "defer loading" and defer timers while we are tracking the menu.
     // That's because we don't want the new page to load while the user is holding the mouse down.
     // Normally, this is not a problem because we use a different run loop mode, but pop-up menus
     // use a Carbon implementation, and it uses the default run loop mode.
-    // See bug 3021018 for more information.
+    // See bugs 3021018 and 3242460 for some more information.
     
     WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
     BOOL wasDeferringLoading = [bridge defersLoading];
     if (!wasDeferringLoading) {
         [bridge setDefersLoading:YES];
     }
+    BOOL wasDeferringTimers = QObject::defersTimers();
+    if (!wasDeferringTimers) {
+        QObject::setDefersTimers(true);
+    }
     BOOL result = [super trackMouse:event inRect:rect ofView:view untilMouseUp:flag];
+    if (!wasDeferringTimers) {
+        QObject::setDefersTimers(false);
+    }
     if (!wasDeferringLoading) {
         [bridge setDefersLoading:NO];
     }
diff --git a/WebCore/kwq/KWQObject.h b/WebCore/kwq/KWQObject.h
index 08009c9..ff64dcc 100644
--- a/WebCore/kwq/KWQObject.h
+++ b/WebCore/kwq/KWQObject.h
@@ -105,6 +105,9 @@ public:
     virtual bool event(QEvent *);
 
     static const QObject *sender() { return _sender; }
+    
+    static bool defersTimers() { return _defersTimers; }
+    static void setDefersTimers(bool defers);
 
 private:
     void _addTimer(NSTimer *timer, int _timerId);
@@ -125,6 +128,8 @@ private:
     
     const QObject *_eventFilterObject;
     
+    static bool _defersTimers;
+
     friend class KWQGuardedPtrBase;
     friend class KWQSignal;
     friend class KWQObjectSenderScope;
diff --git a/WebCore/kwq/KWQObject.mm b/WebCore/kwq/KWQObject.mm
index 88e4bfd..09560c4 100644
--- a/WebCore/kwq/KWQObject.mm
+++ b/WebCore/kwq/KWQObject.mm
@@ -29,9 +29,12 @@
 #import "KWQAssertions.h"
 
 const QObject *QObject::_sender;
+bool QObject::_defersTimers;
 
 static CFMutableDictionaryRef timerDictionaries;
 static CFMutableDictionaryRef allPausedTimers;
+static NSMutableArray *deferredTimers;
+static bool deferringTimers;
 
 @interface KWQObjectTimerTarget : NSObject
 {
@@ -278,6 +281,23 @@ void QObject::killTimers()
     CFDictionaryRemoveValue(timerDictionaries, this);
 }
 
+void QObject::setDefersTimers(bool defers)
+{
+    if (defers) {
+        _defersTimers = true;
+        deferringTimers = true;
+        [NSObject cancelPreviousPerformRequestsWithTarget:[KWQObjectTimerTarget class]];
+        return;
+    }
+    
+    if (_defersTimers) {
+        _defersTimers = false;
+        if (deferringTimers) {
+            [KWQObjectTimerTarget performSelector:@selector(stopDeferringTimers) withObject:nil afterDelay:0];
+        }
+    }
+}
+
 @implementation KWQObjectTimerTarget
 
 - initWithQObject:(QObject *)qo timerId:(int)t
@@ -288,12 +308,34 @@ void QObject::killTimers()
     return self;
 }
 
-- (void)timerFired
+- (void)sendTimerEvent
 {
     QTimerEvent event(timerId);
     target->timerEvent(&event);
 }
 
+- (void)timerFired
+{
+    if (deferringTimers) {
+        if (deferredTimers == nil) {
+            deferredTimers = [[NSMutableArray alloc] init];
+        }
+        [deferredTimers addObject:self];
+    } else {
+        [self sendTimerEvent];
+    }
+}
+
++ (void)stopDeferringTimers
+{
+    ASSERT(deferringTimers);
+    while ([deferredTimers count] != 0) {
+        [[deferredTimers objectAtIndex:0] sendTimerEvent];
+        [deferredTimers removeObjectAtIndex:0];
+    }
+    deferringTimers = false;
+}
+
 @end
 
 // special includes only for inherits

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list