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

Unified Diff: chrome/browser/search_engines/template_url.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: 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 | « no previous file | chrome/browser/search_engines/template_url_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search_engines/template_url.cc
diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc
index e07ee6daebf50c97f39824dbe8390fce72e938ed..7807161ef8123280e26640136cb51825601f7ba3 100644
--- a/chrome/browser/search_engines/template_url.cc
+++ b/chrome/browser/search_engines/template_url.cc
@@ -368,8 +368,13 @@ std::string TemplateURLRef::ReplaceSearchTermsUsingTermsData(
}
bool TemplateURLRef::IsValid() const {
- UIThreadSearchTermsData search_terms_data(owner_->profile());
- return IsValidUsingTermsData(search_terms_data);
+ // Do not use a UIThreadSearchTermsData if a profile wasn't provided as it
+ // results in the same thing (relevant UIThreadSearchTermsData methods default
Peter Kasting 2013/04/17 22:11:56 This is the wrong layer to be doing this. All Tem
gab 2013/04/17 22:46:50 Sounds good, hesitated between the two, PTAL.
+ // to SearchTermsData methods when the profile is NULL), but prevents
+ // validity checks on non-UI threads.
+ scoped_ptr<SearchTermsData> search_terms_data(owner_->profile() ?
+ new UIThreadSearchTermsData(owner_->profile()) : new SearchTermsData());
+ return IsValidUsingTermsData(*search_terms_data);
}
bool TemplateURLRef::IsValidUsingTermsData(
« no previous file with comments | « no previous file | chrome/browser/search_engines/template_url_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698