Skip to content
Permalink
Browse files
Use downcast in createLinkPreloadResourceClient
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):

Canonical link: https://commits.webkit.org/198284@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228103 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
youennf authored and webkit-commit-queue committed Feb 5, 2018
1 parent 83467ef commit 7c19b6cd2be9baa6b44aecf2b129f0f27ee579b8
Showing with 17 additions and 5 deletions.
  1. +12 −0 Source/WebCore/ChangeLog
  2. +5 −5 Source/WebCore/loader/LinkLoader.cpp
@@ -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
@@ -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)

0 comments on commit 7c19b6c

Please sign in to comment.