Bug 143783

Summary: Network Cache: Inline small body data to record file
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, ddkilzer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch cdumez: review+

Description Antti Koivisto 2015-04-15 10:27:01 PDT
We currently save all body data as separate files. We can improve space efficiency and do less reads by inlining smaller resources.
Comment 1 Antti Koivisto 2015-04-15 10:58:48 PDT
Created attachment 250824 [details]
patch
Comment 2 WebKit Commit Bot 2015-04-15 11:00:13 PDT
Attachment 250824 [details] did not pass style-queue:


ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h:47:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h:48:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h:49:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:82:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:99:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:109:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 6 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Pratik Solanki 2015-04-15 11:04:23 PDT
Comment on attachment 250824 [details]
patch

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

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:497
> +    const size_t maximumInlineBodySize = 16 << 10;

Not sure what the preferred style is but writing this as 16 * 1024 would be clearer to me than the bitshift.
Comment 4 Chris Dumez 2015-04-15 12:29:14 PDT
Comment on attachment 250824 [details]
patch

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

r=me

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:349
> +        return { };

Slight preference for "return Nullopt;"

>> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:497
>> +    const size_t maximumInlineBodySize = 16 << 10;
> 
> Not sure what the preferred style is but writing this as 16 * 1024 would be clearer to me than the bitshift.

I agree with Pratik here.

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:516
> +        bool storeAsBlob = shouldStoreBodyAsBlob(write.record.body);

shouldStoreAsBlob as per our boolean variable naming coding style?
Comment 5 Antti Koivisto 2015-04-15 12:56:39 PDT
https://trac.webkit.org/r182856
Comment 6 David Kilzer (:ddkilzer) 2015-04-18 07:20:50 PDT
<rdar://problem/20578464>