Commit 20a3cdfb authored by Jochen Eisinger's avatar Jochen Eisinger Committed by Commit Bot

Add crash key for non-CORS-safelisted header names send by 1p apps

Bug: 873178
Change-Id: I696313dd80fb0801d951ff6c6e0c50661f84a63a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2000599Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#731685}
parent bfdd3068
......@@ -3,6 +3,8 @@
// found in the LICENSE file.
#include "base/android/jni_string.h"
#include "base/debug/crash_logging.h"
#include "base/debug/dump_without_crashing.h"
#include "base/hash/hash.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/string_util.h"
......@@ -26,9 +28,17 @@ jboolean JNI_IntentHeadersRecorder_IsCorsSafelistedHeader(
return true;
if (is_first_party) {
base::UmaHistogramSparse(
"Android.IntentNonSafelistedHeaderNames",
base::PersistentHash(base::ToLowerASCII(header_name)));
int hash = base::PersistentHash(base::ToLowerASCII(header_name));
base::UmaHistogramSparse("Android.IntentNonSafelistedHeaderNames", hash);
if (hash == -240302231) {
static base::debug::CrashKeyString* non_safelisted_header_name =
base::debug::AllocateCrashKeyString(
"intent_non_safelisted_header_name",
base::debug::CrashKeySize::Size256);
base::debug::ScopedCrashKeyString(non_safelisted_header_name,
header_name);
base::debug::DumpWithoutCrashing();
}
}
return false;
......
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