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

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

Issue 2119623002: Add metrics to track HTTP/0.9 usage for main frames and subresources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: placate clang Created 4 years, 5 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
« no previous file with comments | « no previous file | net/http/http_response_info.h » ('j') | net/http/http_response_info.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 } 702 }
703 } 703 }
704 704
705 void ResourceLoader::CallDidFinishLoading() { 705 void ResourceLoader::CallDidFinishLoading() {
706 TRACE_EVENT_WITH_FLOW0("loading", "ResourceLoader::CallDidFinishLoading", 706 TRACE_EVENT_WITH_FLOW0("loading", "ResourceLoader::CallDidFinishLoading",
707 this, TRACE_EVENT_FLAG_FLOW_IN); 707 this, TRACE_EVENT_FLAG_FLOW_IN);
708 delegate_->DidFinishLoading(this); 708 delegate_->DidFinishLoading(this);
709 } 709 }
710 710
711 void ResourceLoader::RecordHistograms() { 711 void ResourceLoader::RecordHistograms() {
712 if (request_->response_info().network_accessed) { 712 if (request_->response_info().network_accessed) {
Bence 2016/06/30 21:20:11 Why is Net.HttpResponseInfo.ConnectionInfo only re
mmenke 2016/06/30 22:18:07 I've gone back and forth on this numerous times:
713 UMA_HISTOGRAM_ENUMERATION("Net.HttpResponseInfo.ConnectionInfo", 713 UMA_HISTOGRAM_ENUMERATION("Net.HttpResponseInfo.ConnectionInfo",
Bence 2016/06/30 21:20:11 Since you are changing enum ConnectionInfo, I prop
mmenke 2016/06/30 22:18:06 Removed and obsoleted.
714 request_->response_info().connection_info, 714 request_->response_info().connection_info,
715 net::HttpResponseInfo::NUM_OF_CONNECTION_INFOS); 715 net::HttpResponseInfo::NUM_OF_CONNECTION_INFOS);
716 } 716 }
717 717
718 ResourceRequestInfoImpl* info = GetRequestInfo(); 718 ResourceRequestInfoImpl* info = GetRequestInfo();
719 719
720 if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME) {
721 UMA_HISTOGRAM_ENUMERATION("Net.HttpResponseInfo.ConnectionInfo.SubResource",
Bence 2016/06/30 21:20:11 I think you got the two branches backwards.
mmenke 2016/06/30 22:18:07 Thanks for catching that! Done.
722 request_->response_info().connection_info,
723 net::HttpResponseInfo::NUM_OF_CONNECTION_INFOS);
724 } else {
725 UMA_HISTOGRAM_ENUMERATION("Net.HttpResponseInfo.ConnectionInfo.MainFrame",
726 request_->response_info().connection_info,
727 net::HttpResponseInfo::NUM_OF_CONNECTION_INFOS);
728 }
729
720 if (info->GetResourceType() == RESOURCE_TYPE_PREFETCH) { 730 if (info->GetResourceType() == RESOURCE_TYPE_PREFETCH) {
721 PrefetchStatus status = STATUS_UNDEFINED; 731 PrefetchStatus status = STATUS_UNDEFINED;
722 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time(); 732 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time();
723 733
724 switch (request_->status().status()) { 734 switch (request_->status().status()) {
725 case net::URLRequestStatus::SUCCESS: 735 case net::URLRequestStatus::SUCCESS:
726 if (request_->was_cached()) { 736 if (request_->was_cached()) {
727 status = STATUS_SUCCESS_FROM_CACHE; 737 status = STATUS_SUCCESS_FROM_CACHE;
728 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentPrefetchingFromCache", 738 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentPrefetchingFromCache",
729 total_time); 739 total_time);
(...skipping 14 matching lines...) Expand all
744 } 754 }
745 755
746 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); 756 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX);
747 } else if (request_->response_info().unused_since_prefetch) { 757 } else if (request_->response_info().unused_since_prefetch) {
748 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time(); 758 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time();
749 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time); 759 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time);
750 } 760 }
751 } 761 }
752 762
753 } // namespace content 763 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | net/http/http_response_info.h » ('j') | net/http/http_response_info.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698