Chromium Code Reviews| Index: components/update_client/update_checker.cc |
| diff --git a/components/update_client/update_checker.cc b/components/update_client/update_checker.cc |
| index a5ec2662f4b4e8ba0bf4045c659c1f1f8ba3e7a8..b1815af488eb01808c3ccad934a6dd10e07d4801 100644 |
| --- a/components/update_client/update_checker.cc |
| +++ b/components/update_client/update_checker.cc |
| @@ -91,6 +91,15 @@ std::string BuildUpdateCheckRequest(const Configurator& config, |
| base::StringAppendF(&app, " %s=\"%s\"", attr.first.c_str(), |
| attr.second.c_str()); |
| } |
| + const std::string& cohort = metadata->GetCohort(item->id); |
|
Sorin Jianu
2016/08/18 21:15:15
This is a small deal and mostly a matter of person
waffles
2016/08/18 22:29:23
Done.
|
| + const std::string& cohort_name = metadata->GetCohortName(item->id); |
| + const std::string& cohort_hint = metadata->GetCohortHint(item->id); |
| + if (!cohort.empty()) |
| + base::StringAppendF(&app, " cohort=\"%s\"", cohort.c_str()); |
| + if (!cohort_name.empty()) |
| + base::StringAppendF(&app, " cohortname=\"%s\"", cohort_name.c_str()); |
| + if (!cohort_hint.empty()) |
| + base::StringAppendF(&app, " cohorthint=\"%s\"", cohort_hint.c_str()); |
| base::StringAppendF(&app, ">"); |
| base::StringAppendF(&app, "<updatecheck"); |
| @@ -203,6 +212,14 @@ void UpdateCheckerImpl::OnRequestSenderComplete( |
| int daynum = update_response.results().daystart_elapsed_days; |
| if (daynum != UpdateResponse::kNoDaystart) |
| metadata_->SetDateLastRollCall(*ids_checked, daynum); |
| + for (auto result : update_response.results().list) { |
| + if (result.set_cohort) |
| + metadata_->SetCohort(result.extension_id, result.cohort); |
| + if (result.set_cohort_hint) |
| + metadata_->SetCohortHint(result.extension_id, result.cohort_hint); |
| + if (result.set_cohort_name) |
| + metadata_->SetCohortName(result.extension_id, result.cohort_name); |
| + } |
| base::ThreadTaskRunnerHandle::Get()->PostTask( |
| FROM_HERE, base::Bind(update_check_callback_, error, |
| update_response.results(), retry_after_sec)); |