Chromium Code Reviews| 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 c92d1d6aebfaa168f3ea48a65728058bd74c6cff..8ca515be046e190c9be616d0483f859cd7801c59 100644 |
| --- a/content/browser/renderer_host/resource_dispatcher_host.cc |
| +++ b/content/browser/renderer_host/resource_dispatcher_host.cc |
| @@ -123,6 +123,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, |
| @@ -211,17 +219,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( |
| @@ -1607,9 +1604,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", |
|
jar (doing other things)
2011/05/24 18:10:07
Be sure to submit a related addition to histograms
Jói
2011/05/24 18:27:31
Thanks for the reminder; preparing that now.
|
| + -request->status().os_error(), |
| + base::CustomHistogram::ArrayToCustomRanges( |
| + kAllNetErrorCodes, arraysize(kAllNetErrorCodes))); |
| } |
| std::string security_info; |