summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-26 14:28:27 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-26 14:28:27 +0000
commitc89b244483969aa8859a1d4bb3396f6ceb54f875 (patch)
tree1feb67c4c99317335f9969fa2ef20f9c2a602817 /content
parent8d6bc14ce560d5549ee0e0c6784bd0f8f48757d6 (diff)
downloadchromium_src-c89b244483969aa8859a1d4bb3396f6ceb54f875.zip
chromium_src-c89b244483969aa8859a1d4bb3396f6ceb54f875.tar.gz
chromium_src-c89b244483969aa8859a1d4bb3396f6ceb54f875.tar.bz2
Switch to the new CustomHistogram::ArrayToCustomRanges() utility
function where appropriate. Add a DCHECK which may be useful to detect incorrect usage. BUG=none TEST=net_unittests, unit_tests Review URL: http://codereview.chromium.org/6990058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86822 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/renderer_host/resource_dispatcher_host.cc30
1 files changed, 16 insertions, 14 deletions
diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc
index 8aade02..ebca54c 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;