Title: [149079] trunk/Source/WebCore
Revision
149079
Author
beid...@apple.com
Date
2013-04-24 17:17:16 -0700 (Wed, 24 Apr 2013)

Log Message

Implementors of CachedResource subclasses should be forced to decide if encoded data can be replaced.
https://bugs.webkit.org/show_bug.cgi?id=115140

Reviewed by Beth Dakin.

No new tests (No behavior change).

This makes mayTryReplaceEncodedData() return false in CachedResource, but overrides to true
in all CachedResource subclasses besides CachedFont (which already has an implementation).

* loader/cache/CachedCSSStyleSheet.h:
* loader/cache/CachedImage.h:
* loader/cache/CachedRawResource.h:
* loader/cache/CachedResource.h:
* loader/cache/CachedSVGDocument.h:
* loader/cache/CachedScript.h:
* loader/cache/CachedShader.h:
* loader/cache/CachedTextTrack.h:
* loader/cache/CachedXSLStyleSheet.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (149078 => 149079)


--- trunk/Source/WebCore/ChangeLog	2013-04-25 00:10:15 UTC (rev 149078)
+++ trunk/Source/WebCore/ChangeLog	2013-04-25 00:17:16 UTC (rev 149079)
@@ -1,5 +1,27 @@
 2013-04-24  Brady Eidson  <beid...@apple.com>
 
+        Implementors of CachedResource subclasses should be forced to decide if encoded data can be replaced.
+        https://bugs.webkit.org/show_bug.cgi?id=115140
+
+        Reviewed by Beth Dakin.
+
+        No new tests (No behavior change).
+
+        This makes mayTryReplaceEncodedData() return false in CachedResource, but overrides to true
+        in all CachedResource subclasses besides CachedFont (which already has an implementation).
+
+        * loader/cache/CachedCSSStyleSheet.h:
+        * loader/cache/CachedImage.h:
+        * loader/cache/CachedRawResource.h:
+        * loader/cache/CachedResource.h:
+        * loader/cache/CachedSVGDocument.h:
+        * loader/cache/CachedScript.h:
+        * loader/cache/CachedShader.h:
+        * loader/cache/CachedTextTrack.h:
+        * loader/cache/CachedXSLStyleSheet.h:
+
+2013-04-24  Brady Eidson  <beid...@apple.com>
+
         Once a custom font is cached to disk, it starts failing to render until the page is refreshed.
         <rdar://problem/13622998> and https://bugs.webkit.org/show_bug.cgi?id=115131
 

Modified: trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h (149078 => 149079)


--- trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h	2013-04-25 00:10:15 UTC (rev 149078)
+++ trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h	2013-04-25 00:17:16 UTC (rev 149079)
@@ -56,6 +56,7 @@
     private:
         bool canUseSheet(bool enforceMIMEType, bool* hasValidMIMEType) const;
         virtual PurgePriority purgePriority() const { return PurgeLast; }
+        virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
 
     protected:
         virtual void checkNotify();

Modified: trunk/Source/WebCore/loader/cache/CachedImage.h (149078 => 149079)


--- trunk/Source/WebCore/loader/cache/CachedImage.h	2013-04-25 00:10:15 UTC (rev 149078)
+++ trunk/Source/WebCore/loader/cache/CachedImage.h	2013-04-25 00:17:16 UTC (rev 149079)
@@ -108,6 +108,7 @@
     void checkShouldPaintBrokenImage();
 
     virtual void switchClientsToRevalidatedResource() OVERRIDE;
+    virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
 
     typedef pair<IntSize, float> SizeAndZoom;
     typedef HashMap<const CachedImageClient*, SizeAndZoom> ContainerSizeRequests;

Modified: trunk/Source/WebCore/loader/cache/CachedRawResource.h (149078 => 149079)


--- trunk/Source/WebCore/loader/cache/CachedRawResource.h	2013-04-25 00:10:15 UTC (rev 149078)
+++ trunk/Source/WebCore/loader/cache/CachedRawResource.h	2013-04-25 00:17:16 UTC (rev 149079)
@@ -61,6 +61,7 @@
     virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent);
 
     virtual void switchClientsToRevalidatedResource() OVERRIDE;
+    virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
 
     unsigned long m_identifier;
 

Modified: trunk/Source/WebCore/loader/cache/CachedResource.h (149078 => 149079)


--- trunk/Source/WebCore/loader/cache/CachedResource.h	2013-04-25 00:10:15 UTC (rev 149078)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h	2013-04-25 00:17:16 UTC (rev 149079)
@@ -296,7 +296,7 @@
     void decodedDataDeletionTimerFired(Timer<CachedResource>*);
 
     virtual PurgePriority purgePriority() const { return PurgeDefault; }
-    virtual bool mayTryReplaceEncodedData() const { return true; }
+    virtual bool mayTryReplaceEncodedData() const { return false; }
 
     double currentAge() const;
     double freshnessLifetime() const;

Modified: trunk/Source/WebCore/loader/cache/CachedSVGDocument.h (149078 => 149079)


--- trunk/Source/WebCore/loader/cache/CachedSVGDocument.h	2013-04-25 00:10:15 UTC (rev 149078)
+++ trunk/Source/WebCore/loader/cache/CachedSVGDocument.h	2013-04-25 00:17:16 UTC (rev 149079)
@@ -45,6 +45,9 @@
 protected:
     RefPtr<SVGDocument> m_document;
     RefPtr<TextResourceDecoder> m_decoder;
+
+private:
+    virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/loader/cache/CachedScript.h (149078 => 149079)


--- trunk/Source/WebCore/loader/cache/CachedScript.h	2013-04-25 00:10:15 UTC (rev 149078)
+++ trunk/Source/WebCore/loader/cache/CachedScript.h	2013-04-25 00:17:16 UTC (rev 149079)
@@ -52,6 +52,7 @@
 
     private:
         virtual PurgePriority purgePriority() const { return PurgeLast; }
+        virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
 
         String m_script;
         RefPtr<TextResourceDecoder> m_decoder;

Modified: trunk/Source/WebCore/loader/cache/CachedShader.h (149078 => 149079)


--- trunk/Source/WebCore/loader/cache/CachedShader.h	2013-04-25 00:10:15 UTC (rev 149078)
+++ trunk/Source/WebCore/loader/cache/CachedShader.h	2013-04-25 00:17:16 UTC (rev 149079)
@@ -47,6 +47,8 @@
     void data(PassRefPtr<ResourceBuffer>, bool allDataReceived);
 
 private:
+    virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
+
     RefPtr<TextResourceDecoder> m_decoder;
     String m_shaderString;
 };

Modified: trunk/Source/WebCore/loader/cache/CachedTextTrack.h (149078 => 149079)


--- trunk/Source/WebCore/loader/cache/CachedTextTrack.h	2013-04-25 00:10:15 UTC (rev 149078)
+++ trunk/Source/WebCore/loader/cache/CachedTextTrack.h	2013-04-25 00:17:16 UTC (rev 149079)
@@ -39,6 +39,9 @@
     virtual ~CachedTextTrack();
 
     virtual void data(PassRefPtr<ResourceBuffer> data, bool allDataReceived);
+
+private:
+    virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
 };
 
 }

Modified: trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h (149078 => 149079)


--- trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h	2013-04-25 00:10:15 UTC (rev 149078)
+++ trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h	2013-04-25 00:17:16 UTC (rev 149079)
@@ -52,6 +52,9 @@
 
         String m_sheet;
         RefPtr<TextResourceDecoder> m_decoder;
+
+    private:
+        virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
     };
 
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to