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 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 ResourceRequestInfo* info = loader->GetRequestInfo(); | 855 ResourceRequestInfo* info = loader->GetRequestInfo(); |
856 | 856 |
857 // Record final result of all resource loads. | 857 // Record final result of all resource loads. |
858 if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME) { | 858 if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME) { |
859 // This enumeration has "3" appended to its name to distinguish it from | 859 // This enumeration has "3" appended to its name to distinguish it from |
860 // older versions. | 860 // older versions. |
861 UMA_HISTOGRAM_SPARSE_SLOWLY( | 861 UMA_HISTOGRAM_SPARSE_SLOWLY( |
862 "Net.ErrorCodesForMainFrame3", | 862 "Net.ErrorCodesForMainFrame3", |
863 -loader->request()->status().error()); | 863 -loader->request()->status().error()); |
864 | 864 |
865 if (loader->request()->url().SchemeIsSecure()) { | 865 if (loader->request()->url().SchemeIsCryptographic()) { |
866 if (loader->request()->url().host() == "www.google.com") { | 866 if (loader->request()->url().host() == "www.google.com") { |
867 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.ErrorCodesForHTTPSGoogleMainFrame2", | 867 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.ErrorCodesForHTTPSGoogleMainFrame2", |
868 -loader->request()->status().error()); | 868 -loader->request()->status().error()); |
869 } | 869 } |
870 | 870 |
871 int num_valid_scts = std::count_if( | 871 int num_valid_scts = std::count_if( |
872 loader->request()->ssl_info().signed_certificate_timestamps.begin(), | 872 loader->request()->ssl_info().signed_certificate_timestamps.begin(), |
873 loader->request()->ssl_info().signed_certificate_timestamps.end(), | 873 loader->request()->ssl_info().signed_certificate_timestamps.end(), |
874 IsValidatedSCT); | 874 IsValidatedSCT); |
875 UMA_HISTOGRAM_COUNTS_100( | 875 UMA_HISTOGRAM_COUNTS_100( |
876 "Net.CertificateTransparency.MainFrameValidSCTCount", num_valid_scts); | 876 "Net.CertificateTransparency.MainFrameValidSCTCount", num_valid_scts); |
877 } | 877 } |
878 } else { | 878 } else { |
879 if (info->GetResourceType() == RESOURCE_TYPE_IMAGE) { | 879 if (info->GetResourceType() == RESOURCE_TYPE_IMAGE) { |
880 UMA_HISTOGRAM_SPARSE_SLOWLY( | 880 UMA_HISTOGRAM_SPARSE_SLOWLY( |
881 "Net.ErrorCodesForImages", | 881 "Net.ErrorCodesForImages", |
882 -loader->request()->status().error()); | 882 -loader->request()->status().error()); |
883 } | 883 } |
884 // This enumeration has "2" appended to distinguish it from older versions. | 884 // This enumeration has "2" appended to distinguish it from older versions. |
885 UMA_HISTOGRAM_SPARSE_SLOWLY( | 885 UMA_HISTOGRAM_SPARSE_SLOWLY( |
886 "Net.ErrorCodesForSubresources2", | 886 "Net.ErrorCodesForSubresources2", |
887 -loader->request()->status().error()); | 887 -loader->request()->status().error()); |
888 } | 888 } |
889 | 889 |
890 if (loader->request()->url().SchemeIsSecure()) { | 890 if (loader->request()->url().SchemeIsCryptographic()) { |
891 RecordCertificateHistograms(loader->request()->ssl_info(), | 891 RecordCertificateHistograms(loader->request()->ssl_info(), |
892 info->GetResourceType()); | 892 info->GetResourceType()); |
893 } | 893 } |
894 | 894 |
895 if (delegate_) | 895 if (delegate_) |
896 delegate_->RequestComplete(loader->request()); | 896 delegate_->RequestComplete(loader->request()); |
897 | 897 |
898 // Destroy the ResourceLoader. | 898 // Destroy the ResourceLoader. |
899 RemovePendingRequest(info->GetChildID(), info->GetRequestID()); | 899 RemovePendingRequest(info->GetChildID(), info->GetRequestID()); |
900 } | 900 } |
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2345 | 2345 |
2346 // Add a flag to selectively bypass the data reduction proxy if the resource | 2346 // Add a flag to selectively bypass the data reduction proxy if the resource |
2347 // type is not an image. | 2347 // type is not an image. |
2348 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) | 2348 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) |
2349 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; | 2349 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; |
2350 | 2350 |
2351 return load_flags; | 2351 return load_flags; |
2352 } | 2352 } |
2353 | 2353 |
2354 } // namespace content | 2354 } // namespace content |
OLD | NEW |