Bug 27304 - WebKit should provide usage and eligibility information about the page cache
Summary: WebKit should provide usage and eligibility information about the page cache
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-15 09:31 PDT by Brady Eidson
Modified: 2009-07-15 10:32 PDT (History)
0 users

See Also:


Attachments
Patch (11.60 KB, patch)
2009-07-15 09:35 PDT, Brady Eidson
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2009-07-15 09:31:24 PDT
WebKit should provide usage and eligibility information about the page cache.

This will help a client provide a debug window into the page cache to spot common disqualifiers.
Comment 1 Brady Eidson 2009-07-15 09:35:05 PDT
Created attachment 32791 [details]
Patch
Comment 2 mitz 2009-07-15 09:46:05 PDT
Comment on attachment 32791 [details]
Patch

> +        (WebCore::CachedFrame::childFrameCount):

Since this is recursive, I think a better name would be descendantFrameCount. A function that returns 1 + number of descendants (i.e. total number of frames in the subtree) may be simpler (and easier to use in PageCache::frameCount!).

> +        (+[WebCoreStatistics numberCachedPages]):
> +        (+[WebCoreStatistics numberCachedFrames]):
> +        (+[WebCoreStatistics numberAutoreleasedPages]):

I think either “numberOf*” or “*Count” would be better names.

> +        * WebView/WebFrame.mm:
> +        (-[WebFrame _cacheabilityDictionary]): Returns a dictionary with all the data about
> +          why the frame is not cacheable.

What if the frame is cacheable?

> +    FrameLoader* fl = _private->coreFrame->loader();
> +    DocumentLoader* dl = fl->documentLoader();

Please use “frameLoader” and “documentLoader” as variable names.
Comment 3 mitz 2009-07-15 10:08:31 PDT
Comment on attachment 32791 [details]
Patch

r=me if you address the above comments
Comment 4 Brady Eidson 2009-07-15 10:32:52 PDT
Sending        WebCore/ChangeLog
Sending        WebCore/WebCore.base.exp
Sending        WebCore/history/CachedFrame.cpp
Sending        WebCore/history/CachedFrame.h
Sending        WebCore/history/PageCache.cpp
Sending        WebCore/history/PageCache.h
Sending        WebKit/mac/ChangeLog
Sending        WebKit/mac/Misc/WebCoreStatistics.h
Sending        WebKit/mac/Misc/WebCoreStatistics.mm
Sending        WebKit/mac/WebKit.exp
Sending        WebKit/mac/WebView/WebFrame.mm
Sending        WebKit/mac/WebView/WebFramePrivate.h
Transmitting file data ............
Committed revision 45923.