Commit f60748f4 authored by Nate Fischer's avatar Nate Fischer Committed by Commit Bot

AW: add CHECK to understand lack of UMA records

WebView currently has no UMA records. One possible explanation is if the
client_id is always a consistent value. It's hard to check if it's
always a consistent value, but we can check for a few classes of invalid
values (incorrect length, invalid characters).

Tentatively add CHECK()s so we can look for crash data. We'll remove
these CHECK()s when we know the root cause.

Bug: 992250
Test: None
Change-Id: I920061f973a8320bb5b6df14cf2a3a193751e82f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1750346Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686519}
parent b0a62da9
......@@ -59,6 +59,17 @@ std::unique_ptr<metrics::ClientInfo> LoadClientInfo() {
// - WebView uses the low-entropy source for all studies, so there would be
// crosstalk between the metrics sampling study and all other studies.
bool IsInSample(const std::string& client_id) {
// TODO(ntfschr): remove these CHECK()s when we rule this out as the culprit
// for https://crbug.com/992250.
CHECK_EQ(36u, client_id.length()) << "client ID should be 36 chars exactly";
for (const char& c : client_id) {
bool char_is_digit = (c >= '0' && c <= '9');
bool char_is_a_through_f = (c >= 'a' && c <= 'f');
bool char_is_hyphen = (c == '-');
CHECK(char_is_digit || char_is_a_through_f || char_is_hyphen)
<< "client_id should be composed of [0-9a-f] or '-'.";
}
// client_id comes from base::GenerateGUID(), so its value is random/uniform,
// except for a few bit positions with fixed values, and some hyphens. Rather
// than separating the random payload from the fixed bits, just hash the whole
......
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