Index: chrome/browser/net/predictor.cc |
diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc |
index 9d2a80c98afaace21cf34892d7d8201f97969da6..2cd513fbf15d9cd14ec7fed56a15db65d6efc050 100644 |
--- a/chrome/browser/net/predictor.cc |
+++ b/chrome/browser/net/predictor.cc |
@@ -33,6 +33,7 @@ |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/pref_names.h" |
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h" |
+#include "components/predictor/common/predictor_common.h" |
#include "components/pref_registry/pref_registry_syncable.h" |
#include "content/public/browser/browser_thread.h" |
#include "net/base/address_list.h" |
@@ -736,12 +737,23 @@ void Predictor::LearnAboutInitialNavigation(const GURL& url) { |
// includes both Page-Scan, and Link-Hover prefetching. |
// TODO(jar): Separate out link-hover prefetching, and page-scan results. |
void Predictor::DnsPrefetchList(const NameList& hostnames) { |
+ if (hostnames.size() > predictor::kMaxDnsHostnamesPerRequest) { |
+ LOG(ERROR) << "Refusing to prefetch too many hostnames: " |
+ << hostnames.size(); |
Nico
2014/10/28 20:07:19
Don't do useless logging. If this is an invariant,
gunsch
2014/10/28 20:47:32
If it fails, that's a security issue, since this s
Nico
2014/10/28 20:56:42
It's logspam in the sense that printing this doesn
gunsch
2014/10/28 21:11:29
That sounds practical, can you point me to an exam
Nico
2014/10/28 21:31:18
https://code.google.com/p/chromium/codesearch#chro
Nico
2014/10/29 22:16:34
Even better, we even have a web page for this: htt
gunsch
2014/10/29 23:58:29
Yeah, I linked that earlier in this reply thread,
|
+ return; |
+ } |
+ |
// TODO(jar): Push GURL transport further back into renderer, but this will |
// require a Webkit change in the observer :-/. |
UrlList urls; |
for (NameList::const_iterator it = hostnames.begin(); |
it < hostnames.end(); |
++it) { |
+ if (it->length() > predictor::kMaxDnsHostnameLength) { |
+ LOG(ERROR) << "Refusing to prefetch hostname with length: " |
+ << it->length(); |
Nico
2014/10/28 20:07:19
likewise
gunsch
2014/10/29 23:58:29
Done.
|
+ continue; |
+ } |
urls.push_back(GURL("http://" + *it + ":80")); |
} |