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> |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME) { | 849 if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME) { |
850 // This enumeration has "3" appended to its name to distinguish it from | 850 // This enumeration has "3" appended to its name to distinguish it from |
851 // older versions. | 851 // older versions. |
852 UMA_HISTOGRAM_SPARSE_SLOWLY( | 852 UMA_HISTOGRAM_SPARSE_SLOWLY( |
853 "Net.ErrorCodesForMainFrame3", | 853 "Net.ErrorCodesForMainFrame3", |
854 -loader->request()->status().error()); | 854 -loader->request()->status().error()); |
855 | 855 |
856 // Record time to success and error for the most common errors, and for | 856 // Record time to success and error for the most common errors, and for |
857 // the aggregate remainder errors. | 857 // the aggregate remainder errors. |
858 base::TimeDelta request_loading_time( | 858 base::TimeDelta request_loading_time( |
859 base::Time::Now() - loader->request()->request_time()); | 859 base::TimeTicks::Now() - loader->request()->creation_time()); |
860 switch (loader->request()->status().error()) { | 860 switch (loader->request()->status().error()) { |
861 case net::OK: | 861 case net::OK: |
862 UMA_HISTOGRAM_LONG_TIMES( | 862 UMA_HISTOGRAM_LONG_TIMES( |
863 "Net.RequestTime.Success", request_loading_time); | 863 "Net.RequestTime2.Success", request_loading_time); |
864 break; | 864 break; |
865 case net::ERR_ABORTED: | 865 case net::ERR_ABORTED: |
866 UMA_HISTOGRAM_LONG_TIMES( | 866 UMA_HISTOGRAM_LONG_TIMES( |
867 "Net.RequestTime.ErrAborted", request_loading_time); | 867 "Net.RequestTime2.ErrAborted", request_loading_time); |
868 break; | 868 break; |
869 case net::ERR_CONNECTION_RESET: | 869 case net::ERR_CONNECTION_RESET: |
870 UMA_HISTOGRAM_LONG_TIMES( | 870 UMA_HISTOGRAM_LONG_TIMES( |
871 "Net.RequestTime.ErrConnectionReset", request_loading_time); | 871 "Net.RequestTime2.ErrConnectionReset", request_loading_time); |
872 break; | 872 break; |
873 case net::ERR_CONNECTION_TIMED_OUT: | 873 case net::ERR_CONNECTION_TIMED_OUT: |
874 UMA_HISTOGRAM_LONG_TIMES( | 874 UMA_HISTOGRAM_LONG_TIMES( |
875 "Net.RequestTime.ErrConnectionTimedOut", request_loading_time); | 875 "Net.RequestTime2.ErrConnectionTimedOut", request_loading_time); |
876 break; | 876 break; |
877 case net::ERR_INTERNET_DISCONNECTED: | 877 case net::ERR_INTERNET_DISCONNECTED: |
878 UMA_HISTOGRAM_LONG_TIMES( | 878 UMA_HISTOGRAM_LONG_TIMES( |
879 "Net.RequestTime.ErrInternetDisconnected", request_loading_time); | 879 "Net.RequestTime2.ErrInternetDisconnected", request_loading_time); |
880 break; | 880 break; |
881 case net::ERR_NAME_NOT_RESOLVED: | 881 case net::ERR_NAME_NOT_RESOLVED: |
882 UMA_HISTOGRAM_LONG_TIMES( | 882 UMA_HISTOGRAM_LONG_TIMES( |
883 "Net.RequestTime.ErrNameNotResolved", request_loading_time); | 883 "Net.RequestTime2.ErrNameNotResolved", request_loading_time); |
884 break; | 884 break; |
885 case net::ERR_TIMED_OUT: | 885 case net::ERR_TIMED_OUT: |
886 UMA_HISTOGRAM_LONG_TIMES( | 886 UMA_HISTOGRAM_LONG_TIMES( |
887 "Net.RequestTime.ErrTimedOut", request_loading_time); | 887 "Net.RequestTime2.ErrTimedOut", request_loading_time); |
888 break; | 888 break; |
889 default: | 889 default: |
890 UMA_HISTOGRAM_LONG_TIMES( | 890 UMA_HISTOGRAM_LONG_TIMES( |
891 "Net.RequestTime.MiscError", request_loading_time); | 891 "Net.RequestTime2.MiscError", request_loading_time); |
892 break; | 892 break; |
893 } | 893 } |
894 | 894 |
895 if (loader->request()->url().SchemeIsCryptographic()) { | 895 if (loader->request()->url().SchemeIsCryptographic()) { |
896 if (loader->request()->url().host() == "www.google.com") { | 896 if (loader->request()->url().host() == "www.google.com") { |
897 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.ErrorCodesForHTTPSGoogleMainFrame2", | 897 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.ErrorCodesForHTTPSGoogleMainFrame2", |
898 -loader->request()->status().error()); | 898 -loader->request()->status().error()); |
899 } | 899 } |
900 | 900 |
901 int num_valid_scts = std::count_if( | 901 int num_valid_scts = std::count_if( |
(...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2352 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) | 2352 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) |
2353 && !policy->CanReadRawCookies(child_id)) { | 2353 && !policy->CanReadRawCookies(child_id)) { |
2354 VLOG(1) << "Denied unauthorized request for raw headers"; | 2354 VLOG(1) << "Denied unauthorized request for raw headers"; |
2355 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; | 2355 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; |
2356 } | 2356 } |
2357 | 2357 |
2358 return load_flags; | 2358 return load_flags; |
2359 } | 2359 } |
2360 | 2360 |
2361 } // namespace content | 2361 } // namespace content |
OLD | NEW |