Index: content/browser/renderer_host/duplicate_content_resource_handler.cc |
diff --git a/content/browser/renderer_host/duplicate_content_resource_handler.cc b/content/browser/renderer_host/duplicate_content_resource_handler.cc |
index 0c7a8ba880ea28635801f8a6df42a4cf4be14e17..d63641a7adf082b90b383297e99eb9ae59c19451 100644 |
--- a/content/browser/renderer_host/duplicate_content_resource_handler.cc |
+++ b/content/browser/renderer_host/duplicate_content_resource_handler.cc |
@@ -89,17 +89,23 @@ bool DuplicateContentResourceHandler::OnResponseCompleted( |
} |
void DuplicateContentResourceHandler::RecordContentMetrics() { |
+ // Ignore everything that's not http/https. Specifically, exclude data and |
+ // blob URLs which can be generated by content and cause the maintained sets |
+ // to grow without bounds. |
+ if (!request_->url().SchemeIs("http") && !request_->url().SchemeIs("https")) { |
gavinp
2012/08/09 20:20:45
I'm taking my LGTM back. This code calculates the
scottmg
2012/08/09 20:24:56
Sorry, you lost me? There's a return here, so if t
gavinp
2012/08/12 16:17:14
See my comment on line 74, above.
On 2012/08/09 2
|
+ bytes_read_ = 0; |
+ read_buffer_ = NULL; |
+ return; |
+ } |
MH_UINT32 contents_hash = PMurHash32_Result(pmurhash_ph1_, |
pmurhash_pcarry_, bytes_read_); |
- |
// Combine the contents_hash with the url, so we can test if future content |
// identical resources have the same original url or not. |
- MH_UINT32 hashed_with_url; |
const std::string& url_spec = request_->url().spec(); |
PMurHash32_Process(&pmurhash_ph1_, &pmurhash_pcarry_, |
url_spec.data(), url_spec.length()); |
- hashed_with_url = PMurHash32_Result(pmurhash_ph1_, pmurhash_pcarry_, |
- url_spec.length() + bytes_read_); |
+ MH_UINT32 hashed_with_url = PMurHash32_Result( |
gavinp
2012/08/09 18:32:00
nice cleanup.
|
+ pmurhash_ph1_, pmurhash_pcarry_, url_spec.length() + bytes_read_); |
DVLOG(4) << "url: " << url_spec; |
DVLOG(4) << "contents hash: " << contents_hash; |