Commit 20be5e59 authored by Eli Ribble's avatar Eli Ribble Committed by Commit Bot

Increase the size of kVariationsKeySize.

This prevents triggering a NOTREACHED() for internal projects that have
a very large number of variations.

Bug: b:162438420
Change-Id: I171062c0d462e56f70cc6eb7ebeb279169279333
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2332571Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795684}
parent b7b14d0c
...@@ -2,12 +2,22 @@ ...@@ -2,12 +2,22 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/buildflag_header.gni")
import("//build/config/chromecast_build.gni")
import("//testing/test.gni") import("//testing/test.gni")
if (is_android) { if (is_android) {
import("//build/config/android/rules.gni") import("//build/config/android/rules.gni")
} }
large_variation_key_size_enabled =
is_chromecast
buildflag_header("buildflags") {
header = "buildflags.h"
flags = [ "LARGE_VARIATION_KEY_SIZE=$large_variation_key_size_enabled" ]
}
static_library("variations") { static_library("variations") {
sources = [ sources = [
"active_field_trials.cc", "active_field_trials.cc",
...@@ -73,6 +83,7 @@ static_library("variations") { ...@@ -73,6 +83,7 @@ static_library("variations") {
} }
deps = [ deps = [
":buildflags",
"proto", "proto",
"//base", "//base",
"//components/crash/core/common:crash_key", "//components/crash/core/common:crash_key",
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "components/crash/core/common/crash_key.h" #include "components/crash/core/common/crash_key.h"
#include "components/variations/active_field_trials.h" #include "components/variations/active_field_trials.h"
#include "components/variations/buildflags.h"
#include "components/variations/synthetic_trials.h" #include "components/variations/synthetic_trials.h"
namespace variations { namespace variations {
...@@ -22,7 +23,11 @@ namespace { ...@@ -22,7 +23,11 @@ namespace {
// Size of the "num-experiments" crash key in bytes. 4096 bytes should be able // Size of the "num-experiments" crash key in bytes. 4096 bytes should be able
// to hold about 227 entries, given each entry is 18 bytes long (due to being // to hold about 227 entries, given each entry is 18 bytes long (due to being
// of the form "8e7abfb0-c16397b7,"). // of the form "8e7abfb0-c16397b7,").
#if BUILDFLAG(LARGE_VARIATION_KEY_SIZE)
constexpr size_t kVariationsKeySize = 8192;
#else
constexpr size_t kVariationsKeySize = 4096; constexpr size_t kVariationsKeySize = 4096;
#endif
// Crash key reporting the number of experiments. 8 is the size of the crash key // Crash key reporting the number of experiments. 8 is the size of the crash key
// in bytes, which is used to hold an int as a string. // in bytes, which is used to hold an int as a string.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment