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

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:04:14 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 8472529083adbf9668fd9128217c4f9c941d4bcb
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 22 20:33:03 2003 +0000

    WebCore:
    
            Reviewed by Dave.
    
    	Finished exception blocking changes, so now I can finally say:
    
    	- fixed 3137084 - Many non-reproducible crashers in ContextImp::mark / ScopeChain::mark
    	- fixed 3308848 - nil-deref in KHTMLView::topLevelWidget
    	- fixed 3311511 - nil deref inside KJS::Screen
    	- fixed 3397422 - 7B51: Safari crashed in KJS::ObjectImp::mark()
    	- fixed 3408373 - Panther7B58 : Safari Crashed in KJS::ObjectImp::mark
    	- fixed 3409307 - 7B55: safari crashed in KJS::Interpreter::globalExec() (idle, nothing particular going on)
    	- fixed 3410160 - 7B60 Safari crashed in KHTMLPart::parentPart called from JS while in the background
    	- fixed 3413224 - unrepro crash in KJS::Window::mark
    	- fixed 3419940 - unrepro crash in KJS::Collector::allocate trying to access http://www.lindyinthepalms.com
    	- fixed 3420123 - Panther7B66: Safari crashed while going to http://www.tangents.co.uk/index2.html
    	- fixed 3423225 - Safari crash in vtable for KWQMapImpl (vtable for KWQMapImpl + 8).
    	- fixed 3437190 - nil-deref on quit in calling marked() from ScopeChain::mark()
    
            * WebCore.pbproj/project.pbxproj:
            * kwq/KWQFontMetrics.mm:
            * kwq/KWQPainter.mm:
            (QPainter::drawPixmap):
            (QPainter::drawTiledPixmap):
            (QPainter::_updateRenderer):
            * kwq/WebCoreTextRenderer.h:
    
    WebKit:
    
            Reviewed by Dave.
    
    	Finished exception blocking changes, so now I can finally say:
    
    	- fixed 3137084 - Many non-reproducible crashers in ContextImp::mark / ScopeChain::mark
    	- fixed 3308848 - nil-deref in KHTMLView::topLevelWidget
    	- fixed 3311511 - nil deref inside KJS::Screen
    	- fixed 3397422 - 7B51: Safari crashed in KJS::ObjectImp::mark()
    	- fixed 3408373 - Panther7B58 : Safari Crashed in KJS::ObjectImp::mark
    	- fixed 3409307 - 7B55: safari crashed in KJS::Interpreter::globalExec() (idle, nothing particular going on)
    	- fixed 3410160 - 7B60 Safari crashed in KHTMLPart::parentPart called from JS while in the background
    	- fixed 3413224 - unrepro crash in KJS::Window::mark
    	- fixed 3419940 - unrepro crash in KJS::Collector::allocate trying to access http://www.lindyinthepalms.com
    	- fixed 3420123 - Panther7B66: Safari crashed while going to http://www.tangents.co.uk/index2.html
    	- fixed 3423225 - Safari crash in vtable for KWQMapImpl (vtable for KWQMapImpl + 8).
    	- fixed 3437190 - nil-deref on quit in calling marked() from ScopeChain::mark()
    
            * WebCoreSupport.subproj/WebTextRenderer.m:
            (-[WebTextRenderer ascent]):
            (-[WebTextRenderer descent]):
            (-[WebTextRenderer lineSpacing]):
            (-[WebTextRenderer xHeight]):
            (-[WebTextRenderer drawLineForCharacters:yOffset:withWidth:withColor:]):
            (-[WebTextRenderer _smallCapsRenderer]):
            (-[WebTextRenderer _initializeATSUStyle]):
            (-[WebTextRenderer _createATSUTextLayoutForRun:]):
            (-[WebTextRenderer _trapezoidForRun:style:atPoint:]):
            (-[WebTextRenderer _ATSU_drawHighlightForRun:style:atPoint:]):
            (-[WebTextRenderer _ATSU_drawRun:style:atPoint:]):
            (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5238 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 286585f..de85d86 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,30 @@
+2003-10-21  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Dave.
+
+	Finished exception blocking changes, so now I can finally say:
+
+	- fixed 3137084 - Many non-reproducible crashers in ContextImp::mark / ScopeChain::mark
+	- fixed 3308848 - nil-deref in KHTMLView::topLevelWidget
+	- fixed 3311511 - nil deref inside KJS::Screen
+	- fixed 3397422 - 7B51: Safari crashed in KJS::ObjectImp::mark()
+	- fixed 3408373 - Panther7B58 : Safari Crashed in KJS::ObjectImp::mark
+	- fixed 3409307 - 7B55: safari crashed in KJS::Interpreter::globalExec() (idle, nothing particular going on)
+	- fixed 3410160 - 7B60 Safari crashed in KHTMLPart::parentPart called from JS while in the background
+	- fixed 3413224 - unrepro crash in KJS::Window::mark
+	- fixed 3419940 - unrepro crash in KJS::Collector::allocate trying to access http://www.lindyinthepalms.com
+	- fixed 3420123 - Panther7B66: Safari crashed while going to http://www.tangents.co.uk/index2.html
+	- fixed 3423225 - Safari crash in vtable for KWQMapImpl (vtable for KWQMapImpl + 8).
+	- fixed 3437190 - nil-deref on quit in calling marked() from ScopeChain::mark()
+
+        * WebCore.pbproj/project.pbxproj:
+        * kwq/KWQFontMetrics.mm:
+        * kwq/KWQPainter.mm:
+        (QPainter::drawPixmap):
+        (QPainter::drawTiledPixmap):
+        (QPainter::_updateRenderer):
+        * kwq/WebCoreTextRenderer.h:
+
 2003-10-21  David Hyatt  <hyatt at apple.com>
 
 	http://placenamehere.com/safari/fixedbgtest.html is now fixed with a patch from the KHTML trunk.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 286585f..de85d86 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,30 @@
+2003-10-21  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Dave.
+
+	Finished exception blocking changes, so now I can finally say:
+
+	- fixed 3137084 - Many non-reproducible crashers in ContextImp::mark / ScopeChain::mark
+	- fixed 3308848 - nil-deref in KHTMLView::topLevelWidget
+	- fixed 3311511 - nil deref inside KJS::Screen
+	- fixed 3397422 - 7B51: Safari crashed in KJS::ObjectImp::mark()
+	- fixed 3408373 - Panther7B58 : Safari Crashed in KJS::ObjectImp::mark
+	- fixed 3409307 - 7B55: safari crashed in KJS::Interpreter::globalExec() (idle, nothing particular going on)
+	- fixed 3410160 - 7B60 Safari crashed in KHTMLPart::parentPart called from JS while in the background
+	- fixed 3413224 - unrepro crash in KJS::Window::mark
+	- fixed 3419940 - unrepro crash in KJS::Collector::allocate trying to access http://www.lindyinthepalms.com
+	- fixed 3420123 - Panther7B66: Safari crashed while going to http://www.tangents.co.uk/index2.html
+	- fixed 3423225 - Safari crash in vtable for KWQMapImpl (vtable for KWQMapImpl + 8).
+	- fixed 3437190 - nil-deref on quit in calling marked() from ScopeChain::mark()
+
+        * WebCore.pbproj/project.pbxproj:
+        * kwq/KWQFontMetrics.mm:
+        * kwq/KWQPainter.mm:
+        (QPainter::drawPixmap):
+        (QPainter::drawTiledPixmap):
+        (QPainter::_updateRenderer):
+        * kwq/WebCoreTextRenderer.h:
+
 2003-10-21  David Hyatt  <hyatt at apple.com>
 
 	http://placenamehere.com/safari/fixedbgtest.html is now fixed with a patch from the KHTML trunk.
diff --git a/WebCore/WebCore.pbproj/project.pbxproj b/WebCore/WebCore.pbproj/project.pbxproj
index fb96b9d..6bf4e3e 100644
--- a/WebCore/WebCore.pbproj/project.pbxproj
+++ b/WebCore/WebCore.pbproj/project.pbxproj
@@ -1021,6 +1021,8 @@
 			fileRef = 65A640F00533BB1F0085E777;
 			isa = PBXBuildFile;
 			settings = {
+				ATTRIBUTES = (
+				);
 			};
 		};
 //650
