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

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:58:33 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 397e318fb37c4628e9990596084784739a44efe9
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Mar 24 17:47:53 2002 +0000

            Fixed big leak in QString assignment operator.
            Updated comments.  Removed old fprintfs.
            Added some frame debugging logs.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@822 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 8c42353..dd5187c 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,17 @@
+2002-03-24  Richard Williamson  <rjw at apple.com>
+
+        Fixed big leak in QString assignment operator.
+        Updated comments.  Removed old fprintfs.
+        Added some frame debugging logs.
+        
+	* src/kwq/KWQFontMetrics.mm: (_rectForString):
+	* src/kwq/KWQKHTMLPart.mm: (KHTMLPart::openURL), (KHTMLPart::requestFrame):
+	* src/kwq/KWQScrollView.mm: (QScrollView::addChild),
+	(QScrollView::resizeContents), (QScrollView::updateContents),
+	(QScrollView::repaintContents):
+	* src/kwq/KWQString.mm: (QString::operator=):
+	* src/kwq/kwqdebug.h:
+
 2002-03-23  Darin Adler  <darin at apple.com>
 
         Fixed problem with extra empty items in menus.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 8c42353..dd5187c 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,17 @@
+2002-03-24  Richard Williamson  <rjw at apple.com>
+
+        Fixed big leak in QString assignment operator.
+        Updated comments.  Removed old fprintfs.
+        Added some frame debugging logs.
+        
+	* src/kwq/KWQFontMetrics.mm: (_rectForString):
+	* src/kwq/KWQKHTMLPart.mm: (KHTMLPart::openURL), (KHTMLPart::requestFrame):
+	* src/kwq/KWQScrollView.mm: (QScrollView::addChild),
+	(QScrollView::resizeContents), (QScrollView::updateContents),
+	(QScrollView::repaintContents):
+	* src/kwq/KWQString.mm: (QString::operator=):
+	* src/kwq/kwqdebug.h:
+
 2002-03-23  Darin Adler  <darin at apple.com>
 
         Fixed problem with extra empty items in menus.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 8c42353..dd5187c 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,17 @@
+2002-03-24  Richard Williamson  <rjw at apple.com>
+
+        Fixed big leak in QString assignment operator.
+        Updated comments.  Removed old fprintfs.
+        Added some frame debugging logs.
+        
+	* src/kwq/KWQFontMetrics.mm: (_rectForString):
+	* src/kwq/KWQKHTMLPart.mm: (KHTMLPart::openURL), (KHTMLPart::requestFrame):
+	* src/kwq/KWQScrollView.mm: (QScrollView::addChild),
+	(QScrollView::resizeContents), (QScrollView::updateContents),
+	(QScrollView::repaintContents):
+	* src/kwq/KWQString.mm: (QString::operator=):
+	* src/kwq/kwqdebug.h:
+
 2002-03-23  Darin Adler  <darin at apple.com>
 
         Fixed problem with extra empty items in menus.
