Commit b9aa7421 authored by Thiemo Nagel's avatar Thiemo Nagel Committed by Commit Bot

Fix rlz disabling breakage on CrOS

Revert of "Cache the brand code to avoid hundreds of repeated reads."
commit 04749717.
https://codereview.chromium.org/2890943005

Disabling RLZ is communicated through an empty brand code. Thus the
value of the brand code must not be cached before RLZ is initialized.

BUG=793162
TEST=none

Change-Id: I7f9e223a9a39d19408f364f6aad95cb8c86f6d79
Reviewed-on: https://chromium-review.googlesource.com/824363Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Commit-Queue: Thiemo Nagel <tnagel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524012}
parent 459b93c2
......@@ -68,15 +68,11 @@ 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))
extracted->clear();
return extracted;
}();
// For organic brandcodes do not use rlz at all. Empty brandcode usually
// means a chromium install. This is ok.
if (!brand->empty() && !google_brand::IsOrganic(*brand)) {
std::string brand;
if (google_brand::GetBrand(&brand) && !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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment