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/logging.h" | 18 #include "base/logging.h" |
| 19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| 20 #include "base/memory/shared_memory.h" | 20 #include "base/memory/shared_memory.h" |
| 21 #include "base/message_loop/message_loop.h" | 21 #include "base/message_loop/message_loop.h" |
| 22 #include "base/metrics/histogram.h" | 22 #include "base/metrics/histogram.h" |
| 23 #include "base/metrics/sparse_histogram.h" | 23 #include "base/metrics/sparse_histogram.h" |
| 24 #include "base/profiler/scoped_tracker.h" | 24 #include "base/profiler/scoped_tracker.h" |
| 25 #include "base/stl_util.h" | 25 #include "base/stl_util.h" |
| 26 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 26 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
| 27 #include "base/time/time.h" | |
| 27 #include "content/browser/appcache/appcache_interceptor.h" | 28 #include "content/browser/appcache/appcache_interceptor.h" |
| 28 #include "content/browser/appcache/chrome_appcache_service.h" | 29 #include "content/browser/appcache/chrome_appcache_service.h" |
| 29 #include "content/browser/cert_store_impl.h" | 30 #include "content/browser/cert_store_impl.h" |
| 30 #include "content/browser/child_process_security_policy_impl.h" | 31 #include "content/browser/child_process_security_policy_impl.h" |
| 31 #include "content/browser/download/download_resource_handler.h" | 32 #include "content/browser/download/download_resource_handler.h" |
| 32 #include "content/browser/download/save_file_manager.h" | 33 #include "content/browser/download/save_file_manager.h" |
| 33 #include "content/browser/download/save_file_resource_handler.h" | 34 #include "content/browser/download/save_file_resource_handler.h" |
| 34 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 35 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
| 35 #include "content/browser/frame_host/navigation_request_info.h" | 36 #include "content/browser/frame_host/navigation_request_info.h" |
| 36 #include "content/browser/frame_host/navigator.h" | 37 #include "content/browser/frame_host/navigator.h" |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 855 ResourceRequestInfo* info = loader->GetRequestInfo(); | 856 ResourceRequestInfo* info = loader->GetRequestInfo(); |
| 856 | 857 |
| 857 // Record final result of all resource loads. | 858 // Record final result of all resource loads. |
| 858 if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME) { | 859 if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME) { |
| 859 // This enumeration has "3" appended to its name to distinguish it from | 860 // This enumeration has "3" appended to its name to distinguish it from |
| 860 // older versions. | 861 // older versions. |
| 861 UMA_HISTOGRAM_SPARSE_SLOWLY( | 862 UMA_HISTOGRAM_SPARSE_SLOWLY( |
| 862 "Net.ErrorCodesForMainFrame3", | 863 "Net.ErrorCodesForMainFrame3", |
| 863 -loader->request()->status().error()); | 864 -loader->request()->status().error()); |
| 864 | 865 |
| 866 // Record time to success and error for the most common errors, and for | |
| 867 // the aggregate remainder errors. | |
|
mmenke
2015/05/12 18:23:26
High level question:
What's the motivation for ad
Randy Smith (Not in Mondays)
2015/05/12 20:51:39
Discussed on main CL thread; IMO no code changes c
| |
| 868 base::TimeDelta request_loading_time( | |
| 869 base::Time::Now() - loader->request()->request_time()); | |
| 870 switch (loader->request()->status().error()) { | |
|
mmenke
2015/05/12 18:23:26
Looking at error without looking at loader->reques
Randy Smith (Not in Mondays)
2015/05/12 20:51:39
Believe main thread discussion left this as ok to
| |
| 871 case net::OK: | |
| 872 UMA_HISTOGRAM_LONG_TIMES( | |
| 873 "Net.RequestTimeToSuccess", request_loading_time); | |
|
mmenke
2015/05/12 18:23:26
optional: May want to add another dot in here, to
Randy Smith (Not in Mondays)
2015/05/12 20:51:39
Good idea; done.
| |
| 874 break; | |
| 875 case net::ERR_ABORTED: | |
|
mmenke
2015/05/12 18:23:26
We should include loader->request()->status().stat
Randy Smith (Not in Mondays)
2015/05/12 20:51:39
Left as is for compatibility with ErrorCodesForMai
| |
| 876 UMA_HISTOGRAM_LONG_TIMES( | |
| 877 "Net.RequestTimeToErrAborted", request_loading_time); | |
| 878 break; | |
| 879 case net::ERR_TIMED_OUT: | |
| 880 UMA_HISTOGRAM_LONG_TIMES( | |
| 881 "Net.RequestTimeToErrTimedOut", request_loading_time); | |
| 882 break; | |
| 883 case net::ERR_CONNECTION_RESET: | |
| 884 UMA_HISTOGRAM_LONG_TIMES( | |
| 885 "Net.RequestTimeToErrConnectionReset", request_loading_time); | |
| 886 break; | |
| 887 case net::ERR_INTERNET_DISCONNECTED: | |
| 888 UMA_HISTOGRAM_LONG_TIMES( | |
| 889 "Net.RequestTimeToErrInternetDisconnected", request_loading_time); | |
| 890 break; | |
|
jkarlin
2015/05/12 18:26:06
Perhaps ERR_CONNECTION_REFUSED, ERR_CONNECTION_TIM
Randy Smith (Not in Mondays)
2015/05/12 20:51:39
ERR_NAME_NOT_RESOLVED was an oversight on my part;
| |
| 891 default: | |
| 892 UMA_HISTOGRAM_LONG_TIMES( | |
| 893 "Net.RequestTimeToMiscError", request_loading_time); | |
| 894 break; | |
| 895 } | |
| 896 | |
| 865 if (loader->request()->url().SchemeIsCryptographic()) { | 897 if (loader->request()->url().SchemeIsCryptographic()) { |
| 866 if (loader->request()->url().host() == "www.google.com") { | 898 if (loader->request()->url().host() == "www.google.com") { |
| 867 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.ErrorCodesForHTTPSGoogleMainFrame2", | 899 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.ErrorCodesForHTTPSGoogleMainFrame2", |
| 868 -loader->request()->status().error()); | 900 -loader->request()->status().error()); |
| 869 } | 901 } |
| 870 | 902 |
| 871 int num_valid_scts = std::count_if( | 903 int num_valid_scts = std::count_if( |
| 872 loader->request()->ssl_info().signed_certificate_timestamps.begin(), | 904 loader->request()->ssl_info().signed_certificate_timestamps.begin(), |
| 873 loader->request()->ssl_info().signed_certificate_timestamps.end(), | 905 loader->request()->ssl_info().signed_certificate_timestamps.end(), |
| 874 IsValidatedSCT); | 906 IsValidatedSCT); |
| (...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2345 | 2377 |
| 2346 // Add a flag to selectively bypass the data reduction proxy if the resource | 2378 // Add a flag to selectively bypass the data reduction proxy if the resource |
| 2347 // type is not an image. | 2379 // type is not an image. |
| 2348 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) | 2380 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) |
| 2349 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; | 2381 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; |
| 2350 | 2382 |
| 2351 return load_flags; | 2383 return load_flags; |
| 2352 } | 2384 } |
| 2353 | 2385 |
| 2354 } // namespace content | 2386 } // namespace content |
| OLD | NEW |