Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(824)

Unified Diff: components/variations/variations_associated_data.cc

Issue 2558913003: Restrict transmission of external exp ids to signed in users. (Closed)
Patch Set: Address nit. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/variations/variations_associated_data.cc
diff --git a/components/variations/variations_associated_data.cc b/components/variations/variations_associated_data.cc
index 465aed58c5407ddc22984d606120e338f0ca49e0..dea7bea9a3aeedb628ddbb9ba61e83bd1ac3dfb6 100644
--- a/components/variations/variations_associated_data.cc
+++ b/components/variations/variations_associated_data.cc
@@ -38,13 +38,21 @@ class GroupMapAccessor {
const VariationID id,
const bool force) {
#if !defined(NDEBUG)
- DCHECK_EQ(3, ID_COLLECTION_COUNT);
- // Ensure that at most one of the trigger/non-trigger web property IDs are
- // set.
- if (key == GOOGLE_WEB_PROPERTIES || key == GOOGLE_WEB_PROPERTIES_TRIGGER) {
- IDCollectionKey other_key = key == GOOGLE_WEB_PROPERTIES ?
- GOOGLE_WEB_PROPERTIES_TRIGGER : GOOGLE_WEB_PROPERTIES;
- DCHECK_EQ(EMPTY_ID, GetID(other_key, group_identifier));
+ DCHECK_EQ(4, ID_COLLECTION_COUNT);
+ // Ensure that at most one of the trigger/non-trigger/signed-in web property
+ // IDs are set.
+ if (key == GOOGLE_WEB_PROPERTIES || key == GOOGLE_WEB_PROPERTIES_TRIGGER ||
+ key == GOOGLE_WEB_PROPERTIES_SIGNED_IN) {
+ if (key != GOOGLE_WEB_PROPERTIES)
+ DCHECK_EQ(EMPTY_ID, GetID(GOOGLE_WEB_PROPERTIES, group_identifier));
+ if (key != GOOGLE_WEB_PROPERTIES_TRIGGER) {
+ DCHECK_EQ(EMPTY_ID,
+ GetID(GOOGLE_WEB_PROPERTIES_TRIGGER, group_identifier));
+ }
+ if (key != GOOGLE_WEB_PROPERTIES_SIGNED_IN) {
+ DCHECK_EQ(EMPTY_ID,
+ GetID(GOOGLE_WEB_PROPERTIES_SIGNED_IN, group_identifier));
+ }
}
// Validate that all collections with this |group_identifier| have the same
« no previous file with comments | « components/variations/variations_associated_data.h ('k') | components/variations/variations_http_header_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698