Bug 48706 - Factor calculation of cache sizes based on cache model into shared function.
Summary: Factor calculation of cache sizes based on cache model into shared function.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-29 19:20 PDT by Sam Weinig
Modified: 2010-11-09 11:29 PST (History)
1 user (show)

See Also:


Attachments
Patch (23.24 KB, patch)
2010-10-29 19:21 PDT, Sam Weinig
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.