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

Side by Side Diff: Source/core/fetch/ResourceFetcher.cpp

Issue 256743005: Add removeAll method to sets and maps and use them (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moved implementation of removeAll to HashTable.h and shared it. Also added it to LinkedHashSet Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/StyleEngine.cpp ('k') | Source/core/fetch/ResourceLoadPriorityOptimizer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 void ResourceFetcher::garbageCollectDocumentResources() 1104 void ResourceFetcher::garbageCollectDocumentResources()
1105 { 1105 {
1106 typedef Vector<String, 10> StringVector; 1106 typedef Vector<String, 10> StringVector;
1107 StringVector resourcesToDelete; 1107 StringVector resourcesToDelete;
1108 1108
1109 for (DocumentResourceMap::iterator it = m_documentResources.begin(); it != m _documentResources.end(); ++it) { 1109 for (DocumentResourceMap::iterator it = m_documentResources.begin(); it != m _documentResources.end(); ++it) {
1110 if (it->value->hasOneHandle()) 1110 if (it->value->hasOneHandle())
1111 resourcesToDelete.append(it->key); 1111 resourcesToDelete.append(it->key);
1112 } 1112 }
1113 1113
1114 for (StringVector::const_iterator it = resourcesToDelete.begin(); it != reso urcesToDelete.end(); ++it) 1114 m_documentResources.removeAll(resourcesToDelete);
1115 m_documentResources.remove(*it);
1116 } 1115 }
1117 1116
1118 void ResourceFetcher::notifyLoadedFromMemoryCache(Resource* resource) 1117 void ResourceFetcher::notifyLoadedFromMemoryCache(Resource* resource)
1119 { 1118 {
1120 if (!frame() || !frame()->page() || resource->status() != Resource::Cached | | m_validatedURLs.contains(resource->url())) 1119 if (!frame() || !frame()->page() || resource->status() != Resource::Cached | | m_validatedURLs.contains(resource->url()))
1121 return; 1120 return;
1122 1121
1123 ResourceRequest request(resource->url()); 1122 ResourceRequest request(resource->url());
1124 unsigned long identifier = createUniqueIdentifier(); 1123 unsigned long identifier = createUniqueIdentifier();
1125 context().dispatchDidLoadResourceFromMemoryCache(request, resource->response ()); 1124 context().dispatchDidLoadResourceFromMemoryCache(request, resource->response ());
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1434 case Revalidate: 1433 case Revalidate:
1435 ++m_revalidateCount; 1434 ++m_revalidateCount;
1436 return; 1435 return;
1437 case Use: 1436 case Use:
1438 ++m_useCount; 1437 ++m_useCount;
1439 return; 1438 return;
1440 } 1439 }
1441 } 1440 }
1442 1441
1443 } 1442 }
OLDNEW
« no previous file with comments | « Source/core/dom/StyleEngine.cpp ('k') | Source/core/fetch/ResourceLoadPriorityOptimizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698