[webkit-changes] cvs commit: WebKit/WebView.subproj WebFrame.m

Maciej mjs at opensource.apple.com
Sat Jul 9 00:05:31 PDT 2005


mjs         05/07/09 00:05:30

  Modified:    .        ChangeLog
               WebView.subproj WebFrame.m
  Log:
          Reviewed by hyatt.
  
  	- fix page cache purging logic; this gets rid of a bug where the
  	page cache would grow without bound if the oldest page cache item
  	was the snapback item, and changed the rule a bit so page cache
  	items farther back than the max size get purged, even if fewer
  	than the max size are in current use.
  
          * WebView.subproj/WebFrame.m:
          (-[WebFrame _purgePageCache]):
  
  Revision  Changes    Path
  1.3215    +13 -0     WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3214
  retrieving revision 1.3215
  diff -u -r1.3214 -r1.3215
  --- ChangeLog	9 Jul 2005 00:53:26 -0000	1.3214
  +++ ChangeLog	9 Jul 2005 07:05:28 -0000	1.3215
  @@ -1,3 +1,16 @@
  +2005-07-09  Maciej Stachowiak  <mjs at apple.com>
  +
  +        Reviewed by hyatt.
  +
  +	- fix page cache purging logic; this gets rid of a bug where the
  +	page cache would grow without bound if the oldest page cache item
  +	was the snapback item, and changed the rule a bit so page cache
  +	items farther back than the max size get purged, even if fewer
  +	than the max size are in current use.
  +
  +        * WebView.subproj/WebFrame.m:
  +        (-[WebFrame _purgePageCache]):
  +
   2005-07-08  Geoffrey Garen  <ggaren at apple.com>
   
           Rolled in patch by opendarwin.org at mitzpettel.com
  
  
  
  1.235     +7 -13     WebKit/WebView.subproj/WebFrame.m
  
  Index: WebFrame.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebFrame.m,v
  retrieving revision 1.234
  retrieving revision 1.235
  diff -u -r1.234 -r1.235
  --- WebFrame.m	17 Jun 2005 15:06:58 -0000	1.234
  +++ WebFrame.m	9 Jul 2005 07:05:30 -0000	1.235
  @@ -923,26 +923,20 @@
   {
       // This method implements the rule for purging the page cache.
       unsigned sizeLimit = [[[self webView] backForwardList] pageCacheSize];
  -    unsigned pagesCached = 0;
       WebBackForwardList *backForwardList = [[self webView] backForwardList];
       NSArray *backList = [backForwardList backListWithLimit: 999999];
  -    WebHistoryItem *oldestItem = nil;
  -    
  +
       unsigned i;
  -    for (i = 0; i < [backList count]; i++){
  +    for (i = [backList count] - 1; i >= sizeLimit; i--){
           WebHistoryItem *item = [backList objectAtIndex: i];
           if ([item hasPageCache]){
  -            if (oldestItem == nil)
  -                oldestItem = item;
  -            pagesCached++;
  +            // Snapback items are never directly purged here.
  +            if ([item alwaysAttemptToUsePageCache]) {
  +                LOG(PageCache, "Purging back/forward cache, %@\n", [oldestItem URL]);
  +                [item setHasPageCache: NO];
  +            }
           }
       }
  -    
  -    // Snapback items are never directly purged here.
  -    if (pagesCached >= sizeLimit && ![oldestItem alwaysAttemptToUsePageCache]){
  -        LOG(PageCache, "Purging back/forward cache, %@\n", [oldestItem URL]);
  -        [oldestItem setHasPageCache: NO];
  -    }
   }
   
   - (WebFrameState)_state
  
  
  



More information about the webkit-changes mailing list