Improve use of NeverDestroyed
[WebKit-https.git] / Source / WebCore / loader / ContentFilter.cpp
index 85c5271..c1a8c85 100644 (file)
@@ -253,14 +253,10 @@ void ContentFilter::deliverResourceData(CachedResource& resource)
 
 static const URL& blockedPageURL()
 {
-    static LazyNeverDestroyed<URL> blockedPageURL;
-    static std::once_flag onceFlag;
-    std::call_once(onceFlag, [] {
+    static const auto blockedPageURL = makeNeverDestroyed([] () -> URL {
         auto webCoreBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebCore"));
-        auto blockedPageCFURL = adoptCF(CFBundleCopyResourceURL(webCoreBundle, CFSTR("ContentFilterBlockedPage"), CFSTR("html"), nullptr));
-        blockedPageURL.construct(blockedPageCFURL.get());
-    });
-
+        return adoptCF(CFBundleCopyResourceURL(webCoreBundle, CFSTR("ContentFilterBlockedPage"), CFSTR("html"), nullptr)).get();
+    }());
     return blockedPageURL;
 }