Changeset 20242 in webkit


Ignore:
Timestamp:
Mar 16, 2007 3:29:52 PM (17 years ago)
Author:
hyatt
Message:

Fix for 13084, assertion failure in the Cache. Convert the client list
to a HashCountedSet so that multiple refs and derefs are allowed.

Fix RenderImage so that if it has the same image used as a background/border
and as the foreground that it will repaint properly (can be tested using
border-image and a foreground image).

Optimize list marker so that it doesn't waste time in the base class method,
since list markers don't support background or border images.

Reviewed by andersca

  • ChangeLog:
  • loader/CachedResource.cpp: (WebCore::CachedResource::ref):
  • loader/CachedResource.h:
  • loader/CachedResourceClientWalker.cpp: (WebCore::CachedResourceClientWalker::CachedResourceClientWalker):
  • loader/CachedResourceClientWalker.h:
  • rendering/RenderImage.cpp: (WebCore::RenderImage::imageChanged):
  • rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::imageChanged):
Location:
trunk/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r20240 r20242  
     12007-03-16  David Hyatt  <hyatt@apple.com>
     2
     3        Fix for 13084, assertion failure in the Cache.  Convert the client list
     4        to a HashCountedSet so that multiple refs and derefs are allowed.
     5
     6        Fix RenderImage so that if it has the same image used as a background/border
     7        and as the foreground that it will repaint properly (can be tested using
     8        border-image and a foreground image).
     9
     10        Optimize list marker so that it doesn't waste time in the base class method,
     11        since list markers don't support background or border images.
     12
     13        Reviewed by andersca
     14
     15        * ChangeLog:
     16        * loader/CachedResource.cpp:
     17        (WebCore::CachedResource::ref):
     18        * loader/CachedResource.h:
     19        * loader/CachedResourceClientWalker.cpp:
     20        (WebCore::CachedResourceClientWalker::CachedResourceClientWalker):
     21        * loader/CachedResourceClientWalker.h:
     22        * rendering/RenderImage.cpp:
     23        (WebCore::RenderImage::imageChanged):
     24        * rendering/RenderListMarker.cpp:
     25        (WebCore::RenderListMarker::imageChanged):
     26
    1272007-03-16  Geoffrey Garen  <ggaren@apple.com>
    228
  • trunk/WebCore/loader/CachedResource.cpp

    r20199 r20242  
    9595void CachedResource::ref(CachedResourceClient *c)
    9696{
    97     ASSERT(!m_clients.contains(c));
    9897    if (!referenced() && inCache())
    9998        cache()->addToLiveObjectSize(size());
  • trunk/WebCore/loader/CachedResource.h

    r20182 r20242  
    3333#include "ResourceResponse.h"
    3434#include "SharedBuffer.h"
    35 #include <wtf/HashSet.h>
     35#include <wtf/HashCountedSet.h>
    3636#include <wtf/Vector.h>
    3737#include <time.h>
     
    137137    void setEncodedSize(unsigned);
    138138
    139     HashSet<CachedResourceClient*> m_clients;
     139    HashCountedSet<CachedResourceClient*> m_clients;
    140140
    141141    String m_url;
  • trunk/WebCore/loader/CachedResourceClientWalker.cpp

    r15269 r20242  
    3131namespace WebCore {
    3232
    33 CachedResourceClientWalker::CachedResourceClientWalker(const HashSet<CachedResourceClient*>& set)
     33CachedResourceClientWalker::CachedResourceClientWalker(const HashCountedSet<CachedResourceClient*>& set)
    3434    : m_clientSet(set), m_clientVector(set.size()), m_index(0)
    3535{
    36     typedef HashSet<CachedResourceClient*>::const_iterator Iterator;
     36    typedef HashCountedSet<CachedResourceClient*>::const_iterator Iterator;
    3737    Iterator end = set.end();
    3838    size_t clientIndex = 0;
    3939    for (Iterator current = set.begin(); current != end; ++current)
    40         m_clientVector[clientIndex++] = *current;
     40        m_clientVector[clientIndex++] = current->first;
    4141}
    4242
  • trunk/WebCore/loader/CachedResourceClientWalker.h

    r15269 r20242  
    2828#define CachedResourceClientWalker_h
    2929
    30 #include <wtf/HashSet.h>
     30#include <wtf/HashCountedSet.h>
    3131#include <wtf/Vector.h>
    3232
     
    3939    class CachedResourceClientWalker {
    4040    public:
    41         CachedResourceClientWalker(const HashSet<CachedResourceClient*>&);
     41        CachedResourceClientWalker(const HashCountedSet<CachedResourceClient*>&);
    4242        CachedResourceClient* next();
    4343    private:
    44         const HashSet<CachedResourceClient*>& m_clientSet;
     44        const HashCountedSet<CachedResourceClient*>& m_clientSet;
    4545        Vector<CachedResourceClient*> m_clientVector;
    4646        size_t m_index;
  • trunk/WebCore/rendering/RenderImage.cpp

    r19997 r20242  
    129129        return;
    130130
    131     if (newImage != m_cachedImage) {
    132         RenderReplaced::imageChanged(newImage);
    133         return;
    134     }
     131    RenderReplaced::imageChanged(newImage);
     132    if (newImage != m_cachedImage)
     133        return;
    135134
    136135    bool imageSizeChanged = false;
  • trunk/WebCore/rendering/RenderListMarker.cpp

    r19952 r20242  
    632632void RenderListMarker::imageChanged(CachedImage* o)
    633633{
    634     if (o != m_image) {
    635         RenderBox::imageChanged(o);
     634    // A list marker can't have a background or border image, so no need to call the base class method.
     635    if (o != m_image)
    636636        return;
    637     }
    638637
    639638    if (m_width != m_image->imageSize().width() || m_height != m_image->imageSize().height())
Note: See TracChangeset for help on using the changeset viewer.