Index: chrome/browser/net/predictor.cc |
diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc |
index 9d2a80c98afaace21cf34892d7d8201f97969da6..fb77d62913524c2e96f1fc07bd4581a727b8101a 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/dns_prefetch/common/prefetch_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() > dns_prefetch::kMaxDnsHostnamesPerRequest) { |
+ LOG(DFATAL) << "Refusing to prefetch too many hostnames: " |
jar (doing other things)
2014/10/28 22:49:32
nit: Please use DLOG. No one will look at this...
gunsch
2014/10/29 23:58:29
Covered by removing this and doing validation with
|
+ << hostnames.size(); |
+ 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() > dns_prefetch::kMaxDnsHostnameLength) { |
+ LOG(DFATAL) << "Refusing to prefetch hostname with length: " |
jar (doing other things)
2014/10/28 22:49:32
nit: DLOG
gunsch
2014/10/29 23:58:29
ditto
|
+ << it->length(); |
+ continue; |
+ } |
urls.push_back(GURL("http://" + *it + ":80")); |
} |