Title: [265466] branches/safari-610.1.25.10-branch/Source/WTF
Revision
265466
Author
[email protected]
Date
2020-08-10 16:47:45 -0700 (Mon, 10 Aug 2020)

Log Message

Cherry-pick r265252. rdar://problem/66645897

    about: scheme URL constants should be backed by StaticStringImpl
    https://bugs.webkit.org/show_bug.cgi?id=215113

    Reviewed by Darin Adler.

    * wtf/URL.cpp:
    (WTF::aboutBlankURL):
    (WTF::aboutSrcDocURL):

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

Modified Paths

Diff

Modified: branches/safari-610.1.25.10-branch/Source/WTF/ChangeLog (265465 => 265466)


--- branches/safari-610.1.25.10-branch/Source/WTF/ChangeLog	2020-08-10 23:47:43 UTC (rev 265465)
+++ branches/safari-610.1.25.10-branch/Source/WTF/ChangeLog	2020-08-10 23:47:45 UTC (rev 265466)
@@ -1,3 +1,31 @@
+2020-08-10  Alan Coon  <[email protected]>
+
+        Cherry-pick r265252. rdar://problem/66645897
+
+    about: scheme URL constants should be backed by StaticStringImpl
+    https://bugs.webkit.org/show_bug.cgi?id=215113
+    
+    Reviewed by Darin Adler.
+    
+    * wtf/URL.cpp:
+    (WTF::aboutBlankURL):
+    (WTF::aboutSrcDocURL):
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-08-04  Alex Christensen  <[email protected]>
+
+            about: scheme URL constants should be backed by StaticStringImpl
+            https://bugs.webkit.org/show_bug.cgi?id=215113
+
+            Reviewed by Darin Adler.
+
+            * wtf/URL.cpp:
+            (WTF::aboutBlankURL):
+            (WTF::aboutSrcDocURL):
+
 2020-08-05  Russell Epstein  <[email protected]>
 
         Revert r265115. rdar://problem/66552761

Modified: branches/safari-610.1.25.10-branch/Source/WTF/wtf/URL.cpp (265465 => 265466)


--- branches/safari-610.1.25.10-branch/Source/WTF/wtf/URL.cpp	2020-08-10 23:47:43 UTC (rev 265465)
+++ branches/safari-610.1.25.10-branch/Source/WTF/wtf/URL.cpp	2020-08-10 23:47:45 UTC (rev 265466)
@@ -820,14 +820,24 @@
 
 const URL& aboutBlankURL()
 {
-    static NeverDestroyed<URL> staticBlankURL(URL(), "about:blank"_s);
+    static NeverDestroyed<URL> staticBlankURL;
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [&] {
+        static constexpr const char* aboutBlank = "about:blank";
+        staticBlankURL.get() = URL(URL(), StringImpl::createStaticStringImpl(aboutBlank, strlen(aboutBlank)));
+    });
     return staticBlankURL;
 }
 
 const URL& aboutSrcDocURL()
 {
-    static NeverDestroyed<URL> staticAboutSrcDocURL(URL(), "about:srcdoc"_s);
-    return staticAboutSrcDocURL;
+    static NeverDestroyed<URL> staticSrcDocURL;
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [&] {
+        static constexpr const char* aboutSrcDoc = "about:srcdoc";
+        staticSrcDocURL.get() = URL(URL(), StringImpl::createStaticStringImpl(aboutSrcDoc, strlen(aboutSrcDoc)));
+    });
+    return staticSrcDocURL;
 }
 
 bool URL::protocolIsAbout() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to