Changeset 149079 in webkit


Ignore:
Timestamp:
Apr 24, 2013, 5:17:16 PM (12 years ago)
Author:
beidson@apple.com
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:
Location:
trunk/Source/WebCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r149070 r149079  
     12013-04-24  Brady Eidson  <beidson@apple.com>
     2
     3        Implementors of CachedResource subclasses should be forced to decide if encoded data can be replaced.
     4        https://bugs.webkit.org/show_bug.cgi?id=115140
     5
     6        Reviewed by Beth Dakin.
     7
     8        No new tests (No behavior change).
     9
     10        This makes mayTryReplaceEncodedData() return false in CachedResource, but overrides to true
     11        in all CachedResource subclasses besides CachedFont (which already has an implementation).
     12
     13        * loader/cache/CachedCSSStyleSheet.h:
     14        * loader/cache/CachedImage.h:
     15        * loader/cache/CachedRawResource.h:
     16        * loader/cache/CachedResource.h:
     17        * loader/cache/CachedSVGDocument.h:
     18        * loader/cache/CachedScript.h:
     19        * loader/cache/CachedShader.h:
     20        * loader/cache/CachedTextTrack.h:
     21        * loader/cache/CachedXSLStyleSheet.h:
     22
    1232013-04-24  Brady Eidson  <beidson@apple.com>
    224
  • trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h

    r148921 r149079  
    5757        bool canUseSheet(bool enforceMIMEType, bool* hasValidMIMEType) const;
    5858        virtual PurgePriority purgePriority() const { return PurgeLast; }
     59        virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
    5960
    6061    protected:
  • trunk/Source/WebCore/loader/cache/CachedImage.h

    r148921 r149079  
    109109
    110110    virtual void switchClientsToRevalidatedResource() OVERRIDE;
     111    virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
    111112
    112113    typedef pair<IntSize, float> SizeAndZoom;
  • trunk/Source/WebCore/loader/cache/CachedRawResource.h

    r148921 r149079  
    6262
    6363    virtual void switchClientsToRevalidatedResource() OVERRIDE;
     64    virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
    6465
    6566    unsigned long m_identifier;
  • trunk/Source/WebCore/loader/cache/CachedResource.h

    r149070 r149079  
    297297
    298298    virtual PurgePriority purgePriority() const { return PurgeDefault; }
    299     virtual bool mayTryReplaceEncodedData() const { return true; }
     299    virtual bool mayTryReplaceEncodedData() const { return false; }
    300300
    301301    double currentAge() const;
  • trunk/Source/WebCore/loader/cache/CachedSVGDocument.h

    r148921 r149079  
    4646    RefPtr<SVGDocument> m_document;
    4747    RefPtr<TextResourceDecoder> m_decoder;
     48
     49private:
     50    virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
    4851};
    4952
  • trunk/Source/WebCore/loader/cache/CachedScript.h

    r148921 r149079  
    5353    private:
    5454        virtual PurgePriority purgePriority() const { return PurgeLast; }
     55        virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
    5556
    5657        String m_script;
  • trunk/Source/WebCore/loader/cache/CachedShader.h

    r148921 r149079  
    4848
    4949private:
     50    virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
     51
    5052    RefPtr<TextResourceDecoder> m_decoder;
    5153    String m_shaderString;
  • trunk/Source/WebCore/loader/cache/CachedTextTrack.h

    r130983 r149079  
    4040
    4141    virtual void data(PassRefPtr<ResourceBuffer> data, bool allDataReceived);
     42
     43private:
     44    virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
    4245};
    4346
  • trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h

    r148921 r149079  
    5353        String m_sheet;
    5454        RefPtr<TextResourceDecoder> m_decoder;
     55
     56    private:
     57        virtual bool mayTryReplaceEncodedData() const OVERRIDE { return true; }
    5558    };
    5659
Note: See TracChangeset for help on using the changeset viewer.