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> |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 return sct_status.status == net::ct::SCT_STATUS_OK; | 310 return sct_status.status == net::ct::SCT_STATUS_OK; |
| 311 } | 311 } |
| 312 | 312 |
| 313 webkit_blob::BlobStorageContext* GetBlobStorageContext( | 313 webkit_blob::BlobStorageContext* GetBlobStorageContext( |
| 314 ResourceMessageFilter* filter) { | 314 ResourceMessageFilter* filter) { |
| 315 if (!filter->blob_storage_context()) | 315 if (!filter->blob_storage_context()) |
| 316 return NULL; | 316 return NULL; |
| 317 return filter->blob_storage_context()->context(); | 317 return filter->blob_storage_context()->context(); |
| 318 } | 318 } |
| 319 | 319 |
| 320 enum CacheStorable { | |
| 321 // A "cache-control: no-store" header was found. | |
| 322 CACHE_STORABLE_NO_STORE, | |
| 323 // No "no-store" header was found. | |
| 324 CACHE_STORABLE_STORE, | |
| 325 CACHE_STORABLE_MAX | |
| 326 }; | |
| 327 | |
| 320 } // namespace | 328 } // namespace |
| 321 | 329 |
| 322 // static | 330 // static |
| 323 ResourceDispatcherHost* ResourceDispatcherHost::Get() { | 331 ResourceDispatcherHost* ResourceDispatcherHost::Get() { |
| 324 return g_resource_dispatcher_host; | 332 return g_resource_dispatcher_host; |
| 325 } | 333 } |
| 326 | 334 |
| 327 ResourceDispatcherHostImpl::ResourceDispatcherHostImpl() | 335 ResourceDispatcherHostImpl::ResourceDispatcherHostImpl() |
| 328 : save_file_manager_(new SaveFileManager()), | 336 : save_file_manager_(new SaveFileManager()), |
| 329 request_id_(-1), | 337 request_id_(-1), |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 762 -loader->request()->status().error()); | 770 -loader->request()->status().error()); |
| 763 } | 771 } |
| 764 | 772 |
| 765 int num_valid_scts = std::count_if( | 773 int num_valid_scts = std::count_if( |
| 766 loader->request()->ssl_info().signed_certificate_timestamps.begin(), | 774 loader->request()->ssl_info().signed_certificate_timestamps.begin(), |
| 767 loader->request()->ssl_info().signed_certificate_timestamps.end(), | 775 loader->request()->ssl_info().signed_certificate_timestamps.end(), |
| 768 IsValidatedSCT); | 776 IsValidatedSCT); |
| 769 UMA_HISTOGRAM_COUNTS_100( | 777 UMA_HISTOGRAM_COUNTS_100( |
| 770 "Net.CertificateTransparency.MainFrameValidSCTCount", num_valid_scts); | 778 "Net.CertificateTransparency.MainFrameValidSCTCount", num_valid_scts); |
| 771 } | 779 } |
| 780 | |
| 781 net::HttpResponseHeaders* response_headers = | |
| 782 loader->request()->response_headers(); | |
| 783 if (response_headers) { | |
| 784 CacheStorable storable = | |
| 785 response_headers->HasHeaderValue("cache-control", "no-store") | |
| 786 ? CACHE_STORABLE_NO_STORE | |
| 787 : CACHE_STORABLE_STORE; | |
|
davidben
2014/06/11 16:28:01
This could also just be a boolean with UMA_HISTOGR
jkarlin
2014/06/11 16:50:06
True, that's simpler. Went with BOOLEAN.
| |
| 788 UMA_HISTOGRAM_ENUMERATION( | |
| 789 "Net.MainFrameStorable", storable, CACHE_STORABLE_MAX); | |
| 790 } | |
| 772 } else { | 791 } else { |
| 773 if (info->GetResourceType() == ResourceType::IMAGE) { | 792 if (info->GetResourceType() == ResourceType::IMAGE) { |
| 774 UMA_HISTOGRAM_SPARSE_SLOWLY( | 793 UMA_HISTOGRAM_SPARSE_SLOWLY( |
| 775 "Net.ErrorCodesForImages", | 794 "Net.ErrorCodesForImages", |
| 776 -loader->request()->status().error()); | 795 -loader->request()->status().error()); |
| 777 } | 796 } |
| 778 // This enumeration has "2" appended to distinguish it from older versions. | 797 // This enumeration has "2" appended to distinguish it from older versions. |
| 779 UMA_HISTOGRAM_SPARSE_SLOWLY( | 798 UMA_HISTOGRAM_SPARSE_SLOWLY( |
| 780 "Net.ErrorCodesForSubresources2", | 799 "Net.ErrorCodesForSubresources2", |
| 781 -loader->request()->status().error()); | 800 -loader->request()->status().error()); |
| (...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1978 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) | 1997 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) |
| 1979 && !policy->CanReadRawCookies(child_id)) { | 1998 && !policy->CanReadRawCookies(child_id)) { |
| 1980 VLOG(1) << "Denied unauthorized request for raw headers"; | 1999 VLOG(1) << "Denied unauthorized request for raw headers"; |
| 1981 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; | 2000 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; |
| 1982 } | 2001 } |
| 1983 | 2002 |
| 1984 return load_flags; | 2003 return load_flags; |
| 1985 } | 2004 } |
| 1986 | 2005 |
| 1987 } // namespace content | 2006 } // namespace content |
| OLD | NEW |