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

Unified Diff: chrome/browser/history/top_sites_database.cc

Issue 562993002: [Top Sites] Validating URLs for "redirects" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 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: chrome/browser/history/top_sites_database.cc
diff --git a/chrome/browser/history/top_sites_database.cc b/chrome/browser/history/top_sites_database.cc
index ff20d4db8e3756beaeec1e264ac13030bced5bce..c258db318ec240c3523ed2d1fcc45ac513a08a52 100644
--- a/chrome/browser/history/top_sites_database.cc
+++ b/chrome/browser/history/top_sites_database.cc
@@ -90,8 +90,11 @@ std::string GetRedirects(const history::MostVisitedURL& url) {
void SetRedirects(const std::string& redirects, history::MostVisitedURL* url) {
std::vector<std::string> redirects_vector;
base::SplitStringAlongWhitespace(redirects, &redirects_vector);
- for (size_t i = 0; i < redirects_vector.size(); ++i)
- url->redirects.push_back(GURL(redirects_vector[i]));
+ for (size_t i = 0; i < redirects_vector.size(); ++i) {
+ GURL redirects_url(redirects_vector[i]);
+ if (redirects_url.is_valid())
+ url->redirects.push_back(redirects_url);
+ }
}
// Track various failure (and success) cases in recovery code.
« 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