Commit 06253563 authored by Alexei Svitkine's avatar Alexei Svitkine Committed by Commit Bot

Add crash key logging to debug startup locale CHECK.

Bug: 912320
Change-Id: I44eceafae715ccedfb258b86d53728efb401d28e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2020783
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Auto-Submit: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735160}
parent c54ad219
......@@ -16,6 +16,7 @@
#include "base/build_time.h"
#include "base/callback.h"
#include "base/command_line.h"
#include "base/debug/crash_logging.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
......@@ -437,7 +438,17 @@ void VariationsService::EnsureLocaleEquals(const std::string& locale) {
// Uses a CHECK rather than a DCHECK to ensure that issues are caught since
// problems in this area may only appear in the wild due to official builds
// and end user machines.
CHECK_EQ(locale, field_trial_creator_.application_locale());
if (locale != field_trial_creator_.application_locale()) {
// TODO(crbug.com/912320): Report the two values in crash keys.
static auto* lhs_key = base::debug::AllocateCrashKeyString(
"mismatched_locale_lhs", base::debug::CrashKeySize::Size256);
static auto* rhs_key = base::debug::AllocateCrashKeyString(
"mismatched_locale_rhs", base::debug::CrashKeySize::Size256);
base::debug::ScopedCrashKeyString scoped_lhs(lhs_key, locale);
base::debug::ScopedCrashKeyString scoped_rhs(
rhs_key, field_trial_creator_.application_locale());
CHECK_EQ(locale, field_trial_creator_.application_locale());
}
#endif
}
......
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