Summary: | Update CacheStorage caches only if it is updated | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | youenn fablet <youennf> | ||||||
Component: | WebCore Misc. | Assignee: | youenn fablet <youennf> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | achristensen, buildbot, cdumez, cgarcia, commit-queue, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
youenn fablet
2017-08-30 16:47:41 PDT
Created attachment 319422 [details]
Patch
Comment on attachment 319422 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=319422&action=review > Source/WebKit/ChangeLog:9 > + When sending the list of caches, CacheStorageEngineCaches will compare its counter with the one provided. Will this work if multiple processes are using the same cache? > Source/WebCore/Modules/cache/DOMCache.h:80 > + template<class Decoder> static bool decode(Decoder&, CacheInfos&); You could use the cool new decoder that returns a std::optional instead of taking a reference. (In reply to Alex Christensen from comment #2) > Comment on attachment 319422 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=319422&action=review > > > Source/WebKit/ChangeLog:9 > > + When sending the list of caches, CacheStorageEngineCaches will compare its counter with the one provided. > > Will this work if multiple processes are using the same cache? That should work. Each counter given to CacheStorageEngineCaches comes from a corresponding Document. We should be able to test that kind of behavior with a single process containing several iframes. > > Source/WebCore/Modules/cache/DOMCache.h:80 > > + template<class Decoder> static bool decode(Decoder&, CacheInfos&); > > You could use the cool new decoder that returns a std::optional instead of > taking a reference. Ahah, will look at it! Comment on attachment 319422 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=319422&action=review > Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp:236 > + ++m_updateCounter; We need to make sure to never forget to increment the updateCounter. Maybe we could wrap this in a function that indicates that we are marking the cache as dirty instead of incrementing a mysterious integer. (In reply to Alex Christensen from comment #4) > Comment on attachment 319422 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=319422&action=review > > > Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp:236 > > + ++m_updateCounter; > > We need to make sure to never forget to increment the updateCounter. Maybe > we could wrap this in a function that indicates that we are marking the > cache as dirty instead of incrementing a mysterious integer. Sounds good, will do this. I will try to update the decoders as a follow-up patch. Created attachment 319534 [details]
Patch for landing
Comment on attachment 319534 [details] Patch for landing Clearing flags on attachment: 319534 Committed r221454: <http://trac.webkit.org/changeset/221454> All reviewed patches have been landed. Closing bug. |