Index: third_party/WebKit/Source/core/fetch/Resource.cpp |
diff --git a/third_party/WebKit/Source/core/fetch/Resource.cpp b/third_party/WebKit/Source/core/fetch/Resource.cpp |
index 2b52c8c36ea8c82c2e3febbde315e367eca53918..118fed26eb16d5bfc5959fce36e18b31174c5f19 100644 |
--- a/third_party/WebKit/Source/core/fetch/Resource.cpp |
+++ b/third_party/WebKit/Source/core/fetch/Resource.cpp |
@@ -394,13 +394,10 @@ void Resource::setDataBufferingPolicy(DataBufferingPolicy dataBufferingPolicy) |
void Resource::markClientsAndObserversFinished() |
{ |
- while (!m_clients.isEmpty()) { |
- HashCountedSet<ResourceClient*>::iterator it = m_clients.begin(); |
- for (int i = it->value; i; i--) { |
- m_finishedClients.add(it->key); |
- m_clients.remove(it); |
- } |
- } |
+ HashCountedSet<ResourceClient*> clients; |
+ m_clients.swap(clients); |
+ for (const auto& it : clients) |
+ m_finishedClients.add(it.key, it.value); |
} |
void Resource::error(const ResourceError& error) |