Changeset 138958 in webkit


Ignore:
Timestamp:
Jan 7, 2013 10:32:16 AM (11 years ago)
Author:
pdr@google.com
Message:

Refactor client removal in CachedResource::switchClientsToRevalidatedResource
https://bugs.webkit.org/show_bug.cgi?id=106206

Previously switchClientsToRevalidatedResource() failed to call didRemoveClient() for each
client and instead simply cleared m_clients. This patch removes an incorrect comment and
refactors the code so that removeClient() and didRemoveClient() are properly called.

Reviewed by Nate Chapin.

No new tests as there are no observable changes from this refactoring.

  • loader/cache/CachedResource.cpp:

(WebCore::CachedResource::switchClientsToRevalidatedResource):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r138952 r138958  
     12013-01-07  Philip Rogers  <pdr@google.com>
     2
     3        Refactor client removal in CachedResource::switchClientsToRevalidatedResource
     4        https://bugs.webkit.org/show_bug.cgi?id=106206
     5
     6        Previously switchClientsToRevalidatedResource() failed to call didRemoveClient() for each
     7        client and instead simply cleared m_clients. This patch removes an incorrect comment and
     8        refactors the code so that removeClient() and didRemoveClient() are properly called.
     9
     10        Reviewed by Nate Chapin.
     11
     12        No new tests as there are no observable changes from this refactoring.
     13
     14        * loader/cache/CachedResource.cpp:
     15        (WebCore::CachedResource::switchClientsToRevalidatedResource):
     16
    1172013-01-07  Julien Chaffraix  <jchaffraix@webkit.org>
    218
  • trunk/Source/WebCore/loader/cache/CachedResource.cpp

    r138202 r138958  
    708708        }
    709709    }
    710     // Equivalent of calling removeClient() for all clients
    711     m_clients.clear();
    712710
    713711    unsigned moveCount = clientsToMove.size();
     712    for (unsigned n = 0; n < moveCount; ++n)
     713        removeClient(clientsToMove[n]);
     714    ASSERT(m_clients.isEmpty());
     715
    714716    for (unsigned n = 0; n < moveCount; ++n)
    715717        m_resourceToRevalidate->addClientToSet(clientsToMove[n]);
Note: See TracChangeset for help on using the changeset viewer.