diff --git a/WebCore/kwq/KWQFontMetrics.mm b/WebCore/kwq/KWQFontMetrics.mm
index 201911b..530b968 100644
--- a/WebCore/kwq/KWQFontMetrics.mm
+++ b/WebCore/kwq/KWQFontMetrics.mm
@@ -33,6 +33,10 @@
 #import "WebCoreTextRenderer.h"
 #import "WebCoreTextRendererFactory.h"
 
+// We know that none of the ObjC calls here will raise exceptions
+// because they are all calls to WebCoreTextRenderer, which has a
+// contract of not raising.
+
 struct QFontMetricsPrivate
 {
     QFontMetricsPrivate(const QFont &font)
diff --git a/WebCore/kwq/KWQPainter.mm b/WebCore/kwq/KWQPainter.mm
index beba3b9..2111065 100644
--- a/WebCore/kwq/KWQPainter.mm
+++ b/WebCore/kwq/KWQPainter.mm
@@ -24,20 +24,24 @@
  */
 
 #import "KWQPainter.h"
-#import "KWQWidget.h"
+
+#import "KWQAssertions.h"
+#import "KWQExceptions.h"
 #import "KWQFontMetrics.h"
+#import "KWQPaintDevice.h"
 #import "KWQPixmap.h"
-#import "KWQPtrStack.h"
 #import "KWQPointArray.h"
-#import "KWQPaintDevice.h"
 #import "KWQPrinter.h"
-
-#import "KWQAssertions.h"
-
+#import "KWQPtrStack.h"
+#import "KWQWidget.h"
 #import "WebCoreImageRenderer.h"
 #import "WebCoreTextRenderer.h"
 #import "WebCoreTextRendererFactory.h"
 
+// NSColor, NSBezierPath, NSGraphicsContext and WebCoreTextRenderer
+// calls in this file are all exception-safe, so we don't block
+// exceptions for those.
+
 struct QPState {
     QPState() : paintingDisabled(false) { }
     QFont font;
@@ -428,16 +432,21 @@ void QPainter::drawPixmap(const QPoint &p, const QPixmap &pix, const QRect &r)
 void QPainter::drawPixmap( int x, int y, const QPixmap &pixmap,
                            int sx, int sy, int sw, int sh )
 {
+    volatile int _sw = sw;
+    volatile int _sh = sh;
+
     if (data->state.paintingDisabled)
         return;
         
-    if (sw == -1)
-        sw = pixmap.width();
-    if (sh == -1)
-        sh = pixmap.height();
+    if (_sw == -1)
+        _sw = pixmap.width();
+    if (_sh == -1)
+        _sh = pixmap.height();
     
-    [pixmap.imageRenderer beginAnimationInRect:NSMakeRect(x, y, sw, sh)
-                                      fromRect:NSMakeRect(sx, sy, sw, sh)];
+    KWQ_BLOCK_NS_EXCEPTIONS;
+    [pixmap.imageRenderer beginAnimationInRect:NSMakeRect(x, y, _sw, _sh)
+                                      fromRect:NSMakeRect(sx, sy, _sw, _sh)];
+    KWQ_UNBLOCK_NS_EXCEPTIONS;
 }
 
 void QPainter::drawTiledPixmap( int x, int y, int w, int h,
@@ -446,7 +455,9 @@ void QPainter::drawTiledPixmap( int x, int y, int w, int h,
     if (data->state.paintingDisabled)
         return;
     
+    KWQ_BLOCK_NS_EXCEPTIONS;
     [pixmap.imageRenderer tileInRect:NSMakeRect(x, y, w, h) fromPoint:NSMakePoint(sx, sy)];
+    KWQ_UNBLOCK_NS_EXCEPTIONS;
 }
 
 void QPainter::_updateRenderer(NSString **families)
@@ -454,10 +465,12 @@ void QPainter::_updateRenderer(NSString **families)
     if (data->textRenderer == 0 || data->state.font != data->textRendererFont) {
         data->textRendererFont = data->state.font;
         id <WebCoreTextRenderer> oldRenderer = data->textRenderer;
+	KWQ_BLOCK_NS_EXCEPTIONS;
         data->textRenderer = [[[WebCoreTextRendererFactory sharedFactory]
             rendererWithFont:data->textRendererFont.getNSFont()
             usingPrinterFont:data->textRendererFont.isPrinterFont()] retain];
         [oldRenderer release];
+	KWQ_UNBLOCK_NS_EXCEPTIONS;
     }
 }
     
diff --git a/WebCore/kwq/WebCoreTextRenderer.h b/WebCore/kwq/WebCoreTextRenderer.h
index ac01d5c..562c78e 100644
--- a/WebCore/kwq/WebCoreTextRenderer.h
+++ b/WebCore/kwq/WebCoreTextRenderer.h
@@ -69,6 +69,12 @@ extern void WebCoreInitializeEmptyTextStyle(WebCoreTextStyle *style);
 
 @protocol WebCoreTextRenderer <NSObject>
 
+// WebCoreTestRenderer must guarantee that no calls to any of these
+// methods will raise any ObjC exceptions. It's too expensive to do
+// blocking for all of them at the WebCore level, and some
+// implementations may be able to guarantee no exceptions without the
+// use of NS_DURING.
+
 // vertical metrics
 - (int)ascent;
 - (int)descent;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 9762db8..7085e8d 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,36 @@
+2003-10-21  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Dave.
+
+	Finished exception blocking changes, so now I can finally say:
+
+	- fixed 3137084 - Many non-reproducible crashers in ContextImp::mark / ScopeChain::mark
+	- fixed 3308848 - nil-deref in KHTMLView::topLevelWidget
+	- fixed 3311511 - nil deref inside KJS::Screen
+	- fixed 3397422 - 7B51: Safari crashed in KJS::ObjectImp::mark()
+	- fixed 3408373 - Panther7B58 : Safari Crashed in KJS::ObjectImp::mark
+	- fixed 3409307 - 7B55: safari crashed in KJS::Interpreter::globalExec() (idle, nothing particular going on)
+	- fixed 3410160 - 7B60 Safari crashed in KHTMLPart::parentPart called from JS while in the background
+	- fixed 3413224 - unrepro crash in KJS::Window::mark
+	- fixed 3419940 - unrepro crash in KJS::Collector::allocate trying to access http://www.lindyinthepalms.com
+	- fixed 3420123 - Panther7B66: Safari crashed while going to http://www.tangents.co.uk/index2.html
+	- fixed 3423225 - Safari crash in vtable for KWQMapImpl (vtable for KWQMapImpl + 8).
+	- fixed 3437190 - nil-deref on quit in calling marked() from ScopeChain::mark()
+
+        * WebCoreSupport.subproj/WebTextRenderer.m:
+        (-[WebTextRenderer ascent]):
+        (-[WebTextRenderer descent]):
+        (-[WebTextRenderer lineSpacing]):
+        (-[WebTextRenderer xHeight]):
+        (-[WebTextRenderer drawLineForCharacters:yOffset:withWidth:withColor:]):
+        (-[WebTextRenderer _smallCapsRenderer]):
+        (-[WebTextRenderer _initializeATSUStyle]):
+        (-[WebTextRenderer _createATSUTextLayoutForRun:]):
+        (-[WebTextRenderer _trapezoidForRun:style:atPoint:]):
+        (-[WebTextRenderer _ATSU_drawHighlightForRun:style:atPoint:]):
+        (-[WebTextRenderer _ATSU_drawRun:style:atPoint:]):
+        (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:]):
+
 2003-10-22  Richard Williamson   <rjw at apple.com>
 
 	Fixed 3458715.  Reset to 0, not .1 when done.
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
index 8a93466..fb94cd3 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
@@ -463,21 +463,27 @@ static BOOL alwaysUseATSU = NO;
 
 - (int)ascent
 {
+    // This simple return obviously can't throw an exception.
     return ascent;
 }
 
 - (int)descent
 {
+    // This simple return obviously can't throw an exception.
     return descent;
 }
 
 - (int)lineSpacing
 {
+    // This simple return obviously can't throw an exception.
     return lineSpacing;
 }
 
 - (float)xHeight
 {
+    // The concrete implementation of xHeight in NSCGSFont will definitely not
+    // throw an exception, it's all just math.
+
     return [font xHeight];
 }
 
@@ -504,6 +510,8 @@ static BOOL alwaysUseATSU = NO;
 
 - (void)drawLineForCharacters:(NSPoint)point yOffset:(float)yOffset withWidth: (int)width withColor:(NSColor *)color
 {
+    // XXX MJS
+
     NSGraphicsContext *graphicsContext = [NSGraphicsContext currentContext];
     CGContextRef cgContext;
     float lineWidth;
@@ -585,7 +593,16 @@ static BOOL alwaysUseATSU = NO;
 - (WebTextRenderer *)_smallCapsRenderer
 {
     if (!smallCapsRenderer) {
-        smallCapsRenderer = [[WebTextRenderer alloc] initWithFont:font usingPrinterFont:usingPrinterFont];
+	NS_DURING
+	    smallCapsRenderer = [[WebTextRenderer alloc] initWithFont:font usingPrinterFont:usingPrinterFont];
+	NS_HANDLER
+	    if (ASSERT_DISABLED) {
+		NSLog(@"Uncaught exception - %@\n", localException);
+	    } else {
+		ASSERT_WITH_MESSAGE(0, "Uncaught exception - %@", localException);
+	    } 
+	NS_ENDHANDLER
+
         [smallCapsRenderer _setIsSmallCapsRenderer:YES];
     }
     return smallCapsRenderer;
@@ -1330,6 +1347,9 @@ static const char *joiningNames[] = {
 
 - (void)_initializeATSUStyle
 {
+    // The two NSFont calls in this method (pointSize and _atsFontID)
+    // are both exception-safe.
+
     if (!ATSUStyleInitialized){
         OSStatus status;
         
@@ -1358,6 +1378,9 @@ static const char *joiningNames[] = {
 
 - (ATSUTextLayout)_createATSUTextLayoutForRun:(const WebCoreTextRun *)run
 {
+    // The only Cocoa calls here are to NSGraphicsContext and the self
+    // call to _initializeATSUStyle, which are all exception-safe.
+
     ATSUTextLayout layout;
     UniCharCount runLength;
     OSStatus status;
@@ -1397,6 +1420,9 @@ static const char *joiningNames[] = {
 
 - (ATSTrapezoid)_trapezoidForRun:(const WebCoreTextRun *)run style:(const WebCoreTextStyle *)style atPoint:(NSPoint )p
 {
+    // The only Cocoa call here is the self call to
+    // _createATSUTextLayoutForRun:, which is exception-safe.
+
     ATSUTextLayout layout;
     OSStatus status;
     
@@ -1438,6 +1464,10 @@ static const char *joiningNames[] = {
 
 - (void)_ATSU_drawHighlightForRun:(const WebCoreTextRun *)run style:(const WebCoreTextStyle *)style atPoint:(NSPoint)point
 {
+    // The only Cocoa calls made here are to NSColor and NSBezierPath,
+    // plus the self calls to _createATSUTextLayoutForRun: and
+    // _trapezoidForRun:. These are all exception-safe.
+
     ATSUTextLayout layout;
     int from = run->from;
     int to = run->to;
@@ -1497,6 +1527,10 @@ static const char *joiningNames[] = {
 
 - (void)_ATSU_drawRun:(const WebCoreTextRun *)run style:(const WebCoreTextStyle *)style atPoint:(NSPoint)point
 {
+    // The only Cocoa calls made here are to NSColor, plus the self
+    // calls to _createATSUTextLayoutForRun: and
+    // _ATSU_drawHighlightForRun:. These are all exception-safe.
+
     ATSUTextLayout layout;
     OSStatus status;
     int from = run->from;
@@ -1533,6 +1567,9 @@ static const char *joiningNames[] = {
 
 - (int)_ATSU_pointToOffset:(const WebCoreTextRun *)run style:(const WebCoreTextStyle *)style position:(int)x reversed:(BOOL)reversed
 {
+    // The only Cocoa calls made here is to the self call to
+    // _createATSUTextLayoutForRun:. This is exception-safe.
+
     unsigned offset = 0;
     ATSUTextLayout layout;
     UniCharArrayOffset primaryOffset = 0;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list