Chromium Code Reviews| 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( |