Commit a0de3861 authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

Fix crash keys used for debugging renderer hangs

I forgot to assign the ScopedCrashKeyStrings to a variable (oops).
Also adds one more crash key.

Bug: 934317
Change-Id: I773ff3d65b175e9619a5fe5746a86bf952cb1cc6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761059
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688223}
parent 3262d17f
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "base/rand_util.h" #include "base/rand_util.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/system/sys_info.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "content/browser/appcache/appcache_navigation_handle.h" #include "content/browser/appcache/appcache_navigation_handle.h"
...@@ -3104,11 +3105,26 @@ void NavigationRequest::OnCommitTimeout() { ...@@ -3104,11 +3105,26 @@ void NavigationRequest::OnCommitTimeout() {
// TODO(http://crbug.com/934317): Remove this once done debugging renderer // TODO(http://crbug.com/934317): Remove this once done debugging renderer
// hangs. // hangs.
if (base::RandDouble() < 0.1) { if (base::RandDouble() < 0.1) {
static base::debug::CrashKeyString* url = static base::debug::CrashKeyString* url_key =
base::debug::AllocateCrashKeyString("commit_timeout_url", base::debug::AllocateCrashKeyString("commit_timeout_url",
base::debug::CrashKeySize::Size256); base::debug::CrashKeySize::Size256);
base::debug::ScopedCrashKeyString( base::debug::ScopedCrashKeyString scoped_url(
url, common_params_->url.possibly_invalid_spec()); url_key, common_params_->url.possibly_invalid_spec());
static base::debug::CrashKeyString* last_crash_key =
base::debug::AllocateCrashKeyString("ns_last_crash_ms",
base::debug::CrashKeySize::Size32);
base::debug::ScopedCrashKeyString scoped_last_crash(
last_crash_key,
base::NumberToString(
GetTimeSinceLastNetworkServiceCrash().InMilliseconds()));
static base::debug::CrashKeyString* memory_key =
base::debug::AllocateCrashKeyString("physical_memory_mb",
base::debug::CrashKeySize::Size32);
base::debug::ScopedCrashKeyString scoped_memory(
memory_key,
base::NumberToString(base::SysInfo::AmountOfPhysicalMemoryMB()));
base::debug::DumpWithoutCrashing(); base::debug::DumpWithoutCrashing();
if (IsOutOfProcessNetworkService()) if (IsOutOfProcessNetworkService())
......
...@@ -646,7 +646,7 @@ void NetworkService::DumpWithoutCrashing(base::Time dump_request_time) { ...@@ -646,7 +646,7 @@ void NetworkService::DumpWithoutCrashing(base::Time dump_request_time) {
static base::debug::CrashKeyString* time_key = static base::debug::CrashKeyString* time_key =
base::debug::AllocateCrashKeyString("time_since_dump_request_ms", base::debug::AllocateCrashKeyString("time_since_dump_request_ms",
base::debug::CrashKeySize::Size32); base::debug::CrashKeySize::Size32);
base::debug::ScopedCrashKeyString( base::debug::ScopedCrashKeyString scoped_time(
time_key, base::NumberToString( time_key, base::NumberToString(
(base::Time::Now() - dump_request_time).InMilliseconds())); (base::Time::Now() - dump_request_time).InMilliseconds()));
base::debug::DumpWithoutCrashing(); base::debug::DumpWithoutCrashing();
......
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