Bug 142392 - Move dispatch_data use behind NetworkCache::Data abstraction
Summary: Move dispatch_data use behind NetworkCache::Data abstraction
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-06 05:14 PST by Antti Koivisto
Modified: 2015-03-06 09:31 PST (History)
1 user (show)

See Also:


Attachments
patch (12.24 KB, patch)
2015-03-06 05:37 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (12.67 KB, patch)
2015-03-06 06:15 PST, Antti Koivisto
andersca: review+
Details | Formatted Diff | Diff

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