Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: content/browser/loader/resource_loader.cc

Issue 2484633004: Change Lo-Fi bool to bitmask to support multiple Previews types (Closed)
Patch Set: fix ContentResourceProviderTest Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 net::HttpResponseInfo response_info = request->response_info(); 60 net::HttpResponseInfo response_info = request->response_info();
61 response->head.was_fetched_via_spdy = response_info.was_fetched_via_spdy; 61 response->head.was_fetched_via_spdy = response_info.was_fetched_via_spdy;
62 response->head.was_alpn_negotiated = response_info.was_alpn_negotiated; 62 response->head.was_alpn_negotiated = response_info.was_alpn_negotiated;
63 response->head.alpn_negotiated_protocol = 63 response->head.alpn_negotiated_protocol =
64 response_info.alpn_negotiated_protocol; 64 response_info.alpn_negotiated_protocol;
65 response->head.connection_info = response_info.connection_info; 65 response->head.connection_info = response_info.connection_info;
66 response->head.socket_address = response_info.socket_address; 66 response->head.socket_address = response_info.socket_address;
67 const content::ResourceRequestInfo* request_info = 67 const content::ResourceRequestInfo* request_info =
68 content::ResourceRequestInfo::ForRequest(request); 68 content::ResourceRequestInfo::ForRequest(request);
69 if (request_info) 69 if (request_info)
70 response->head.is_using_lofi = request_info->IsUsingLoFi(); 70 response->head.previews_state = request_info->GetPreviewsState();
71 71
72 response->head.effective_connection_type = 72 response->head.effective_connection_type =
73 net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN; 73 net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN;
74 74
75 if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME) { 75 if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME) {
76 DCHECK(info->IsMainFrame()); 76 DCHECK(info->IsMainFrame());
77 net::NetworkQualityEstimator* estimator = 77 net::NetworkQualityEstimator* estimator =
78 request->context()->network_quality_estimator(); 78 request->context()->network_quality_estimator();
79 if (estimator) { 79 if (estimator) {
80 response->head.effective_connection_type = 80 response->head.effective_connection_type =
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", prefetch_status, 740 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", prefetch_status,
741 STATUS_MAX); 741 STATUS_MAX);
742 } 742 }
743 } else if (request_->response_info().unused_since_prefetch) { 743 } else if (request_->response_info().unused_since_prefetch) {
744 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time(); 744 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time();
745 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time); 745 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time);
746 } 746 }
747 } 747 }
748 748
749 } // namespace content 749 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/browser/loader/resource_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698