diff --git a/WebCore/kwq/KWQFontMetrics.mm b/WebCore/kwq/KWQFontMetrics.mm
index b91dc2c..451c206 100644
--- a/WebCore/kwq/KWQFontMetrics.mm
+++ b/WebCore/kwq/KWQFontMetrics.mm
@@ -592,7 +592,8 @@ static NSRect _rectForString (KWQLayoutInfo *self, const UniChar *internalBuffer
             glyphID = glyphRecords[i].glyphID;
             usedCharacterToGlyph[i] = glyphID;
             
-            // Fill the block of glyphs for the glyph needed.
+            // Fill the block of glyphs for the glyph needed. If we're going to incur the overhead
+            // of calling into CG, we may as well get a block of scaled glyph advances.
             if (self->widthCache[glyphID] == UNITIALIZED_GLYPH_WIDTH){
                 short unsigned int sequentialGlyphs[INCREMENTAL_GLYPH_CACHE_BLOCK];
                 unsigned int blockStart, blockEnd, blockID;
@@ -621,9 +622,6 @@ static NSRect _rectForString (KWQLayoutInfo *self, const UniChar *internalBuffer
     
     // Pass 2:
     // Sum the widths for all the glyphs.
-    
-    // Optimization:  This loop could sum pre-rounded unsigned shorts.  Storing
-    // the glyph widths as shorts would cut space in half.
     if (needCharToGlyphLookup){
         for (i = 0; i < numGlyphs; i++){
             totalWidth += widthCache[usedCharacterToGlyph[i]];
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 6aa1ae3..5633032 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -275,8 +275,6 @@ KHTMLPart::~KHTMLPart()
 
 bool KHTMLPart::openURL( const KURL &url )
 {
-    fprintf (stdout, "0x%08x openURL(): for url %s\n", (unsigned int)this, url.url().latin1());
-
     d->m_workingURL = url;
     d->m_url = url;
 
@@ -850,15 +848,10 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons
     IFWebFrame *aFrame;
     IFWebDataSource *dataSource;
     
-    fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x, name = %s, url = %s\n", (unsigned int)this, (unsigned int)frame, frameName.latin1(), url.latin1());    
     dataSource = getDataSource();
 
     aFrame =[dataSource frameNamed: nsframeName];
     if (aFrame){
-        fprintf (stdout, "0x%08x requestFrame():  frame found part = 0x%08x\n", (unsigned int)this, (unsigned int)frame);    
-        fprintf (stdout, "0x%08x requestFrame():  frame found _widget = 0x%08x\n", (unsigned int)this, (unsigned int)[[aFrame view] _widget]);    
-        fprintf (stdout, "0x%08x requestFrame():  frame found _provisionalWidget = 0x%08x\n", (unsigned int)this, (unsigned int)[[aFrame view] _provisionalWidget]);    
-        // ?
         if ([[aFrame view] _provisionalWidget])
             frame->setWidget ([[aFrame view] _provisionalWidget]);
         else
@@ -870,7 +863,6 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons
         IFWebFrame *newFrame;
         id <IFWebController> controller;
 
-        fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x creating frame\n", (unsigned int)this, (unsigned int)frame);    
         childURL = [NSURL URLWithString: QSTRING_TO_NSSTRING (completeURL( url ).url() )];
         
         oldDataSource = getDataSource();
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 6aa1ae3..5633032 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -275,8 +275,6 @@ KHTMLPart::~KHTMLPart()
 
 bool KHTMLPart::openURL( const KURL &url )
 {
-    fprintf (stdout, "0x%08x openURL(): for url %s\n", (unsigned int)this, url.url().latin1());
-
     d->m_workingURL = url;
     d->m_url = url;
 
@@ -850,15 +848,10 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons
     IFWebFrame *aFrame;
     IFWebDataSource *dataSource;
     
-    fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x, name = %s, url = %s\n", (unsigned int)this, (unsigned int)frame, frameName.latin1(), url.latin1());    
     dataSource = getDataSource();
 
     aFrame =[dataSource frameNamed: nsframeName];
     if (aFrame){
-        fprintf (stdout, "0x%08x requestFrame():  frame found part = 0x%08x\n", (unsigned int)this, (unsigned int)frame);    
-        fprintf (stdout, "0x%08x requestFrame():  frame found _widget = 0x%08x\n", (unsigned int)this, (unsigned int)[[aFrame view] _widget]);    
-        fprintf (stdout, "0x%08x requestFrame():  frame found _provisionalWidget = 0x%08x\n", (unsigned int)this, (unsigned int)[[aFrame view] _provisionalWidget]);    
-        // ?
         if ([[aFrame view] _provisionalWidget])
             frame->setWidget ([[aFrame view] _provisionalWidget]);
         else
@@ -870,7 +863,6 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons
         IFWebFrame *newFrame;
         id <IFWebController> controller;
 
-        fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x creating frame\n", (unsigned int)this, (unsigned int)frame);    
         childURL = [NSURL URLWithString: QSTRING_TO_NSSTRING (completeURL( url ).url() )];
         
         oldDataSource = getDataSource();
diff --git a/WebCore/kwq/KWQScrollView.mm b/WebCore/kwq/KWQScrollView.mm
index ed9200f..38f1865 100644
--- a/WebCore/kwq/KWQScrollView.mm
+++ b/WebCore/kwq/KWQScrollView.mm
@@ -162,13 +162,12 @@ void QScrollView::addChild(QWidget* child, int x, int y)
     NSRect wFrame = [subView frame];
 
     if ([subView superview] == thisView){
-        //NSLog (@"Already added 0x%08x %@ at (%d,%d) w %d h %d\n", subView, [[subView class] className], x, y, (int)wFrame.size.width, (int)wFrame.size.height);
         return;
     }
     
     [subView removeFromSuperview];
     
-    KWQDEBUG6 ("Adding 0x%08x %s at (%d,%d) w %d h %d\n", subView, [[[subView class] className] cString], x, y, (int)wFrame.size.width, (int)wFrame.size.height);
+    KWQDEBUGLEVEL6 (KWQ_LOG_FRAMES, "Adding 0x%08x %s at (%d,%d) w %d h %d\n", subView, [[[subView class] className] cString], x, y, (int)wFrame.size.width, (int)wFrame.size.height);
     [thisView addSubview: subView];
 }
 
@@ -188,12 +187,12 @@ void QScrollView::removeChild(QWidget* child)
 
 void QScrollView::resizeContents(int w, int h)
 {
-    KWQDEBUG4 ("0x%08x %s at w %d h %d\n", getView(), [[[getView() class] className] cString], w, h);
+    KWQDEBUGLEVEL4 (KWQ_LOG_FRAMES, "0x%08x %s at w %d h %d\n", getView(), [[[getView() class] className] cString], w, h);
     //if ([nsview isKindOfClass: NSClassFromString(@"IFDynamicScrollBarsView")])
     if ([getView() isKindOfClass: NSClassFromString(@"NSScrollView")]){
         IFWebView *wview = [(NSScrollView *)getView() documentView];
         
-        KWQDEBUG4 ("0x%08x %s at w %d h %d\n", wview, [[[wview class] className] cString], w, h);
+        KWQDEBUGLEVEL4 (KWQ_LOG_FRAMES, "0x%08x %s at w %d h %d\n", wview, [[[wview class] className] cString], w, h);
         //w -= (int)[NSScroller scrollerWidth];
         //w -= 1;
         if (w < 0)
@@ -213,7 +212,7 @@ void QScrollView::resizeContents(int w, int h)
 
 void QScrollView::updateContents(int x, int y, int w, int h)
 {
-    KWQDEBUG6 ("0x%08x %s at (%d,%d) w %d h %d\n", getView(), [[[getView() class] className] cString], x, y, w, h);
+    KWQDEBUGLEVEL6 (KWQ_LOG_FRAMES, "0x%08x %s at (%d,%d) w %d h %d\n", getView(), [[[getView() class] className] cString], x, y, w, h);
 }
 
 void QScrollView::updateContents(const QRect &rect)
@@ -224,7 +223,7 @@ void QScrollView::updateContents(const QRect &rect)
 
 void QScrollView::repaintContents(int x, int y, int w, int h, bool erase=TRUE)
 {
-    KWQDEBUG6 ("0x%08x %s at (%d,%d) w %d h %d\n", getView(), [[[getView() class] className] cString], x, y, w, h);
+    KWQDEBUGLEVEL6 (KWQ_LOG_FRAMES, "0x%08x %s at (%d,%d) w %d h %d\n", getView(), [[[getView() class] className] cString], x, y, w, h);
 }
 
 QPoint QScrollView::contentsToViewport(const QPoint &)
diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index 6d0baf9..b86b3dd 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -257,6 +257,7 @@ QString &QString::operator=(const QString &qs)
     CFRetain(qs.s);
     CFRelease(s);
     s = qs.s;
+    flushCache();
     cache = NULL;
     return *this;
 }
diff --git a/WebCore/kwq/kwqdebug.h b/WebCore/kwq/kwqdebug.h
index 17c22df..8bb3a13 100644
--- a/WebCore/kwq/kwqdebug.h
+++ b/WebCore/kwq/kwqdebug.h
@@ -53,6 +53,7 @@ long _GetMillisecondsSinceEpoch();
 #define KWQ_LOG_MEMUSAGE		0x00000080
 #define KWQ_LOG_FONTCACHE		0x00000100
 #define KWQ_LOG_FONTCACHECHARMISS	0x00000200
+#define KWQ_LOG_FRAMES			0x00000400
 
 #define KWQ_LOG_NONE			0
 
diff --git a/WebCore/src/kwq/KWQFontMetrics.mm b/WebCore/src/kwq/KWQFontMetrics.mm
index b91dc2c..451c206 100644
--- a/WebCore/src/kwq/KWQFontMetrics.mm
+++ b/WebCore/src/kwq/KWQFontMetrics.mm
@@ -592,7 +592,8 @@ static NSRect _rectForString (KWQLayoutInfo *self, const UniChar *internalBuffer
             glyphID = glyphRecords[i].glyphID;
             usedCharacterToGlyph[i] = glyphID;
             
-            // Fill the block of glyphs for the glyph needed.
+            // Fill the block of glyphs for the glyph needed. If we're going to incur the overhead
+            // of calling into CG, we may as well get a block of scaled glyph advances.
             if (self->widthCache[glyphID] == UNITIALIZED_GLYPH_WIDTH){
                 short unsigned int sequentialGlyphs[INCREMENTAL_GLYPH_CACHE_BLOCK];
                 unsigned int blockStart, blockEnd, blockID;
@@ -621,9 +622,6 @@ static NSRect _rectForString (KWQLayoutInfo *self, const UniChar *internalBuffer
     
     // Pass 2:
     // Sum the widths for all the glyphs.
-    
-    // Optimization:  This loop could sum pre-rounded unsigned shorts.  Storing
-    // the glyph widths as shorts would cut space in half.
     if (needCharToGlyphLookup){
         for (i = 0; i < numGlyphs; i++){
             totalWidth += widthCache[usedCharacterToGlyph[i]];
diff --git a/WebCore/src/kwq/KWQKHTMLPart.mm b/WebCore/src/kwq/KWQKHTMLPart.mm
index 6aa1ae3..5633032 100644
--- a/WebCore/src/kwq/KWQKHTMLPart.mm
+++ b/WebCore/src/kwq/KWQKHTMLPart.mm
@@ -275,8 +275,6 @@ KHTMLPart::~KHTMLPart()
 
 bool KHTMLPart::openURL( const KURL &url )
 {
-    fprintf (stdout, "0x%08x openURL(): for url %s\n", (unsigned int)this, url.url().latin1());
-
     d->m_workingURL = url;
     d->m_url = url;
 
@@ -850,15 +848,10 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons
     IFWebFrame *aFrame;
     IFWebDataSource *dataSource;
     
-    fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x, name = %s, url = %s\n", (unsigned int)this, (unsigned int)frame, frameName.latin1(), url.latin1());    
     dataSource = getDataSource();
 
     aFrame =[dataSource frameNamed: nsframeName];
     if (aFrame){
-        fprintf (stdout, "0x%08x requestFrame():  frame found part = 0x%08x\n", (unsigned int)this, (unsigned int)frame);    
-        fprintf (stdout, "0x%08x requestFrame():  frame found _widget = 0x%08x\n", (unsigned int)this, (unsigned int)[[aFrame view] _widget]);    
-        fprintf (stdout, "0x%08x requestFrame():  frame found _provisionalWidget = 0x%08x\n", (unsigned int)this, (unsigned int)[[aFrame view] _provisionalWidget]);    
-        // ?
         if ([[aFrame view] _provisionalWidget])
             frame->setWidget ([[aFrame view] _provisionalWidget]);
         else
@@ -870,7 +863,6 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons
         IFWebFrame *newFrame;
         id <IFWebController> controller;
 
-        fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x creating frame\n", (unsigned int)this, (unsigned int)frame);    
         childURL = [NSURL URLWithString: QSTRING_TO_NSSTRING (completeURL( url ).url() )];
         
         oldDataSource = getDataSource();
diff --git a/WebCore/src/kwq/KWQScrollView.mm b/WebCore/src/kwq/KWQScrollView.mm
index ed9200f..38f1865 100644
--- a/WebCore/src/kwq/KWQScrollView.mm
+++ b/WebCore/src/kwq/KWQScrollView.mm
@@ -162,13 +162,12 @@ void QScrollView::addChild(QWidget* child, int x, int y)
     NSRect wFrame = [subView frame];
 
     if ([subView superview] == thisView){
-        //NSLog (@"Already added 0x%08x %@ at (%d,%d) w %d h %d\n", subView, [[subView class] className], x, y, (int)wFrame.size.width, (int)wFrame.size.height);
         return;
     }
     
     [subView removeFromSuperview];
     
-    KWQDEBUG6 ("Adding 0x%08x %s at (%d,%d) w %d h %d\n", subView, [[[subView class] className] cString], x, y, (int)wFrame.size.width, (int)wFrame.size.height);
+    KWQDEBUGLEVEL6 (KWQ_LOG_FRAMES, "Adding 0x%08x %s at (%d,%d) w %d h %d\n", subView, [[[subView class] className] cString], x, y, (int)wFrame.size.width, (int)wFrame.size.height);
     [thisView addSubview: subView];
 }
 
@@ -188,12 +187,12 @@ void QScrollView::removeChild(QWidget* child)
 
 void QScrollView::resizeContents(int w, int h)
 {
-    KWQDEBUG4 ("0x%08x %s at w %d h %d\n", getView(), [[[getView() class] className] cString], w, h);
+    KWQDEBUGLEVEL4 (KWQ_LOG_FRAMES, "0x%08x %s at w %d h %d\n", getView(), [[[getView() class] className] cString], w, h);
     //if ([nsview isKindOfClass: NSClassFromString(@"IFDynamicScrollBarsView")])
     if ([getView() isKindOfClass: NSClassFromString(@"NSScrollView")]){
         IFWebView *wview = [(NSScrollView *)getView() documentView];
         
-        KWQDEBUG4 ("0x%08x %s at w %d h %d\n", wview, [[[wview class] className] cString], w, h);
+        KWQDEBUGLEVEL4 (KWQ_LOG_FRAMES, "0x%08x %s at w %d h %d\n", wview, [[[wview class] className] cString], w, h);
         //w -= (int)[NSScroller scrollerWidth];
         //w -= 1;
         if (w < 0)
@@ -213,7 +212,7 @@ void QScrollView::resizeContents(int w, int h)
 
 void QScrollView::updateContents(int x, int y, int w, int h)
 {
-    KWQDEBUG6 ("0x%08x %s at (%d,%d) w %d h %d\n", getView(), [[[getView() class] className] cString], x, y, w, h);
+    KWQDEBUGLEVEL6 (KWQ_LOG_FRAMES, "0x%08x %s at (%d,%d) w %d h %d\n", getView(), [[[getView() class] className] cString], x, y, w, h);
 }
 
 void QScrollView::updateContents(const QRect &rect)
@@ -224,7 +223,7 @@ void QScrollView::updateContents(const QRect &rect)
 
 void QScrollView::repaintContents(int x, int y, int w, int h, bool erase=TRUE)
 {
-    KWQDEBUG6 ("0x%08x %s at (%d,%d) w %d h %d\n", getView(), [[[getView() class] className] cString], x, y, w, h);
+    KWQDEBUGLEVEL6 (KWQ_LOG_FRAMES, "0x%08x %s at (%d,%d) w %d h %d\n", getView(), [[[getView() class] className] cString], x, y, w, h);
 }
 
 QPoint QScrollView::contentsToViewport(const QPoint &)
diff --git a/WebCore/src/kwq/KWQString.mm b/WebCore/src/kwq/KWQString.mm
index 6d0baf9..b86b3dd 100644
--- a/WebCore/src/kwq/KWQString.mm
+++ b/WebCore/src/kwq/KWQString.mm
@@ -257,6 +257,7 @@ QString &QString::operator=(const QString &qs)
     CFRetain(qs.s);
     CFRelease(s);
     s = qs.s;
+    flushCache();
     cache = NULL;
     return *this;
 }
diff --git a/WebCore/src/kwq/kwqdebug.h b/WebCore/src/kwq/kwqdebug.h
index 17c22df..8bb3a13 100644
--- a/WebCore/src/kwq/kwqdebug.h
+++ b/WebCore/src/kwq/kwqdebug.h
@@ -53,6 +53,7 @@ long _GetMillisecondsSinceEpoch();
 #define KWQ_LOG_MEMUSAGE		0x00000080
 #define KWQ_LOG_FONTCACHE		0x00000100
 #define KWQ_LOG_FONTCACHECHARMISS	0x00000200
+#define KWQ_LOG_FRAMES			0x00000400
 
 #define KWQ_LOG_NONE			0
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list