RESOLVED CONFIGURATION CHANGED 183669
Resource Load Statistics: Clean up network process calls in WebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=183669
Summary Resource Load Statistics: Clean up network process calls in WebsiteDataStore
John Wilander
Reported 2018-03-15 11:18:25 PDT
The recently added WebKit::WebsiteDataStore::removeAllStorageAccessHandler() doesn't have a callback so it can leverage the existing sendToNetworkingProcess() method. The functions that do have callbacks should do a null check before calling functions on WebKit::NetworkProcessProxy.
Attachments
Patch (8.78 KB, patch)
2018-03-15 11:32 PDT, John Wilander
achristensen: review-
Radar WebKit Bug Importer
Comment 1 2018-03-15 11:18:56 PDT
John Wilander
Comment 2 2018-03-15 11:32:44 PDT
Alex Christensen
Comment 3 2018-03-15 12:54:53 PDT
Comment on attachment 335867 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=335867&action=review > Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1201 > + for (auto& processPool : processPools()) { This looks like it only works with one processPool. The callback is moved into the first one, so if there is another one it will move a completion handler in an undefined state, probably nullptr. We should instead make a Vector<Ref<WebProcessPool>> and iterate it recursively, moving it into the next lambda each time until it's empty, then calling the completion handler in the last one. If there's no networkProcess, recursively continue or call the completion handler. This will ensure the completion handler is called once always and only once. > Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1211 > + networkProcess->getAllStorageAccessEntries(m_sessionID, WTFMove(callback)); ditto > Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1219 > + networkProcess->grantStorageAccess(m_sessionID, resourceDomain, firstPartyDomain, frameID, pageID, WTFMove(callback)); ditto
John Wilander
Comment 4 2018-03-15 13:09:48 PDT
(In reply to Alex Christensen from comment #3) > Comment on attachment 335867 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=335867&action=review > > > Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1201 > > + for (auto& processPool : processPools()) { > > This looks like it only works with one processPool. The callback is moved > into the first one, so if there is another one it will move a completion > handler in an undefined state, probably nullptr. We should instead make a > Vector<Ref<WebProcessPool>> and iterate it recursively, moving it into the > next lambda each time until it's empty, then calling the completion handler > in the last one. If there's no networkProcess, recursively continue or call > the completion handler. This will ensure the completion handler is called > once always and only once. > > > Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1211 > > + networkProcess->getAllStorageAccessEntries(m_sessionID, WTFMove(callback)); > > ditto > > > Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1219 > > + networkProcess->grantStorageAccess(m_sessionID, resourceDomain, firstPartyDomain, frameID, pageID, WTFMove(callback)); > > ditto True. I believe this was originally called just once. I'll have a look.
Note You need to log in before you can comment on or make changes to this bug.