Title: [290684] branches/safari-613-branch/Source/WebKit
Revision
290684
Author
[email protected]
Date
2022-03-01 15:48:53 -0800 (Tue, 01 Mar 2022)

Log Message

Cherry-pick r289380. rdar://problem/86904276

    Reduce allocations and increase thread safety of constructedPath
    https://bugs.webkit.org/show_bug.cgi?id=236286
    <rdar://86904276>

    Patch by Alex Christensen <[email protected]> on 2022-02-08
    Reviewed by Chris Dumez.

    * UIProcess/API/APIContentRuleListStore.cpp:
    (API::constructedPathPrefix):
    (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289380 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-613-branch/Source/WebKit/ChangeLog (290683 => 290684)


--- branches/safari-613-branch/Source/WebKit/ChangeLog	2022-03-01 23:48:50 UTC (rev 290683)
+++ branches/safari-613-branch/Source/WebKit/ChangeLog	2022-03-01 23:48:53 UTC (rev 290684)
@@ -1,3 +1,32 @@
+2022-02-28  Russell Epstein  <[email protected]>
+
+        Cherry-pick r289380. rdar://problem/86904276
+
+    Reduce allocations and increase thread safety of constructedPath
+    https://bugs.webkit.org/show_bug.cgi?id=236286
+    <rdar://86904276>
+    
+    Patch by Alex Christensen <[email protected]> on 2022-02-08
+    Reviewed by Chris Dumez.
+    
+    * UIProcess/API/APIContentRuleListStore.cpp:
+    (API::constructedPathPrefix):
+    (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-02-08  Alex Christensen  <[email protected]>
+
+            Reduce allocations and increase thread safety of constructedPath
+            https://bugs.webkit.org/show_bug.cgi?id=236286
+            <rdar://86904276>
+
+            Reviewed by Chris Dumez.
+
+            * UIProcess/API/APIContentRuleListStore.cpp:
+            (API::constructedPathPrefix):
+            (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers):
+
 2022-02-16  Russell Epstein  <[email protected]>
 
         Cherry-pick r289875. rdar://problem/88358696

Modified: branches/safari-613-branch/Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp (290683 => 290684)


--- branches/safari-613-branch/Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp	2022-03-01 23:48:50 UTC (rev 290683)
+++ branches/safari-613-branch/Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp	2022-03-01 23:48:53 UTC (rev 290684)
@@ -80,10 +80,10 @@
 ContentRuleListStore::~ContentRuleListStore() = default;
 
 // FIXME: Remove legacyFilename in 2022 or 2023 after users have had a chance to run the updating logic.
-static const WTF::String& constructedPathPrefix(bool legacyFilename)
+static const char* constructedPathPrefix(bool legacyFilename)
 {
-    static NeverDestroyed<WTF::String> prefix("ContentRuleList-");
-    static NeverDestroyed<WTF::String> legacyPrefix("ContentExtension-");
+    static auto* prefix("ContentRuleList-");
+    static auto* legacyPrefix("ContentExtension-");
     if (legacyFilename)
         return legacyPrefix;
     return prefix;
@@ -521,9 +521,9 @@
     ASSERT(RunLoop::isMain());
     m_readQueue->dispatch([protectedThis = Ref { *this }, storePath = m_storePath.isolatedCopy(), completionHandler = WTFMove(completionHandler)]() mutable {
         auto prefix = constructedPathPrefix(false /*legacy*/);
-        auto prefixLength = prefix.length();
+        auto prefixLength = strlen(prefix);
         auto legacyPrefix = constructedPathPrefix(true /*legacy*/);
-        auto legacyPrefixLength = legacyPrefix.length();
+        auto legacyPrefixLength = strlen(legacyPrefix);
 
         Vector<WTF::String> identifiers;
         for (auto& fileName : listDirectory(storePath)) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to