Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Unified Diff: third_party/WebKit/Source/core/fetch/Resource.cpp

Issue 2045883002: Clean up markClientsAndObserversFinished(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix sign mismatch comparison Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.cpp ('k') | third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698