WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
141295
Switch to file backed buffer when resource is cached to disk
https://bugs.webkit.org/show_bug.cgi?id=141295
Summary
Switch to file backed buffer when resource is cached to disk
Antti Koivisto
Reported
2015-02-05 10:48:51 PST
Wire the mechanism used with CFNetwork cache to the new disk cache.
Attachments
patch
(15.42 KB, patch)
2015-02-05 12:31 PST
,
Antti Koivisto
cdumez
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Antti Koivisto
Comment 1
2015-02-05 12:31:54 PST
Created
attachment 246121
[details]
patch
WebKit Commit Bot
Comment 2
2015-02-05 12:34:09 PST
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.
Chris Dumez
Comment 3
2015-02-05 12:37:49 PST
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?
Chris Dumez
Comment 4
2015-02-05 12:40:46 PST
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?
Chris Dumez
Comment 5
2015-02-05 12:56:02 PST
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.
Chris Dumez
Comment 6
2015-02-05 13:16:14 PST
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.
Antti Koivisto
Comment 7
2015-02-05 13:29:31 PST
> Looks like this should be a Ref?
Ref doesn't work with C++11 lambdas since it doesn't have copy-constructor.
Antti Koivisto
Comment 8
2015-02-05 13:29:52 PST
> On failure mmap() returns MAP_FAILED which is (void*)-1, not 0.
Good catch.
Chris Dumez
Comment 9
2015-02-05 13:31:37 PST
(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.
Chris Dumez
Comment 10
2015-02-05 13:36:52 PST
(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.
Antti Koivisto
Comment 11
2015-02-05 14:18:14 PST
https://trac.webkit.org/r179708
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug