Bug 125779

Summary: [curl] Add storage limit to cache manager
Product: WebKit Reporter: Mátyás Mustoha <mmatyas>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, galpeter, peavo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch
none
Proposed patch 2
bfulgham: review-
Proposed patch 3 none

Description Mátyás Mustoha 2013-12-16 06:56:21 PST
Sets a local disc storage limit for the cache manager used by the curl network backend.
Comment 1 Mátyás Mustoha 2013-12-16 07:00:33 PST
Created attachment 219314 [details]
Proposed patch
Comment 2 Mátyás Mustoha 2013-12-19 06:32:44 PST
Created attachment 219646 [details]
Proposed patch 2

Fixed entry size function, added a method for changing storage size and did some refactoring.
Comment 3 Mátyás Mustoha 2014-01-13 05:05:55 PST
anyone?
Comment 4 Brent Fulgham 2014-01-21 11:36:39 PST
Comment on attachment 219646 [details]
Proposed patch 2

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

This change seems fine, but I think it could be a little better if we used C++11 auto types. I'm also not sure the 'long long' declaration is a good idea here.

> Source/WebCore/platform/network/curl/CurlCacheEntry.cpp:345
> +        long long contentFileSize;

It might be better to use a specific size here, such as uint64_t/int64_t.

> Source/WebCore/platform/network/curl/CurlCacheManager.cpp:169
> +    ListHashSet<String>::iterator end = m_LRUEntryList.end();

Make these 'auto'. In fact, they should probably be const.
Comment 5 Mátyás Mustoha 2014-01-23 05:35:20 PST
Created attachment 221972 [details]
Proposed patch 3

Thanks for the review! I changed the iterator to auto in the patch, could you check if it's fine like that?
I agree that 'long long' isn't specific enough, but getFileSize() expects a long long by reference.
Comment 6 Brent Fulgham 2014-01-23 09:20:30 PST
Comment on attachment 221972 [details]
Proposed patch 3

r=me. Thanks for revising the original patch!
Comment 7 WebKit Commit Bot 2014-01-23 09:48:47 PST
Comment on attachment 221972 [details]
Proposed patch 3

Clearing flags on attachment: 221972

Committed r162618: <http://trac.webkit.org/changeset/162618>
Comment 8 WebKit Commit Bot 2014-01-23 09:48:49 PST
All reviewed patches have been landed.  Closing bug.