Title: [206017] trunk/Source/WebCore
Revision
206017
Author
commit-qu...@webkit.org
Date
2016-09-16 02:44:07 -0700 (Fri, 16 Sep 2016)

Log 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 <you...@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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (206016 => 206017)


--- trunk/Source/WebCore/ChangeLog	2016-09-16 08:56:54 UTC (rev 206016)
+++ trunk/Source/WebCore/ChangeLog	2016-09-16 09:44:07 UTC (rev 206017)
@@ -1,5 +1,18 @@
 2016-09-16  Youenn Fablet  <you...@apple.com>
 
+        CachedFont do not need to be updated according Origin/Fetch mode
+        https://bugs.webkit.org/show_bug.cgi?id=161909
+
+        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.
+
+2016-09-16  Youenn Fablet  <you...@apple.com>
+
         CachedResource should efficiently construct its ResourceRequest
         https://bugs.webkit.org/show_bug.cgi?id=161609
 

Modified: trunk/Source/WebCore/loader/cache/CachedFont.h (206016 => 206017)


--- trunk/Source/WebCore/loader/cache/CachedFont.h	2016-09-16 08:56:54 UTC (rev 206016)
+++ trunk/Source/WebCore/loader/cache/CachedFont.h	2016-09-16 09:44:07 UTC (rev 206017)
@@ -65,6 +65,7 @@
     bool mayTryReplaceEncodedData() const override;
 
     void load(CachedResourceLoader&) override;
+    NO_RETURN_DUE_TO_ASSERT void setBodyDataFrom(const CachedResource&) final { ASSERT_NOT_REACHED(); }
 
     void didAddClient(CachedResourceClient*) override;
     void finishLoading(SharedBuffer*) override;

Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (206016 => 206017)


--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2016-09-16 08:56:54 UTC (rev 206016)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2016-09-16 09:44:07 UTC (rev 206017)
@@ -540,10 +540,34 @@
 
 bool CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest(const CachedResource& resource, const CachedResourceRequest& request)
 {
-    // FIXME: We should progressively extend this to other reusable resources
-    if (resource.type() != CachedResource::Type::ImageResource && resource.type() != CachedResource::Type::Script && resource.type() != CachedResource::Type::TextTrackResource && resource.type() != CachedResource::Type::CSSStyleSheet)
+    if (resource.type() == CachedResource::Type::FontResource || resource.type() == CachedResource::Type::SVGFontResource) {
+        // 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.
         return false;
+    }
 
+    // FIXME: We should enable resource reuse for these resource types
+    switch (resource.type()) {
+    case CachedResource::SVGDocumentResource:
+        return false;
+    case CachedResource::MediaResource:
+        return false;
+    case CachedResource::RawResource:
+        return false;
+    case CachedResource::MainResource:
+        return false;
+#if ENABLE(XSLT)
+    case CachedResource::XSLStyleSheet:
+        return false;
+#endif
+#if ENABLE(LINK_PREFETCH)
+    case CachedResource::LinkPrefetch:
+        return false;
+    case CachedResource::LinkSubresource:
+        return false;
+#endif
+    default:
+        break;
+    }
     return resource.options().mode != request.options().mode || request.resourceRequest().httpOrigin() != resource.resourceRequest().httpOrigin();
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to