Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch/delete data store identifiers on a background thread #10826

Conversation

szewai
Copy link
Contributor

@szewai szewai commented Feb 28, 2023

b085855

Fetch/delete data store identifiers on a background thread
https://bugs.webkit.org/show_bug.cgi?id=253113
rdar://106051983

Reviewed by Chris Dumez.

These involves disk operations that should be performed on background thread.

* Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::fetchAllDataStoreIdentifiers):
(WebKit::WebsiteDataStore::removeDataStoreWithIdentifier):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::websiteDataStoreIOQueue):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h:

Canonical link: https://commits.webkit.org/261187@main

59ba50c

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug   πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
  πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk1 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk2   πŸ§ͺ api-gtk
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch   πŸ§ͺ mac-wk2-stress
❌ πŸ›  πŸ§ͺ merge   πŸ›  watch-sim

@szewai szewai requested a review from cdumez as a code owner February 28, 2023 22:44
@szewai szewai self-assigned this Feb 28, 2023
@szewai szewai added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Feb 28, 2023
@szewai szewai force-pushed the eng/Fetchdelete-data-store-identifiers-on-a-background-thread branch from d72f566 to e4619f9 Compare March 2, 2023 23:11
@szewai szewai force-pushed the eng/Fetchdelete-data-store-identifiers-on-a-background-thread branch from e4619f9 to e76a28d Compare March 2, 2023 23:15
@szewai szewai requested a review from cdumez March 2, 2023 23:15
Copy link
Contributor

@cdumez cdumez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

completionHandler(WTFMove(identifiers));
websiteDataStoreIOQueue().dispatch([completionHandler = WTFMove(completionHandler), directory = defaultWebsiteDataStoreRootDirectory().isolatedCopy()]() mutable {
Vector<UUID> identifiers;
for (auto& identifierString : FileSystem::listDirectory(directory)) {
Copy link
Contributor

@cdumez cdumez Mar 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to use compactMap() for this. It would be a bit shorter and more efficient.

Likely something like:

auto identifiers = WTF::compactMap(FileSystem::listDirectory(directory), [](auto& identifierString) { return UUID::parse(identifierString); });

@szewai szewai force-pushed the eng/Fetchdelete-data-store-identifiers-on-a-background-thread branch from e76a28d to 482f28c Compare March 3, 2023 00:49
@szewai szewai force-pushed the eng/Fetchdelete-data-store-identifiers-on-a-background-thread branch from 482f28c to 59ba50c Compare March 3, 2023 18:14
@szewai szewai added the merge-queue Applied to send a pull request to merge-queue label Mar 3, 2023
@webkit-early-warning-system webkit-early-warning-system force-pushed the eng/Fetchdelete-data-store-identifiers-on-a-background-thread branch from 59ba50c to a17f673 Compare March 4, 2023 00:57
https://bugs.webkit.org/show_bug.cgi?id=253113
rdar://106051983

Reviewed by Chris Dumez.

These involves disk operations that should be performed on background thread.

* Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::fetchAllDataStoreIdentifiers):
(WebKit::WebsiteDataStore::removeDataStoreWithIdentifier):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::websiteDataStoreIOQueue):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h:

Canonical link: https://commits.webkit.org/261187@main
@webkit-early-warning-system webkit-early-warning-system force-pushed the eng/Fetchdelete-data-store-identifiers-on-a-background-thread branch from a17f673 to b085855 Compare March 4, 2023 01:01
@webkit-early-warning-system webkit-early-warning-system merged commit b085855 into WebKit:main Mar 4, 2023
@webkit-commit-queue
Copy link
Collaborator

Committed 261187@main (b085855): https://commits.webkit.org/261187@main

Reviewed commits have been landed. Closing PR #10826 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Mar 4, 2023
@szewai szewai deleted the eng/Fetchdelete-data-store-identifiers-on-a-background-thread branch March 7, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Bugs Unclassified bugs are placed in this component until the correct component can be determined.
Projects
None yet
4 participants