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

Unified Diff: content/browser/renderer_host/resource_dispatcher_host.cc

Issue 6990058: Switch to the new CustomHistogram::ArrayToCustomRanges() utility (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again. Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/metrics/histogram.cc ('k') | net/base/host_resolver_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/resource_dispatcher_host.cc
diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc
index 8aade02e3ca6be9636a49c416181a5b12dec891b..ebca54cd7d262454f2c47b689f264bd28e90f4aa 100644
--- a/content/browser/renderer_host/resource_dispatcher_host.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host.cc
@@ -121,6 +121,14 @@ const int kMaxPendingDataMessages = 20;
// This bound is 25MB, which allows for around 6000 outstanding requests.
const int kMaxOutstandingRequestsCostPerProcess = 26214400;
+// All possible error codes from the network module. Note that the error codes
+// are all positive (since histograms expect positive sample values).
+const int kAllNetErrorCodes[] = {
+#define NET_ERROR(label, value) -(value),
+#include "net/base/net_error_list.h"
+#undef NET_ERROR
+};
+
// Aborts a request before an URLRequest has actually been created.
void AbortRequestBeforeItStarts(ResourceMessageFilter* filter,
IPC::Message* sync_result,
@@ -209,17 +217,6 @@ void PopulateResourceResponse(net::URLRequest* request,
&response->response_head.appcache_manifest_url);
}
-// Returns a list of all the possible error codes from the network module.
-// Note that the error codes are all positive (since histograms expect positive
-// sample values).
-std::vector<int> GetAllNetErrorCodes() {
- std::vector<int> all_error_codes;
-#define NET_ERROR(label, value) all_error_codes.push_back(-(value));
-#include "net/base/net_error_list.h"
-#undef NET_ERROR
- return all_error_codes;
-}
-
void RemoveDownloadFileFromChildSecurityPolicy(int child_id,
const FilePath& path) {
ChildProcessSecurityPolicy::GetInstance()->RevokeAllPermissionsForFile(
@@ -1582,9 +1579,14 @@ void ResourceDispatcherHost::OnResponseCompleted(net::URLRequest* request) {
if (!request->status().is_success() &&
info->resource_type() == ResourceType::MAIN_FRAME &&
request->status().os_error() != net::ERR_ABORTED) {
- UMA_HISTOGRAM_CUSTOM_ENUMERATION("Net.ErrorCodesForMainFrame",
- -request->status().os_error(),
- GetAllNetErrorCodes());
+ // This enumeration has "2" appended to its name to distinguish it from
+ // its original version. We changed the buckets at one point (added
+ // guard buckets by using CustomHistogram::ArrayToCustomRanges).
+ UMA_HISTOGRAM_CUSTOM_ENUMERATION(
+ "Net.ErrorCodesForMainFrame2",
+ -request->status().os_error(),
+ base::CustomHistogram::ArrayToCustomRanges(
+ kAllNetErrorCodes, arraysize(kAllNetErrorCodes)));
}
std::string security_info;
« no previous file with comments | « base/metrics/histogram.cc ('k') | net/base/host_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698