Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(775)

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 1438863002: Simulated Crash reporting for ErrAborted requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index f342602626ab81b27875ce55c0effbbb83afdc6c..2b3b9b278d573201e25d3c509e57da0fff415706 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -15,6 +15,9 @@
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/debug/alias.h"
+#include "base/debug/crash_logging.h"
+#include "base/debug/dump_without_crashing.h"
+#include "base/debug/stack_trace.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/shared_memory.h"
@@ -906,6 +909,18 @@ void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) {
case net::ERR_ABORTED:
UMA_HISTOGRAM_LONG_TIMES(
"Net.RequestTime2.ErrAborted", request_loading_time);
+ // 100ms is typically "instantaneous" in human perception.
+ if (request_loading_time.InMilliseconds() < 100) {
+ const char kFastErrAbortTrace[] = "fast-err-abort-trace";
+ const base::debug::StackTrace* stack_trace =
+ loader->request()->stack_trace();
+ if (stack_trace) {
+ base::debug::SetCrashKeyToStackTrace(kFastErrAbortTrace,
eroman 2015/11/16 22:56:11 Instead of adding a crash key to the report, I thi
+ *stack_trace);
+ base::debug::DumpWithoutCrashing();
eroman 2015/11/16 22:56:11 Do you have any estimates on how often this will b
+ base::debug::ClearCrashKey(kFastErrAbortTrace);
+ }
+ }
break;
case net::ERR_CONNECTION_RESET:
UMA_HISTOGRAM_LONG_TIMES(
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698