[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 07:08:46 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit e67107bdbfc10f3fe1921ed8f1488fbefa09c597
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 26 07:51:13 2002 +0000

    JavaScriptCore
            Use delete[] (not delete) operator to delete array.
    
            * kjs/property_map.cpp:
    
    WebBrowser
            Use cleaned up API to enable/disable page cache.
    
            * Debug/DebugUtilities.m:
            (-[BrowserDocument toggleBackForwardEnabled:]):
    
    WebCore
            Cleanup up leaking objects in page cache.
    
            * kwq/KWQKHTMLPart.mm:
            (KWQKHTMLPart::openURLFromPageCache):
            * kwq/WebCoreBridge.mm:
            (-[KWQPageState initWithDocument:DOM::URL:windowProperties:KJS::locationProperties:KJS::]):
            (-[KWQPageState dealloc]):
    
    WebKit
            Cleanup leaking objects in page cache.
            Cleaned up API a bit.
    
            * History.subproj/WebBackForwardList.h:
            * History.subproj/WebBackForwardList.m:
            (-[WebBackForwardList dealloc]):
            (+[WebBackForwardList setUsesPageCache:]):
            (+[WebBackForwardList usesPageCache]):
            (+[WebBackForwardList setPageCacheSize:]):
            (+[WebBackForwardList pageCacheSize]):
            * History.subproj/WebHistoryItem.h:
            * History.subproj/WebHistoryItem.m:
            (-[WebHistoryItem setHasPageCache:]):
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge saveDocumentToPageCache:]):
            * WebKit.exp:
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _canCachePage]):
            (-[WebFrame _purgePageCache]):
            (-[WebFrame _setState:]):
            (-[WebFrame _continueLoadRequestAfterNavigationPolicy:request:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2874 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 2402166..8efef0d 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,5 +1,11 @@
 2002-11-25  Richard Williamson   <rjw at apple.com>
 
+        Use delete[] (not delete) operator to delete array.
+        
+        * kjs/property_map.cpp:
+
+2002-11-25  Richard Williamson   <rjw at apple.com>
+
         Added debugging info.  Fixed property map save function.
         
         * kjs/nodes.cpp:
diff --git a/JavaScriptCore/ChangeLog-2002-12-03 b/JavaScriptCore/ChangeLog-2002-12-03
index 2402166..8efef0d 100644
--- a/JavaScriptCore/ChangeLog-2002-12-03
+++ b/JavaScriptCore/ChangeLog-2002-12-03
@@ -1,5 +1,11 @@
 2002-11-25  Richard Williamson   <rjw at apple.com>
 
+        Use delete[] (not delete) operator to delete array.
+        
+        * kjs/property_map.cpp:
+
+2002-11-25  Richard Williamson   <rjw at apple.com>
+
         Added debugging info.  Fixed property map save function.
         
         * kjs/nodes.cpp:
diff --git a/JavaScriptCore/ChangeLog-2003-10-25 b/JavaScriptCore/ChangeLog-2003-10-25
index 2402166..8efef0d 100644
--- a/JavaScriptCore/ChangeLog-2003-10-25
+++ b/JavaScriptCore/ChangeLog-2003-10-25
@@ -1,5 +1,11 @@
 2002-11-25  Richard Williamson   <rjw at apple.com>
 
+        Use delete[] (not delete) operator to delete array.
+        
+        * kjs/property_map.cpp:
+
+2002-11-25  Richard Williamson   <rjw at apple.com>
+
         Added debugging info.  Fixed property map save function.
         
         * kjs/nodes.cpp:
diff --git a/JavaScriptCore/kjs/property_map.cpp b/JavaScriptCore/kjs/property_map.cpp
index 154c27c..b0a426b 100644
--- a/JavaScriptCore/kjs/property_map.cpp
+++ b/JavaScriptCore/kjs/property_map.cpp
@@ -72,8 +72,9 @@ SavedProperties::SavedProperties() : _count(0), _properties(0) { }
 
 SavedProperties::~SavedProperties()
 {
-    if (_properties)
-        delete _properties;
+    if (_properties){
+        delete [] _properties;
+    }
 }
 
 // Algorithm concepts from Algorithms in C++, Sedgewick.
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 358a7f4..0a420f8 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,5 +1,15 @@
 2002-11-25  Richard Williamson   <rjw at apple.com>
 
+        Cleanup up leaking objects in page cache.
+        
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::openURLFromPageCache):
+        * kwq/WebCoreBridge.mm:
+        (-[KWQPageState initWithDocument:DOM::URL:windowProperties:KJS::locationProperties:KJS::]):
+        (-[KWQPageState dealloc]):
+
+2002-11-25  Richard Williamson   <rjw at apple.com>
+
         Added check for non-nil doc.
         
         * kwq/KWQKHTMLPart.mm:
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 358a7f4..0a420f8 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,15 @@
 2002-11-25  Richard Williamson   <rjw at apple.com>
 
+        Cleanup up leaking objects in page cache.
+        
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::openURLFromPageCache):
+        * kwq/WebCoreBridge.mm:
+        (-[KWQPageState initWithDocument:DOM::URL:windowProperties:KJS::locationProperties:KJS::]):
+        (-[KWQPageState dealloc]):
+
+2002-11-25  Richard Williamson   <rjw at apple.com>
+
         Added check for non-nil doc.
         
         * kwq/KWQKHTMLPart.mm:
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 358a7f4..0a420f8 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,15 @@
 2002-11-25  Richard Williamson   <rjw at apple.com>
 
