Chromium Code Reviews| Index: chrome/browser/search_engines/ui_thread_search_terms_data.cc |
| diff --git a/chrome/browser/search_engines/ui_thread_search_terms_data.cc b/chrome/browser/search_engines/ui_thread_search_terms_data.cc |
| index 9a31685b52640c5fe56e2d0085624b76c859eb37..72e7d54de9809dc4fdcd644447f871c1c719078c 100644 |
| --- a/chrome/browser/search_engines/ui_thread_search_terms_data.cc |
| +++ b/chrome/browser/search_engines/ui_thread_search_terms_data.cc |
| @@ -76,11 +76,16 @@ base::string16 UIThreadSearchTermsData::GetRlzParameterValue( |
| BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| base::string16 rlz_string; |
| #if BUILDFLAG(ENABLE_RLZ) |
| + static std::string* brand = []() { |
| + auto* extracted = new std::string(); |
| + if (!google_brand::GetBrand(extracted)) { |
|
Peter Kasting
2017/05/19 01:48:45
Why {} here? It's allowed by the style guide, but
|
| + extracted->clear(); |
| + } |
| + return extracted; |
| + }(); |
| // For organic brandcodes do not use rlz at all. Empty brandcode usually |
| // means a chromium install. This is ok. |
| - std::string brand; |
| - if (google_brand::GetBrand(&brand) && !brand.empty() && |
| - !google_brand::IsOrganic(brand)) { |
| + if (!brand->empty() && !google_brand::IsOrganic(*brand)) { |
| // This call will return false the first time(s) it is called until the |
| // value has been cached. This normally would mean that at most one omnibox |
| // search might not send the RLZ data but this is not really a problem. |