-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
declarativeNetRequest's content rule list should not use the identifi…
…er for the filename. https://webkit.org/b/266198 rdar://problem/119469953 Reviewed by Brian Weinstein and Alex Christensen. Removes the legacy filename support from APIContentRuleListStore, per the comment that it can be removed in 2022-2023. Adds methods to allow compile, lookup, and remove with an explicit file path. This allows the Web Extension dNR code to store the file at the path it desires, bypassing APIContentRuleListStore's automatic file management of an explicit storage directory for rule lists. Web Extensions store their rule list in a unique directory alongside other extension state files, so the rule list file name does not need be unique or contain the rule list identifier. * Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp: (API::constructedPath): Drop legacy file name support. Added RELEASE_ASSERT for base. (API::createExtension): Add some whitespace. (API::getContentRuleListSourceFromMappedFile): Ditto. (API::ContentRuleListStore::lookupContentRuleList): Call lookupContentRuleListFile. (API::ContentRuleListStore::lookupContentRuleListFile): Added. (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers): Call compileContentRuleListFile. (API::ContentRuleListStore::compileContentRuleList): Call compileContentRuleListFile. (API::ContentRuleListStore::compileContentRuleListFile): Added. (API::ContentRuleListStore::removeContentRuleList): Call removeContentRuleListFile. (API::ContentRuleListStore::removeContentRuleListFile): Added. (API::ContentRuleListStore::invalidateContentRuleListVersion): Drop false for legacy filename param. (API::ContentRuleListStore::getContentRuleListSource): Drop legacy file name support. * Source/WebKit/UIProcess/API/APIContentRuleListStore.h: * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm: (WebKit::WebExtensionContext::unloadDeclarativeNetRequestState): (WebKit::WebExtensionContext::declarativeNetRequestContentRuleListFilePath): Added. (WebKit::WebExtensionContext::addDeclarativeNetRequestRulesToPrivateUserContentControllers): Use API::ContentRuleListStore. (WebKit::WebExtensionContext::compileDeclarativeNetRequestRules): Ditto. (WebKit::WebExtensionContext::loadDeclarativeNetRequestRules): Ditto. (WebKit::WebExtensionContext::declarativeNetRequestRuleStore): Deleted. * Source/WebKit/UIProcess/Extensions/WebExtensionContext.h: * Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentRuleListNotification.mm: Deleted ContentRuleList.LegacyVersionAndName. Canonical link: https://commits.webkit.org/271903@main
- Loading branch information
Showing
6 changed files
with
82 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.