Commit d0fdadf3 authored by Lily Chen's avatar Lily Chen Committed by Chromium LUCI CQ

Add crash keys to debug net::SchemefulSite deserialization failures

Bug: 1157010
Change-Id: Iacdc534afaa513914db168267d6446619bfd3dc5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2644531
Commit-Queue: Lily Chen <chlily@chromium.org>
Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846428}
parent 6eb067d7
......@@ -5,6 +5,8 @@
#include "net/base/schemeful_site.h"
#include "base/check.h"
#include "base/debug/crash_logging.h"
#include "base/debug/dump_without_crashing.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "net/base/url_util.h"
#include "url/gurl.h"
......@@ -87,8 +89,24 @@ bool SchemefulSite::FromWire(const url::Origin& site_as_origin,
// match if used to construct another SchemefulSite. Thus, if there is a
// mismatch here, we must indicate a failure.
SchemefulSite candidate(site_as_origin);
if (candidate.site_as_origin_ != site_as_origin)
if (candidate.site_as_origin_ != site_as_origin) {
// TODO(crbug.com/1157010): Remove crash keys after deserialization failures
// are diagnosed.
static base::debug::CrashKeyString* schemeful_site_origin_from_wire =
base::debug::AllocateCrashKeyString("schemeful_site_origin_from_wire",
base::debug::CrashKeySize::Size256);
url::debug::ScopedOriginCrashKey origin_from_wire_crash_key(
schemeful_site_origin_from_wire, &site_as_origin);
static base::debug::CrashKeyString* schemeful_site_candidate_origin =
base::debug::AllocateCrashKeyString("schemeful_site_candidate_origin",
base::debug::CrashKeySize::Size256);
url::debug::ScopedOriginCrashKey candidate_origin_crash_key(
schemeful_site_candidate_origin, &candidate.site_as_origin_);
base::debug::DumpWithoutCrashing();
return false;
}
*out = std::move(candidate);
return true;
......
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