RESOLVED FIXED 208610
Construct fewer unnecessary temporary WebProcessPool objects in WebsiteDataStore implementation
https://bugs.webkit.org/show_bug.cgi?id=208610
Summary Construct fewer unnecessary temporary WebProcessPool objects in WebsiteDataSt...
Chris Dumez
Reported 2020-03-04 15:38:35 PST
Construct less unnecessary temporary WebProcessPool objects in WebsiteDataStore implementation.
Attachments
Patch (32.75 KB, patch)
2020-03-04 16:12 PST, Chris Dumez
no flags
Patch (32.75 KB, patch)
2020-03-04 16:50 PST, Chris Dumez
no flags
Patch (33.12 KB, patch)
2020-03-04 17:09 PST, Chris Dumez
no flags
Patch (33.12 KB, patch)
2020-03-04 17:16 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2020-03-04 16:12:49 PST
Chris Dumez
Comment 2 2020-03-04 16:50:21 PST
Said Abou-Hallawa
Comment 3 2020-03-04 17:05:45 PST
Comment on attachment 392510 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=392510&action=review > Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1380 > - for (auto& processPool : ensureProcessPools()) { > + for (auto& processPool : processPools()) { > if (auto* process = processPool->networkProcess()) { > process->isRegisteredAsSubresourceUnder(m_sessionID, WebCore::RegistrableDomain { subresourceURL }, WebCore::RegistrableDomain { topFrameURL }, WTFMove(completionHandler)); > - break; > - } else { > - ASSERT_NOT_REACHED(); > - completionHandler(false); > - break; > + return; > } > + break; > } > + completionHandler(false); I am not sure what this function is supposed to do. Does it expect (processPools().size() == 1 and processPools()[0]->networkProcess() != nullptr)? if this is the case why do we use a for-loop? > Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1481 > + completionHandler(); completionHandler is moved above when creating callbackAggregator.
Chris Dumez
Comment 4 2020-03-04 17:09:30 PST
(In reply to Said Abou-Hallawa from comment #3) > Comment on attachment 392510 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=392510&action=review > > > Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1380 > > - for (auto& processPool : ensureProcessPools()) { > > + for (auto& processPool : processPools()) { > > if (auto* process = processPool->networkProcess()) { > > process->isRegisteredAsSubresourceUnder(m_sessionID, WebCore::RegistrableDomain { subresourceURL }, WebCore::RegistrableDomain { topFrameURL }, WTFMove(completionHandler)); > > - break; > > - } else { > > - ASSERT_NOT_REACHED(); > > - completionHandler(false); > > - break; > > + return; > > } > > + break; > > } > > + completionHandler(false); > > I am not sure what this function is supposed to do. Does it expect > (processPools().size() == 1 and processPools()[0]->networkProcess() != > nullptr)? if this is the case why do we use a for-loop? > > > Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1481 > > + completionHandler(); > > completionHandler is moved above when creating callbackAggregator. Thanks for catching this. Will fix before landing.
Chris Dumez
Comment 5 2020-03-04 17:09:46 PST
WebKit Commit Bot
Comment 6 2020-03-04 17:12:26 PST
Comment on attachment 392514 [details] Patch Rejecting attachment 392514 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-03', 'validate-changelog', '--check-oops', '--non-interactive', 392514, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit ChangeLog entry in Source/WebKit/ChangeLog contains OOPS!. Full output: https://webkit-queues.webkit.org/results/13333735
Chris Dumez
Comment 7 2020-03-04 17:16:02 PST
WebKit Commit Bot
Comment 8 2020-03-04 18:04:54 PST
Comment on attachment 392515 [details] Patch Clearing flags on attachment: 392515 Committed r257893: <https://trac.webkit.org/changeset/257893>
WebKit Commit Bot
Comment 9 2020-03-04 18:04:56 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10 2020-03-04 18:05:18 PST
Note You need to log in before you can comment on or make changes to this bug.