Bug 142392

Summary: Move dispatch_data use behind NetworkCache::Data abstraction
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
none
patch andersca: review+

Description Antti Koivisto 2015-03-06 05:14:03 PST
Less platform dependent code
Comment 1 Antti Koivisto 2015-03-06 05:37:33 PST
Created attachment 248059 [details]
patch
Comment 2 WebKit Commit Bot 2015-03-06 05:40:08 PST
Attachment 248059 [details] did not pass style-queue:


ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheData.h:113:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheDataCocoa.mm:66:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 2 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Antti Koivisto 2015-03-06 06:15:18 PST
Created attachment 248060 [details]
patch
Comment 4 WebKit Commit Bot 2015-03-06 06:17:48 PST
Attachment 248060 [details] did not pass style-queue:


ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheData.h:113:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheDataCocoa.mm:67:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 2 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Anders Carlsson 2015-03-06 08:23:45 PST
Comment on attachment 248060 [details]
patch

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

> Source/WebKit2/NetworkProcess/cache/NetworkCacheData.h:113
> +    void apply(std::function<bool (const uint8_t*, size_t)>&&) const;

I think the function can be const& here.

> Source/WebKit2/NetworkProcess/cache/NetworkCacheDataCocoa.mm:70
> +    if (!m_size)
> +        return;

It's a little weird that calling apply on an empty Data results in nothing happening.

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm:264
> +    Vector<uint8_t, 4096> filler(dataOffset - headerData.size(), 0);

I'd use an std::array here instead.
Comment 6 Antti Koivisto 2015-03-06 09:31:59 PST
https://trac.webkit.org/r181160