Changeset 110976 in webkit


Ignore:
Timestamp:
Mar 16, 2012 2:40:53 AM (12 years ago)
Author:
Nate Chapin
Message:

Remove duplicate error() impls in CachedResource subclasses
https://bugs.webkit.org/show_bug.cgi?id=81161

Reviewed by Alexey Proskuryakov.

No new tests, refactor only.

  • loader/cache/CachedCSSStyleSheet.cpp:
  • loader/cache/CachedCSSStyleSheet.h:
  • loader/cache/CachedFont.cpp:
  • loader/cache/CachedFont.h:
  • loader/cache/CachedImage.cpp:
  • loader/cache/CachedResource.h: Make checkNotify()

virtual, so the right checkNotify() gets called in error().

  • loader/cache/CachedScript.cpp:
  • loader/cache/CachedScript.h:
  • loader/cache/CachedXSLStyleSheet.cpp:
  • loader/cache/CachedXSLStyleSheet.h:
Location:
trunk/Source/WebCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r110973 r110976  
     12012-03-16  Nate Chapin  <japhet@chromium.org>
     2
     3        Remove duplicate error() impls in CachedResource subclasses
     4        https://bugs.webkit.org/show_bug.cgi?id=81161
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        No new tests, refactor only.
     9
     10        * loader/cache/CachedCSSStyleSheet.cpp:
     11        * loader/cache/CachedCSSStyleSheet.h:
     12        * loader/cache/CachedFont.cpp:
     13        * loader/cache/CachedFont.h:
     14        * loader/cache/CachedImage.cpp:
     15        * loader/cache/CachedResource.h: Make checkNotify()
     16             virtual, so the right checkNotify() gets called in error().
     17        * loader/cache/CachedScript.cpp:
     18        * loader/cache/CachedScript.h:
     19        * loader/cache/CachedXSLStyleSheet.cpp:
     20        * loader/cache/CachedXSLStyleSheet.h:
     21
    1222012-03-16  Dana Jansens  <danakj@chromium.org>
    223
  • trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp

    r97491 r110976  
    118118}
    119119
    120 void CachedCSSStyleSheet::error(CachedResource::Status status)
    121 {
    122     setStatus(status);
    123     ASSERT(errorOccurred());
    124     setLoading(false);
    125     checkNotify();
    126 }
    127 
    128120bool CachedCSSStyleSheet::canUseSheet(bool enforceMIMEType, bool* hasValidMIMEType) const
    129121{
  • trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h

    r87239 r110976  
    5050        virtual String encoding() const;
    5151        virtual void data(PassRefPtr<SharedBuffer> data, bool allDataReceived);
    52         virtual void error(CachedResource::Status);
    53 
    54         void checkNotify();
    5552   
    5653    private:
     
    5956
    6057    protected:
     58        virtual void checkNotify();
     59
    6160        RefPtr<TextResourceDecoder> m_decoder;
    6261        String m_decodedSheetText;
  • trunk/Source/WebCore/loader/cache/CachedFont.cpp

    r97491 r110976  
    199199}
    200200
    201 
    202 void CachedFont::error(CachedResource::Status status)
    203 {
    204     setStatus(status);
    205     ASSERT(errorOccurred());
    206     setLoading(false);
    207     checkNotify();
    208 }
    209 
    210 }
     201}
  • trunk/Source/WebCore/loader/cache/CachedFont.h

    r107715 r110976  
    5454    virtual void didAddClient(CachedResourceClient*);
    5555    virtual void data(PassRefPtr<SharedBuffer> data, bool allDataReceived);
    56     virtual void error(CachedResource::Status);
    5756
    5857    virtual void allClientsRemoved();
    59 
    60     void checkNotify();
    61 
    6258    void beginLoadIfNeeded(CachedResourceLoader* dl);
    6359    bool stillNeedsLoad() const { return !m_loadInitiated; }
     
    7268
    7369private:
     70    virtual void checkNotify();
    7471    FontCustomPlatformData* m_fontData;
    7572    bool m_loadInitiated;
  • trunk/Source/WebCore/loader/cache/CachedImage.cpp

    r105049 r110976  
    381381void CachedImage::error(CachedResource::Status status)
    382382{
     383    CachedResource::error(status);
    383384    checkShouldPaintBrokenImage();
    384385    clear();
    385     setStatus(status);
    386     ASSERT(errorOccurred());
    387386    m_data.clear();
    388387    notifyObservers();
    389     setLoading(false);
    390     checkNotify();
    391388}
    392389
  • trunk/Source/WebCore/loader/cache/CachedResource.h

    r108785 r110976  
    249249
    250250protected:
    251     void checkNotify();
     251    virtual void checkNotify();
    252252
    253253    void setEncodedSize(unsigned);
  • trunk/Source/WebCore/loader/cache/CachedScript.cpp

    r87239 r110976  
    105105}
    106106
    107 void CachedScript::error(CachedResource::Status status)
    108 {
    109     setStatus(status);
    110     ASSERT(errorOccurred());
    111     setLoading(false);
    112     checkNotify();
    113 }
    114 
    115107void CachedScript::destroyDecodedData()
    116108{
  • trunk/Source/WebCore/loader/cache/CachedScript.h

    r87239 r110976  
    5454        virtual String encoding() const;
    5555        virtual void data(PassRefPtr<SharedBuffer> data, bool allDataReceived);
    56         virtual void error(Status);
    5756
    5857        virtual void destroyDecodedData();
  • trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp

    r97491 r110976  
    8989}
    9090
    91 void CachedXSLStyleSheet::error(CachedResource::Status status)
    92 {
    93     setStatus(status);
    94     ASSERT(errorOccurred());
    95     setLoading(false);
    96     checkNotify();
    97 }
    98 
    9991#endif
    10092
  • trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h

    r87239 r110976  
    4747        virtual String encoding() const;
    4848        virtual void data(PassRefPtr<SharedBuffer> data, bool allDataReceived);
    49         virtual void error(CachedResource::Status);
    50        
    51         void checkNotify();
    5249       
    5350    protected:
     51        virtual void checkNotify();
     52
    5453        String m_sheet;
    5554        RefPtr<TextResourceDecoder> m_decoder;
Note: See TracChangeset for help on using the changeset viewer.