[privacy_budget] Assigned block sampling.

This CL completes the implementation of assigned surface block sampling.
Instead of the client picking random identifiable surfaces to sample,
this change introduces the ability for the server-side experiment to
provide multiple sets of surfaces for the client to select from for
sampling purposes. This is expected to provide better data for
calculating cross surface correlations.

Bug: 1224752
Change-Id: Id980de01eaf4a49e86c0a5f000f2ad404676b30d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2602893
Reviewed-by: Gabriel Charette <[email protected]>
Reviewed-by: Antonio Sartori <[email protected]>
Reviewed-by: Mike West <[email protected]>
Commit-Queue: Asanka Herath <[email protected]>
Cr-Commit-Position: refs/heads/main@{#923397}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index a0426feb..770b45b 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -666,6 +666,9 @@
 // Deprecated 09/2021.
 const char kAutofillAcceptSaveCreditCardPromptState[] =
     "autofill.accept_save_credit_card_prompt_state";
+const char kPrivacyBudgetActiveSurfaces[] = "privacy_budget.active_surfaces";
+const char kPrivacyBudgetRetiredSurfaces[] = "privacy_budget.retired_surfaces";
+const char kPrivacyBudgetSeed[] = "privacy_budget.randomizer_seed";
 
 // Register local state used only for migration (clearing or moving to a new
 // key).
@@ -703,6 +706,10 @@
 #if BUILDFLAG(ENABLE_EXTENSIONS)
   registry->RegisterBooleanPref(kPinnedExtensionsMigrationComplete, false);
 #endif
+
+  registry->RegisterStringPref(kPrivacyBudgetActiveSurfaces, std::string());
+  registry->RegisterStringPref(kPrivacyBudgetRetiredSurfaces, std::string());
+  registry->RegisterUint64Pref(kPrivacyBudgetSeed, 0u);
 }
 
 // Register prefs used only for migration (clearing or moving to a new key).
@@ -1467,6 +1474,11 @@
   // Added 07/2021
   local_state->ClearPref(kUserAgentClientHintsEnabled);
 
+  // Added 08/2021
+  local_state->ClearPref(kPrivacyBudgetActiveSurfaces);
+  local_state->ClearPref(kPrivacyBudgetRetiredSurfaces);
+  local_state->ClearPref(kPrivacyBudgetSeed);
+
   // Please don't delete the following line. It is used by PRESUBMIT.py.
   // END_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS
 }