+        Cleanup up leaking objects in page cache.
+        
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::openURLFromPageCache):
+        * kwq/WebCoreBridge.mm:
+        (-[KWQPageState initWithDocument:DOM::URL:windowProperties:KJS::locationProperties:KJS::]):
+        (-[KWQPageState dealloc]):
+
+2002-11-25  Richard Williamson   <rjw at apple.com>
+
         Added check for non-nil doc.
         
         * kwq/KWQKHTMLPart.mm:
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 1622b89..fc1c9cb 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -463,8 +463,6 @@ void KWQKHTMLPart::restoreLocationProperties(KJS::SavedProperties *locationPrope
 
 void KWQKHTMLPart::openURLFromPageCache(DOM::DocumentImpl *doc, KURL *url, KJS::SavedProperties *windowProperties, KJS::SavedProperties *locationProperties)
 {
-    printf ("KWQKHTMLPart::openURLFromPageCache\n");
-
     d->m_redirectionTimer.stop();
 
     // We still have to close the previous part page.
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index d1225a0..b817ccc 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -904,14 +904,16 @@ DOM::Node next = n.firstChild();
     windowProperties = wp;
     locationProperties =lp;
     return self;
-
 }
 
 - (void)dealloc
 {
+    KHTMLView *view = document->view();
     document->setInPageCache(NO);
+    document->detach();
     document->deref();
     document = 0;
+    delete view;
     delete URL;
     URL = 0;
     delete windowProperties;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index eef21ec..73c1de0 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,29 @@
 2002-11-25  Richard Williamson   <rjw at apple.com>
 
+        Cleanup leaking objects in page cache.
+        Cleaned up API a bit.
+        
+        * History.subproj/WebBackForwardList.h:
+        * History.subproj/WebBackForwardList.m:
+        (-[WebBackForwardList dealloc]):
+        (+[WebBackForwardList setUsesPageCache:]):
+        (+[WebBackForwardList usesPageCache]):
+        (+[WebBackForwardList setPageCacheSize:]):
+        (+[WebBackForwardList pageCacheSize]):
+        * History.subproj/WebHistoryItem.h:
+        * History.subproj/WebHistoryItem.m:
+        (-[WebHistoryItem setHasPageCache:]):
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge saveDocumentToPageCache:]):
+        * WebKit.exp:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _canCachePage]):
+        (-[WebFrame _purgePageCache]):
+        (-[WebFrame _setState:]):
+        (-[WebFrame _continueLoadRequestAfterNavigationPolicy:request:]):
+
+2002-11-25  Richard Williamson   <rjw at apple.com>
+
         Changed ordering of cachability check.
         
         * WebView.subproj/WebFramePrivate.m:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index eef21ec..73c1de0 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,29 @@
 2002-11-25  Richard Williamson   <rjw at apple.com>
 
+        Cleanup leaking objects in page cache.
+        Cleaned up API a bit.
+        
+        * History.subproj/WebBackForwardList.h:
+        * History.subproj/WebBackForwardList.m:
+        (-[WebBackForwardList dealloc]):
+        (+[WebBackForwardList setUsesPageCache:]):
+        (+[WebBackForwardList usesPageCache]):
+        (+[WebBackForwardList setPageCacheSize:]):
+        (+[WebBackForwardList pageCacheSize]):
+        * History.subproj/WebHistoryItem.h:
+        * History.subproj/WebHistoryItem.m:
+        (-[WebHistoryItem setHasPageCache:]):
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge saveDocumentToPageCache:]):
+        * WebKit.exp:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _canCachePage]):
+        (-[WebFrame _purgePageCache]):
+        (-[WebFrame _setState:]):
+        (-[WebFrame _continueLoadRequestAfterNavigationPolicy:request:]):
+
+2002-11-25  Richard Williamson   <rjw at apple.com>
+
         Changed ordering of cachability check.
         
         * WebView.subproj/WebFramePrivate.m:
