Changeset 206017 in webkit


Ignore:
Timestamp:
Sep 16, 2016 2:44:07 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

CachedFont do not need to be updated according Origin/Fetch mode
https://bugs.webkit.org/show_bug.cgi?id=161909

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-16
Reviewed by Sam Weinig.

No change of behavior.

  • loader/cache/CachedFont.h: Ensuring CachedFont is not reused.
  • loader/cache/CachedResourceLoader.cpp:

(WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Doing direct reuse for CachedFont as WebKit is ignoring CORS for all fonts related stuff.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r206016 r206017  
     12016-09-16  Youenn Fablet  <youenn@apple.com>
     2
     3        CachedFont do not need to be updated according Origin/Fetch mode
     4        https://bugs.webkit.org/show_bug.cgi?id=161909
     5
     6        Reviewed by Sam Weinig.
     7
     8        No change of behavior.
     9
     10        * loader/cache/CachedFont.h: Ensuring CachedFont is not reused.
     11        * loader/cache/CachedResourceLoader.cpp:
     12        (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Doing direct reuse for CachedFont as WebKit is ignoring CORS for all fonts related stuff.
     13
    1142016-09-16  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/Source/WebCore/loader/cache/CachedFont.h

    r206016 r206017  
    6666
    6767    void load(CachedResourceLoader&) override;
     68    NO_RETURN_DUE_TO_ASSERT void setBodyDataFrom(const CachedResource&) final { ASSERT_NOT_REACHED(); }
    6869
    6970    void didAddClient(CachedResourceClient*) override;
  • trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp

    r206016 r206017  
    541541bool CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest(const CachedResource& resource, const CachedResourceRequest& request)
    542542{
    543     // FIXME: We should progressively extend this to other reusable resources
    544     if (resource.type() != CachedResource::Type::ImageResource && resource.type() != CachedResource::Type::Script && resource.type() != CachedResource::Type::TextTrackResource && resource.type() != CachedResource::Type::CSSStyleSheet)
     543    if (resource.type() == CachedResource::Type::FontResource || resource.type() == CachedResource::Type::SVGFontResource) {
     544        // WebKit is not supporting CORS for fonts (https://bugs.webkit.org/show_bug.cgi?id=86817), no need to update the resource before reusing it.
    545545        return false;
    546 
     546    }
     547
     548    // FIXME: We should enable resource reuse for these resource types
     549    switch (resource.type()) {
     550    case CachedResource::SVGDocumentResource:
     551        return false;
     552    case CachedResource::MediaResource:
     553        return false;
     554    case CachedResource::RawResource:
     555        return false;
     556    case CachedResource::MainResource:
     557        return false;
     558#if ENABLE(XSLT)
     559    case CachedResource::XSLStyleSheet:
     560        return false;
     561#endif
     562#if ENABLE(LINK_PREFETCH)
     563    case CachedResource::LinkPrefetch:
     564        return false;
     565    case CachedResource::LinkSubresource:
     566        return false;
     567#endif
     568    default:
     569        break;
     570    }
    547571    return resource.options().mode != request.options().mode || request.resourceRequest().httpOrigin() != resource.resourceRequest().httpOrigin();
    548572}
Note: See TracChangeset for help on using the changeset viewer.