Bug 48706

Summary: Factor calculation of cache sizes based on cache model into shared function.
Product: WebKit Reporter: Sam Weinig <sam>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Patch aroben: review+

Description Sam Weinig 2010-10-29 19:20:16 PDT
Factor calculation of cache sizes based on cache model into shared function.
Comment 1 Sam Weinig 2010-10-29 19:21:36 PDT
Created attachment 72426 [details]
Patch
Comment 2 Adam Barth 2010-10-29 23:14:38 PDT
BTW, what's your plan w.r.t. the memory cache and multiprocess?
Comment 3 Sam Weinig 2010-11-05 04:03:17 PDT
(In reply to comment #2)
> BTW, what's your plan w.r.t. the memory cache and multiprocess?

The current model uses a single process for all windows/tabs, so this has not been a problem we have had to solve yet. It will be an interesting problem to try and solve when the time comes though.
Comment 4 Adam Roben (:aroben) 2010-11-05 08:30:21 PDT
Comment on attachment 72426 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=72426&action=review

> WebKit2/WebProcess/WebProcess.h:106
> +    void calculateCacheSizes(CacheModel cacheModel, uint64_t memorySize, uint64_t diskFreeSize,

Seems like this can be a static member function.

> WebKit2/WebProcess/mac/WebProcessMac.mm:67
>  void WebProcess::platformSetCacheModel(CacheModel cacheModel)
>  {
> +    NSURLCache *nsurlCache = [NSURLCache sharedURLCache];

Why did you move this up to the top? Was it a bug that it was lower down before? You should explain this in your ChangeLog.

> WebKit2/WebProcess/mac/WebProcessMac.mm:94
> +    [nsurlCache setDiskCapacity:std::max(urlCacheDiskCapacity, [nsurlCache diskCapacity])]; // Don't shrink a big disk cache, since that would cause churn.

Why is std:: needed here? Normally we use "using namespace std;" so you don't have to write that.
Comment 5 Sam Weinig 2010-11-09 11:29:10 PST
Landed in r71658.