Bug 125779 - [curl] Add storage limit to cache manager
Summary: [curl] Add storage limit to cache manager
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-16 06:56 PST by Mátyás Mustoha
Modified: 2014-01-23 09:48 PST (History)
4 users (show)

See Also:


Attachments
Proposed patch (10.08 KB, patch)
2013-12-16 07:00 PST, Mátyás Mustoha
no flags Details | Formatted Diff | Diff
Proposed patch 2 (16.80 KB, patch)
2013-12-19 06:32 PST, Mátyás Mustoha
bfulgham: review-
Details | Formatted Diff | Diff
Proposed patch 3 (16.75 KB, patch)
2014-01-23 05:35 PST, Mátyás Mustoha
no flags Details | Formatted Diff | Diff

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