update_engine: Support DLC Cohorts

UE at the moment doesn't send the correct cohorts to Omaha for DLCs. In
fact, the platform cohorts that are persisted are used for all DLCs.
This is incorrect and this CL fixes it.

```
Example DLC Response:
... cohort="1:7:" cohortname="eve_dlc_pita_canary"...

localhost ~ # ls /var/lib/update_engine/prefs/dlc/pita/omaha-cohort*
/var/lib/update_engine/prefs/dlc/pita/omaha-cohort
/var/lib/update_engine/prefs/dlc/pita/omaha-cohort-name
localhost ~ # cat /var/lib/update_engine/prefs/dlc/pita/omaha-cohort
1:7:
localhost ~ # cat
/var/lib/update_engine/prefs/dlc/pita/omaha-cohort-name
eve_dlc_pita_canary
```

BUG=b:162463872
TEST=FEATURES=test emerge-$B update_engine
TEST=# cros deploy + comment above

Change-Id: Ie503f0a63d3b19a51abb88379cb2e8f85919858b
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2515072
Tested-by: Jae Hoon Kim <kimjae@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Commit-Queue: Jae Hoon Kim <kimjae@chromium.org>
diff --git a/cros/omaha_request_action.h b/cros/omaha_request_action.h
index 1a3a912..9576a05 100644
--- a/cros/omaha_request_action.h
+++ b/cros/omaha_request_action.h
@@ -28,6 +28,7 @@
 
 #include <gtest/gtest_prod.h>  // for FRIEND_TEST
 
+#include <base/optional.h>
 #include <brillo/secure_blob.h>
 #include <curl/curl.h>
 
@@ -176,12 +177,17 @@
                                  int install_date_days,
                                  InstallDateProvisioningSource source);
 
-  // Persist the new cohort* value received in the XML file in the |prefs_key|
-  // preference file. If the |new_value| is empty, the currently stored value
-  // will be deleted. Don't call this function with an empty |new_value| if the
-  // value was not set in the XML, since that would delete the stored value.
-  bool PersistCohortData(const std::string& prefs_key,
-                         const std::string& new_value);
+  // Persist the new cohort value received in the XML file in the |prefs_key|
+  // preference file. If the |new_value| is empty, do nothing. If the
+  // |new_value| stores and empty value, the currently stored value will be
+  // deleted. Don't call this function with an empty |new_value| if the value
+  // was not set in the XML, since that would delete the stored value.
+  void PersistCohortData(const std::string& prefs_key,
+                         const base::Optional<std::string>& new_value);
+
+  // Parses and persists the cohorts sent back in the updatecheck tag
+  // attributes.
+  void PersistCohorts(const OmahaParserData& parser_data);
 
   // Parses and persists the end-of-life date flag sent back in the updatecheck
   // tag attributes. The flags will be validated and stored in the Prefs.