Use downcast in createLinkPreloadResourceClient
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Feb 2018 18:37:11 +0000 (18:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Feb 2018 18:37:11 +0000 (18:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182488

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-05
Reviewed by Antti Koivisto.

No observable change of behavior.

* loader/LinkLoader.cpp:
(WebCore::createLinkPreloadResourceClient):

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

Source/WebCore/ChangeLog
Source/WebCore/loader/LinkLoader.cpp

index a625ff6..e00df56 100644 (file)
@@ -1,3 +1,15 @@
+2018-02-05  Youenn Fablet  <youenn@apple.com>
+
+        Use downcast in createLinkPreloadResourceClient
+        https://bugs.webkit.org/show_bug.cgi?id=182488
+
+        Reviewed by Antti Koivisto.
+
+        No observable change of behavior.
+
+        * loader/LinkLoader.cpp:
+        (WebCore::createLinkPreloadResourceClient):
+
 2018-02-05  Chris Dumez  <cdumez@apple.com>
 
         Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https.html is flaky
index d0378a8..1608c30 100644 (file)
@@ -139,13 +139,13 @@ static std::unique_ptr<LinkPreloadResourceClient> createLinkPreloadResourceClien
 {
     switch (resource.type()) {
     case CachedResource::ImageResource:
-        return LinkPreloadImageResourceClient::create(loader, static_cast<CachedImage&>(resource));
+        return LinkPreloadImageResourceClient::create(loader, downcast<CachedImage>(resource));
     case CachedResource::Script:
-        return LinkPreloadScriptResourceClient::create(loader, static_cast<CachedScript&>(resource));
+        return LinkPreloadScriptResourceClient::create(loader, downcast<CachedScript>(resource));
     case CachedResource::CSSStyleSheet:
-        return LinkPreloadStyleResourceClient::create(loader, static_cast<CachedCSSStyleSheet&>(resource));
+        return LinkPreloadStyleResourceClient::create(loader, downcast<CachedCSSStyleSheet>(resource));
     case CachedResource::FontResource:
-        return LinkPreloadFontResourceClient::create(loader, static_cast<CachedFont&>(resource));
+        return LinkPreloadFontResourceClient::create(loader, downcast<CachedFont>(resource));
     case CachedResource::MediaResource:
         if (!RuntimeEnabledFeatures::sharedFeatures().mediaPreloadingEnabled())
             ASSERT_NOT_REACHED();
@@ -154,7 +154,7 @@ static std::unique_ptr<LinkPreloadResourceClient> createLinkPreloadResourceClien
     case CachedResource::TextTrackResource:
 #endif
     case CachedResource::RawResource:
-        return LinkPreloadRawResourceClient::create(loader, static_cast<CachedRawResource&>(resource));
+        return LinkPreloadRawResourceClient::create(loader, downcast<CachedRawResource>(resource));
     case CachedResource::MainResource:
     case CachedResource::Icon:
 #if ENABLE(SVG_FONTS)