Skip to content

Update PublicSuffixStore::topPrivatelyControlledDomain() to take in a StringView#28866

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
cdumez:274480_topPrivatelyControlledDomain_StringView
May 22, 2024
Merged

Update PublicSuffixStore::topPrivatelyControlledDomain() to take in a StringView#28866
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
cdumez:274480_topPrivatelyControlledDomain_StringView

Conversation

@cdumez
Copy link
Contributor

@cdumez cdumez commented May 21, 2024

3a59245

Update PublicSuffixStore::topPrivatelyControlledDomain() to take in a StringView
https://bugs.webkit.org/show_bug.cgi?id=274480

Reviewed by Darin Adler.

Update PublicSuffixStore::topPrivatelyControlledDomain() to take in a StringView
instead of a String. Most call sites have a StringView and we don't ever need to
construct a String if the host is already in the cache.

* Source/WTF/wtf/HashMap.h:
(WTF::HashMapEnsureTranslatorAdapter::hash):
(WTF::HashMapEnsureTranslatorAdapter::equal):
(WTF::HashMapEnsureTranslatorAdapter::translate):
(WTF::TableTraitsArg>::ensure):
* Source/WTF/wtf/text/StringHash.h:
(WTF::ASCIICaseInsensitiveStringViewHashTranslator::translate):
* Source/WTF/wtf/text/StringImpl.h:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::urlForBindings const):
* Source/WebCore/page/Quirks.cpp:
(WebCore::isYahooMail):
(WebCore::Quirks::shouldHideSearchFieldResultsButton const):
(WebCore::Quirks::isAmazon const):
(WebCore::Quirks::isGoogleMaps const):
* Source/WebCore/platform/PublicSuffixStore.cpp:
(WebCore::PublicSuffixStore::topPrivatelyControlledDomain const):
* Source/WebCore/platform/PublicSuffixStore.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetStateAfterProcessTermination):
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
(WebKit::WebProcessProxy::didExceedMemoryFootprintThreshold):
* Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp:
(TestWebKitAPI::TEST(WTF_HashMap, Ensure_Translator)):

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

79ff96d

Misc iOS, tvOS & watchOS macOS Linux Windows
❌ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 wincairo-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🛠 🧪 jsc 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 🧪 jsc-arm64 ✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 tv-sim ✅ 🧪 mac-wk2-stress 🧪 api-gtk
✅ 🛠 watch ✅ 🛠 jsc-armv7
✅ 🛠 🧪 unsafe-merge ✅ 🛠 watch-sim ✅ 🧪 jsc-armv7-tests

@cdumez cdumez self-assigned this May 21, 2024
@cdumez cdumez added the WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit). label May 21, 2024
@cdumez cdumez force-pushed the 274480_topPrivatelyControlledDomain_StringView branch from 70a59a9 to 79ff96d Compare May 21, 2024 21:49
@cdumez cdumez marked this pull request as ready for review May 21, 2024 23:15
@cdumez cdumez requested a review from rniwa as a code owner May 21, 2024 23:15
@cdumez cdumez requested review from darinadler and removed request for rniwa May 21, 2024 23:15
@cdumez cdumez added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label May 22, 2024
… StringView

https://bugs.webkit.org/show_bug.cgi?id=274480

Reviewed by Darin Adler.

Update PublicSuffixStore::topPrivatelyControlledDomain() to take in a StringView
instead of a String. Most call sites have a StringView and we don't ever need to
construct a String if the host is already in the cache.

* Source/WTF/wtf/HashMap.h:
(WTF::HashMapEnsureTranslatorAdapter::hash):
(WTF::HashMapEnsureTranslatorAdapter::equal):
(WTF::HashMapEnsureTranslatorAdapter::translate):
(WTF::TableTraitsArg>::ensure):
* Source/WTF/wtf/text/StringHash.h:
(WTF::ASCIICaseInsensitiveStringViewHashTranslator::translate):
* Source/WTF/wtf/text/StringImpl.h:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::urlForBindings const):
* Source/WebCore/page/Quirks.cpp:
(WebCore::isYahooMail):
(WebCore::Quirks::shouldHideSearchFieldResultsButton const):
(WebCore::Quirks::isAmazon const):
(WebCore::Quirks::isGoogleMaps const):
* Source/WebCore/platform/PublicSuffixStore.cpp:
(WebCore::PublicSuffixStore::topPrivatelyControlledDomain const):
* Source/WebCore/platform/PublicSuffixStore.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetStateAfterProcessTermination):
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
(WebKit::WebProcessProxy::didExceedMemoryFootprintThreshold):
* Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp:
(TestWebKitAPI::TEST(WTF_HashMap, Ensure_Translator)):

Canonical link: https://commits.webkit.org/279092@main
@webkit-commit-queue webkit-commit-queue force-pushed the 274480_topPrivatelyControlledDomain_StringView branch from 79ff96d to 3a59245 Compare May 22, 2024 00:57
@webkit-commit-queue
Copy link
Collaborator

Committed 279092@main (3a59245): https://commits.webkit.org/279092@main

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

@webkit-commit-queue webkit-commit-queue merged commit 3a59245 into WebKit:main May 22, 2024
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants