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

Unified Diff: Source/core/fetch/ResourceFetcher.cpp

Issue 723423002: Clear ResourceFetcher::m_validatedURLs if too many entries are added (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: define kMaxValidatedURLsSize Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index 68f29110590e6be5b393177aaab507a390eda98f..69fa5bb29ba1be880310e32aefe94d85927510e9 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -677,6 +677,10 @@ void ResourceFetcher::maybeNotifyInsecureContent(const Resource* resource) const
resource->lastResourceRequest().url());
}
+// Limit the number of URLs in m_validatedURLs to avoid memory bloat.
+// http://crbug.com/52411
+static const int kMaxValidatedURLsSize = 10000;
PhistucK 2014/11/14 12:30:36 This seems like a lot to me (10,000 URLs, right?).
+
void ResourceFetcher::requestLoadStarted(Resource* resource, const FetchRequest& request, ResourceLoadStartType type)
{
if (type == ResourceLoadingFromCache)
@@ -694,6 +698,9 @@ void ResourceFetcher::requestLoadStarted(Resource* resource, const FetchRequest&
m_resourceTimingReportTimer.startOneShot(0, FROM_HERE);
}
+ if (m_validatedURLs.size() >= kMaxValidatedURLsSize) {
+ m_validatedURLs.clear();
+ }
m_validatedURLs.add(request.resourceRequest().url());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698