Summary: | Switch to file backed buffer when resource is cached to disk | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Antti Koivisto <koivisto> | ||||
Component: | Page Loading | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | cdumez, commit-queue, psolanki | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Antti Koivisto
2015-02-05 10:48:51 PST
Created attachment 246121 [details]
patch
Attachment 246121 [details] did not pass style-queue:
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp:284: Extra space before ( in function call [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.h:73: Extra space before ( in function call [whitespace/parens] [4]
Total errors found: 2 in 6 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 246121 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=246121&action=review > Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h:146 > + typedef std::function<bool (std::unique_ptr<Entry>)> RetriveCompletionHandler; "Retrieve" > Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm:448 > +void NetworkCacheStorage::store(const NetworkCacheKey& key, const Entry& entry, StoreCompletionHandler completionHandler) Since these std::function are passed by value, don't we want to WTF::move() them into the StoreOperation struct? Comment on attachment 246121 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=246121&action=review > Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp:342 > + RefPtr<NetworkResourceLoader> loader(this); Looks like this should be a Ref? Comment on attachment 246121 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=246121&action=review > Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm:257 > + if (!map) On failure mmap() returns MAP_FAILED which is (void*)-1, not 0. Comment on attachment 246121 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=246121&action=review r=me % a few comments. >> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm:448 >> +void NetworkCacheStorage::store(const NetworkCacheKey& key, const Entry& entry, StoreCompletionHandler completionHandler) > > Since these std::function are passed by value, don't we want to WTF::move() them into the StoreOperation struct? or pass them by const ref. > Looks like this should be a Ref?
Ref doesn't work with C++11 lambdas since it doesn't have copy-constructor.
> On failure mmap() returns MAP_FAILED which is (void*)-1, not 0.
Good catch.
(In reply to comment #7) > > Looks like this should be a Ref? > > Ref doesn't work with C++11 lambdas since it doesn't have copy-constructor. Right. never mind then. (In reply to comment #5) > Comment on attachment 246121 [details] > patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=246121&action=review > > > Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm:257 > > + if (!map) > > On failure mmap() returns MAP_FAILED which is (void*)-1, not 0. BTW, it looks like we have the same bug in decodeEntry() already. |