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

Unified Diff: chrome/browser/search_engines/template_url_parser.cc

Issue 14232019: Do not use a UIThreadSearchTermsData when validating a TemplateURL for which the Profile is NULL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comments Created 7 years, 8 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 | « chrome/browser/search_engines/template_url_parser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search_engines/template_url_parser.cc
diff --git a/chrome/browser/search_engines/template_url_parser.cc b/chrome/browser/search_engines/template_url_parser.cc
index 8f6db40776b6e7ac27ee8be9d594bb0b82ebede9..1108f20b298de88cf1dd179c0ea00ab778d9b35b 100644
--- a/chrome/browser/search_engines/template_url_parser.cc
+++ b/chrome/browser/search_engines/template_url_parser.cc
@@ -13,6 +13,7 @@
#include "base/string_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/search_engines/search_terms_data.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_service.h"
#include "chrome/common/url_constants.h"
@@ -309,10 +310,15 @@ TemplateURL* TemplateURLParsingContext::GetTemplateURL(
// Bail if the search URL is empty or if either TemplateURLRef is invalid.
scoped_ptr<TemplateURL> template_url(new TemplateURL(profile, data_));
- if (template_url->url().empty() || !template_url->url_ref().IsValid() ||
+ scoped_ptr<SearchTermsData> search_terms_data(profile ?
+ new UIThreadSearchTermsData(profile) : new SearchTermsData());
+ if (template_url->url().empty() ||
+ !template_url->url_ref().IsValidUsingTermsData(*search_terms_data) ||
(!template_url->suggestions_url().empty() &&
- !template_url->suggestions_url_ref().IsValid()))
+ !template_url->suggestions_url_ref().
+ IsValidUsingTermsData(*search_terms_data))) {
return NULL;
+ }
return template_url.release();
}
« no previous file with comments | « chrome/browser/search_engines/template_url_parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698