This will allow cache storage per session/websitedatastore. Ephemeral sessions will have a specific null path so that no access is done at all.
Created attachment 319255 [details] Patch
Comment on attachment 319255 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=319255&action=review > Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp:53 > + auto addResult = globalEngineMap().add(sessionID, nullptr); This can probably still use ensure. > Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp:357 > + channel->read(0, std::numeric_limits<size_t>::max(), m_ioQueue.get(), [callback = WTFMove(callback)](const Data& data, int error) mutable { > + RunLoop::main().dispatch([callback = WTFMove(callback), data, error]() mutable { Will this create a copy of data, or just capture a reference to something that will probably be gone?
Comment on attachment 319255 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=319255&action=review >> Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp:53 >> + auto addResult = globalEngineMap().add(sessionID, nullptr); > > This can probably still use ensure. I tried it and it was crashing. I haven't investigated precisely the reason for this crash. >> Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp:357 >> + RunLoop::main().dispatch([callback = WTFMove(callback), data, error]() mutable { > > Will this create a copy of data, or just capture a reference to something that will probably be gone? It will capture data by copy which will do like capturing a Ref. I guess the lambda could take a Data&& instead.
Comment on attachment 319255 [details] Patch Clearing flags on attachment: 319255 Committed r221315: <http://trac.webkit.org/changeset/221315>
All reviewed patches have been landed. Closing bug.
<rdar://problem/34142875>