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..66997e889e6282b47bf692146ef73e38c82582da 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); |
| + 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) { |
|
Sorin Jianu
2016/08/22 19:59:34
could be useful to auto&
waffles
2016/08/22 23:40:32
Done.
|
| + if (result.cohort != nullptr) |
| + metadata_->SetCohort(result.extension_id, *result.cohort); |
| + if (result.cohort_hint != nullptr) |
| + metadata_->SetCohortHint(result.extension_id, *result.cohort_hint); |
| + if (result.cohort_name != nullptr) |
| + 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)); |