diff --git a/WebKit/History.subproj/WebBackForwardList.h b/WebKit/History.subproj/WebBackForwardList.h
index e34f9e1..c4cc6d3 100644
--- a/WebKit/History.subproj/WebBackForwardList.h
+++ b/WebKit/History.subproj/WebBackForwardList.h
@@ -23,6 +23,33 @@
 }
 
 /*!
+    @method setUsesPageCache:
+    @param flag set to true if pages should be cached
+    @abstract Pages in the back/forward list may be cached.  Pages in this cache
+    will load much more quickly, however they may not always be up-to-date.  The
+    page cache may not apply to all pages.
+*/
++ (void)setUsesPageCache: (BOOL)flag;
+
+/*!
+    @method usesPageCache
+    @result Returns YES if the page cache is enabled.
+*/
++ (BOOL)usesPageCache;
+
+/*!
+    @method setPageCacheSize:
+    @param size The number of pages to allow in the page cache.
+*/
++ (void)setPageCacheSize: (unsigned)size;
+
+/*!
+    @method pageCacheSize
+    @result Returns the number of pages that may be cached.
+*/
++ (unsigned)pageCacheSize;
+
+/*!
     @method addEntry:
     @abstract Adds an entry to the list.
     @discussion Add an entry to the back-forward list, immediately after the current entry.
diff --git a/WebKit/History.subproj/WebBackForwardList.m b/WebKit/History.subproj/WebBackForwardList.m
index e81e980..3936aad 100644
--- a/WebKit/History.subproj/WebBackForwardList.m
+++ b/WebKit/History.subproj/WebBackForwardList.m
@@ -28,6 +28,11 @@
 
 - (void)dealloc
 {
+    unsigned i;
+    for (i = 0; i < [_entries count]; i++){
+        WebHistoryItem *item = [_entries objectAtIndex: i];
+        [item setHasPageCache: NO]; 
+    }
     [_entries release];
     [super dealloc];
 }
@@ -38,15 +43,24 @@
     int currSize = [_entries count];
     if (_current != currSize-1 && _current != -1) {
         NSRange forwardRange = NSMakeRange(_current+1, currSize-(_current+1));
+        NSArray *subarray;
+        subarray = [_entries subarrayWithRange:forwardRange];
+        unsigned i;
+        for (i = 0; i < [subarray count]; i++){
+            WebHistoryItem *item = [subarray objectAtIndex: i];
+            [item setHasPageCache: NO];            
+        }
         [_entries removeObjectsInRange: forwardRange];
         currSize -= forwardRange.length;
     }
 
     // Toss the first item if the list is getting too big, as long as we're not using it
     if (currSize == _maximumSize && _current != 0) {
-       [_entries removeObjectAtIndex:0];
-       currSize--;
-       _current--;
+        WebHistoryItem *item = [_entries objectAtIndex: 0];
+        [item setHasPageCache: NO];
+        [_entries removeObjectAtIndex:0];
+        currSize--;
+        _current--;
     }
 
     [_entries addObject:entry];
@@ -173,4 +187,31 @@
     return result;
 }
 
+// Off be default for now.
+static BOOL usesPageCache = 0;
+
++ (void)setUsesPageCache: (BOOL)f
+{
+    usesPageCache = f ? YES : NO;
+}
+
++ (BOOL)usesPageCache
+{
+    return usesPageCache;
+}
+
+static unsigned pageCacheSize = 10;
+
++ (void)setPageCacheSize: (unsigned)size
+{
+    pageCacheSize = size;
+}
+
+
++ (unsigned)pageCacheSize
+{
+    return pageCacheSize;
+}
+
+
 @end
diff --git a/WebKit/History.subproj/WebHistoryItem.h b/WebKit/History.subproj/WebHistoryItem.h
index 82618fe..e79e415 100644
--- a/WebKit/History.subproj/WebHistoryItem.h
+++ b/WebKit/History.subproj/WebHistoryItem.h
@@ -66,9 +66,7 @@
 @end
 
 @interface WebHistoryItem (WebPrivate)
-- (BOOL)pageCacheEnabled;
-- (void)setPageCacheEnabled: (BOOL)f;
+- (BOOL)hasPageCache;
+- (void)setHasPageCache: (BOOL)f;
 - (NSMutableDictionary *)pageCache;
-+ (void)setUsePageCache: (BOOL)f;
-+ (BOOL)usePageCache;
 @end
diff --git a/WebKit/History.subproj/WebHistoryItem.m b/WebKit/History.subproj/WebHistoryItem.m
index b20385a..b5433b7 100644
--- a/WebKit/History.subproj/WebHistoryItem.m
+++ b/WebKit/History.subproj/WebHistoryItem.m
@@ -394,12 +394,12 @@
 
 @implementation WebHistoryItem (WebPrivate)
 
-- (BOOL)pageCacheEnabled;
+- (BOOL)hasPageCache;
 {
     return pageCache != nil;
 }
 
-- (void)setPageCacheEnabled: (BOOL)f
+- (void)setHasPageCache: (BOOL)f
 {
     if (f && !pageCache)
         pageCache = [[NSMutableDictionary alloc] init];
@@ -414,17 +414,5 @@
     return pageCache;
 }
 
-// Off be default for now.
-static BOOL usePageCache = 0;
-
-+ (void)setUsePageCache: (BOOL)f
-{
-    usePageCache = f;
-}
-
-+ (BOOL)usePageCache
-{
-    return usePageCache;
-}
 
 @end
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index ed73094..8b84f84 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -325,7 +325,7 @@
 - (BOOL)saveDocumentToPageCache: documentInfo
 {
     WebHistoryItem *item = [frame _itemForSavingDocState];
-    if (![item pageCacheEnabled]){
+    if (![item hasPageCache]){
         printf ("WebBridge saveDocumentToPageCache:  not saving\n");
         return false;
     }
diff --git a/WebKit/WebKit.exp b/WebKit/WebKit.exp
index b715fba..da6f596 100644
--- a/WebKit/WebKit.exp
+++ b/WebKit/WebKit.exp
@@ -1,3 +1,4 @@
+.objc_class_name_WebBackForwardList
 .objc_class_name_WebBookmark
 .objc_class_name_WebBookmarkGroup
 .objc_class_name_WebBookmarkImporter
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index e4a103f..e4adb48 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -533,12 +533,31 @@ static const char * const stateNames[] = {
 
 - (BOOL)_canCachePage
 {
-    return [WebHistoryItem usePageCache];
+    return [WebBackForwardList usesPageCache];
 }
 
 - (void)_purgePageCache
 {
     // This method implements the rule for purging the page cache.
+    unsigned sizeLimit = [WebBackForwardList pageCacheSize];
+    unsigned pagesCached = 0;
+    WebBackForwardList *backForwardList = [[self controller] backForwardList];
+    NSArray *backList = [backForwardList backListWithSizeLimit: 999999];
+    WebHistoryItem *oldestItem = nil;
+    
+    unsigned i;
+    for (i = 0; i < [backList count]; i++){
+        WebHistoryItem *item = [backList objectAtIndex: i];
+        if ([item hasPageCache]){
+            if (oldestItem == nil)
+                oldestItem = item;
+            pagesCached++;
+        }
+    }
+    
+    if (pagesCached > sizeLimit){
+        [oldestItem setHasPageCache: NO];
+    }
 }
 
 - (WebFrameState)_state
@@ -574,7 +593,7 @@ static const char * const stateNames[] = {
         if ([self _canCachePage] && [_private->bridge canCachePage] && [_private currentItem]){
             if (![[_private currentItem] pageCache]){
                 NSLog (@"saving page cache for %@, %@", [self name], [[self dataSource] URL]);
-                [[_private currentItem] setPageCacheEnabled: YES];
+                [[_private currentItem] setHasPageCache: YES];
                 [[self dataSource] _setStoredInPageCache: YES];
                 [[[_private currentItem] pageCache] setObject: [self dataSource] forKey: @"WebKitDataSource"];
                 [[[_private currentItem] pageCache] setObject: [[self webView] documentView] forKey: @"WebKitDocumentView"];
@@ -1403,7 +1422,7 @@ static const char * const stateNames[] = {
     if ((loadType == WebFrameLoadTypeForward ||
         loadType == WebFrameLoadTypeBack ||
         loadType == WebFrameLoadTypeIndexedBackForward) &&
-        [[_private provisionalItem] pageCacheEnabled]){
+        [[_private provisionalItem] hasPageCache]){
         printf ("Restoring page from state, %s\n", [[[[_private provisionalItem] URL] absoluteString] cString]);
         [_private->provisionalDataSource _startLoading: [[_private provisionalItem] pageCache]];
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list