Title: [138958] trunk/Source/WebCore
Revision
138958
Author
[email protected]
Date
2013-01-07 10:32:16 -0800 (Mon, 07 Jan 2013)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (138957 => 138958)


--- trunk/Source/WebCore/ChangeLog	2013-01-07 18:31:20 UTC (rev 138957)
+++ trunk/Source/WebCore/ChangeLog	2013-01-07 18:32:16 UTC (rev 138958)
@@ -1,3 +1,19 @@
+2013-01-07  Philip Rogers  <[email protected]>
+
+        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):
+
 2013-01-07  Julien Chaffraix  <[email protected]>
 
         Support size_t multiplication and division operators on LayoutUnit

Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (138957 => 138958)


--- trunk/Source/WebCore/loader/cache/CachedResource.cpp	2013-01-07 18:31:20 UTC (rev 138957)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp	2013-01-07 18:32:16 UTC (rev 138958)
@@ -707,11 +707,13 @@
             --count;
         }
     }
-    // Equivalent of calling removeClient() for all clients
-    m_clients.clear();
 
     unsigned moveCount = clientsToMove.size();
     for (unsigned n = 0; n < moveCount; ++n)
+        removeClient(clientsToMove[n]);
+    ASSERT(m_clients.isEmpty());
+
+    for (unsigned n = 0; n < moveCount; ++n)
         m_resourceToRevalidate->addClientToSet(clientsToMove[n]);
     for (unsigned n = 0; n < moveCount; ++n) {
         // Calling didAddClient may do anything, including trying to cancel revalidation.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to