| 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 #include "content/browser/loader/resource_loader.h" | 5 #include "content/browser/loader/resource_loader.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "content/browser/ssl/ssl_client_auth_handler.h" | 21 #include "content/browser/ssl/ssl_client_auth_handler.h" |
| 22 #include "content/browser/ssl/ssl_manager.h" | 22 #include "content/browser/ssl/ssl_manager.h" |
| 23 #include "content/browser/ssl/ssl_policy.h" | 23 #include "content/browser/ssl/ssl_policy.h" |
| 24 #include "content/common/ssl_status_serialization.h" | 24 #include "content/common/ssl_status_serialization.h" |
| 25 #include "content/public/browser/cert_store.h" | 25 #include "content/public/browser/cert_store.h" |
| 26 #include "content/public/browser/resource_context.h" | 26 #include "content/public/browser/resource_context.h" |
| 27 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" | 27 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" |
| 28 #include "content/public/browser/signed_certificate_timestamp_store.h" | 28 #include "content/public/browser/signed_certificate_timestamp_store.h" |
| 29 #include "content/public/common/content_client.h" | 29 #include "content/public/common/content_client.h" |
| 30 #include "content/public/common/content_switches.h" | 30 #include "content/public/common/content_switches.h" |
| 31 #include "content/public/common/data_reduction_proxy_lofi_user_data.h" |
| 31 #include "content/public/common/process_type.h" | 32 #include "content/public/common/process_type.h" |
| 32 #include "content/public/common/resource_response.h" | 33 #include "content/public/common/resource_response.h" |
| 33 #include "content/public/common/security_style.h" | 34 #include "content/public/common/security_style.h" |
| 34 #include "net/base/io_buffer.h" | 35 #include "net/base/io_buffer.h" |
| 35 #include "net/base/load_flags.h" | 36 #include "net/base/load_flags.h" |
| 36 #include "net/http/http_response_headers.h" | 37 #include "net/http/http_response_headers.h" |
| 37 #include "net/ssl/client_cert_store.h" | 38 #include "net/ssl/client_cert_store.h" |
| 38 #include "net/url_request/redirect_info.h" | 39 #include "net/url_request/redirect_info.h" |
| 39 #include "net/url_request/url_request_status.h" | 40 #include "net/url_request/url_request_status.h" |
| 40 | 41 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 request->GetMimeType(&response->head.mime_type); | 88 request->GetMimeType(&response->head.mime_type); |
| 88 net::HttpResponseInfo response_info = request->response_info(); | 89 net::HttpResponseInfo response_info = request->response_info(); |
| 89 response->head.was_fetched_via_spdy = response_info.was_fetched_via_spdy; | 90 response->head.was_fetched_via_spdy = response_info.was_fetched_via_spdy; |
| 90 response->head.was_npn_negotiated = response_info.was_npn_negotiated; | 91 response->head.was_npn_negotiated = response_info.was_npn_negotiated; |
| 91 response->head.npn_negotiated_protocol = | 92 response->head.npn_negotiated_protocol = |
| 92 response_info.npn_negotiated_protocol; | 93 response_info.npn_negotiated_protocol; |
| 93 response->head.connection_info = response_info.connection_info; | 94 response->head.connection_info = response_info.connection_info; |
| 94 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy(); | 95 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy(); |
| 95 response->head.proxy_server = response_info.proxy_server; | 96 response->head.proxy_server = response_info.proxy_server; |
| 96 response->head.socket_address = request->GetSocketAddress(); | 97 response->head.socket_address = request->GetSocketAddress(); |
| 98 response->head.is_lofi = |
| 99 static_cast<content::DataReductionProxyLoFiUserData*>( |
| 100 request->GetUserData(DataReductionProxyLoFiUserData::kUserDataKey)) |
| 101 ->lofi_state() == LOFI_ON; |
| 97 if (ServiceWorkerRequestHandler* handler = | 102 if (ServiceWorkerRequestHandler* handler = |
| 98 ServiceWorkerRequestHandler::GetHandler(request)) { | 103 ServiceWorkerRequestHandler::GetHandler(request)) { |
| 99 handler->GetExtraResponseInfo(&response->head); | 104 handler->GetExtraResponseInfo(&response->head); |
| 100 } | 105 } |
| 101 AppCacheInterceptor::GetExtraResponseInfo( | 106 AppCacheInterceptor::GetExtraResponseInfo( |
| 102 request, &response->head.appcache_id, | 107 request, &response->head.appcache_id, |
| 103 &response->head.appcache_manifest_url); | 108 &response->head.appcache_manifest_url); |
| 104 if (info->is_load_timing_enabled()) | 109 if (info->is_load_timing_enabled()) |
| 105 request->GetLoadTimingInfo(&response->head.load_timing); | 110 request->GetLoadTimingInfo(&response->head.load_timing); |
| 106 | 111 |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 case net::URLRequestStatus::FAILED: | 701 case net::URLRequestStatus::FAILED: |
| 697 status = STATUS_UNDEFINED; | 702 status = STATUS_UNDEFINED; |
| 698 break; | 703 break; |
| 699 } | 704 } |
| 700 | 705 |
| 701 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 706 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
| 702 } | 707 } |
| 703 } | 708 } |
| 704 | 709 |
| 705 } // namespace content | 710 } // namespace content |
| OLD | NEW |