Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading |
| 6 | 6 |
| 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/bind_helpers.h" | 14 #include "base/bind_helpers.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 17 #include "base/debug/alias.h" | 17 #include "base/debug/alias.h" |
| 18 #include "base/debug/crash_logging.h" | |
| 19 #include "base/debug/dump_without_crashing.h" | |
| 20 #include "base/debug/stack_trace.h" | |
| 18 #include "base/logging.h" | 21 #include "base/logging.h" |
| 19 #include "base/memory/scoped_ptr.h" | 22 #include "base/memory/scoped_ptr.h" |
| 20 #include "base/memory/shared_memory.h" | 23 #include "base/memory/shared_memory.h" |
| 21 #include "base/message_loop/message_loop.h" | 24 #include "base/message_loop/message_loop.h" |
| 22 #include "base/metrics/histogram_macros.h" | 25 #include "base/metrics/histogram_macros.h" |
| 23 #include "base/metrics/sparse_histogram.h" | 26 #include "base/metrics/sparse_histogram.h" |
| 24 #include "base/profiler/scoped_tracker.h" | 27 #include "base/profiler/scoped_tracker.h" |
| 25 #include "base/stl_util.h" | 28 #include "base/stl_util.h" |
| 26 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 29 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
| 27 #include "base/time/time.h" | 30 #include "base/time/time.h" |
| (...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 899 base::TimeDelta request_loading_time( | 902 base::TimeDelta request_loading_time( |
| 900 base::TimeTicks::Now() - loader->request()->creation_time()); | 903 base::TimeTicks::Now() - loader->request()->creation_time()); |
| 901 switch (loader->request()->status().error()) { | 904 switch (loader->request()->status().error()) { |
| 902 case net::OK: | 905 case net::OK: |
| 903 UMA_HISTOGRAM_LONG_TIMES( | 906 UMA_HISTOGRAM_LONG_TIMES( |
| 904 "Net.RequestTime2.Success", request_loading_time); | 907 "Net.RequestTime2.Success", request_loading_time); |
| 905 break; | 908 break; |
| 906 case net::ERR_ABORTED: | 909 case net::ERR_ABORTED: |
| 907 UMA_HISTOGRAM_LONG_TIMES( | 910 UMA_HISTOGRAM_LONG_TIMES( |
| 908 "Net.RequestTime2.ErrAborted", request_loading_time); | 911 "Net.RequestTime2.ErrAborted", request_loading_time); |
| 912 // 100ms is typically "instantaneous" in human perception. | |
| 913 if (request_loading_time.InMilliseconds() < 100) { | |
| 914 const char kFastErrAbortTrace[] = "fast-err-abort-trace"; | |
| 915 const base::debug::StackTrace* stack_trace = | |
| 916 loader->request()->stack_trace(); | |
| 917 if (stack_trace) { | |
| 918 base::debug::SetCrashKeyToStackTrace(kFastErrAbortTrace, | |
|
eroman
2015/11/16 22:56:11
Instead of adding a crash key to the report, I thi
| |
| 919 *stack_trace); | |
| 920 base::debug::DumpWithoutCrashing(); | |
|
eroman
2015/11/16 22:56:11
Do you have any estimates on how often this will b
| |
| 921 base::debug::ClearCrashKey(kFastErrAbortTrace); | |
| 922 } | |
| 923 } | |
| 909 break; | 924 break; |
| 910 case net::ERR_CONNECTION_RESET: | 925 case net::ERR_CONNECTION_RESET: |
| 911 UMA_HISTOGRAM_LONG_TIMES( | 926 UMA_HISTOGRAM_LONG_TIMES( |
| 912 "Net.RequestTime2.ErrConnectionReset", request_loading_time); | 927 "Net.RequestTime2.ErrConnectionReset", request_loading_time); |
| 913 break; | 928 break; |
| 914 case net::ERR_CONNECTION_TIMED_OUT: | 929 case net::ERR_CONNECTION_TIMED_OUT: |
| 915 UMA_HISTOGRAM_LONG_TIMES( | 930 UMA_HISTOGRAM_LONG_TIMES( |
| 916 "Net.RequestTime2.ErrConnectionTimedOut", request_loading_time); | 931 "Net.RequestTime2.ErrConnectionTimedOut", request_loading_time); |
| 917 break; | 932 break; |
| 918 case net::ERR_INTERNET_DISCONNECTED: | 933 case net::ERR_INTERNET_DISCONNECTED: |
| (...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2442 load_flags |= net::LOAD_PREFETCH; | 2457 load_flags |= net::LOAD_PREFETCH; |
| 2443 } | 2458 } |
| 2444 | 2459 |
| 2445 if (is_sync_load) | 2460 if (is_sync_load) |
| 2446 load_flags |= net::LOAD_IGNORE_LIMITS; | 2461 load_flags |= net::LOAD_IGNORE_LIMITS; |
| 2447 | 2462 |
| 2448 return load_flags; | 2463 return load_flags; |
| 2449 } | 2464 } |
| 2450 | 2465 |
| 2451 } // namespace content | 2466 } // namespace content |
| OLD | NEW |