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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 14093027: Add histogram for image errors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update to use SPARSE_SLOWLY Created 7 years, 8 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index f3a441b8a5a2a0e7d28e2d62382feb5762d39621..0c6463b31060c39168a7d59d3cf4ee03be583e28 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -18,6 +18,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "base/metrics/histogram.h"
+#include "base/metrics/sparse_histogram.h"
#include "base/shared_memory.h"
#include "base/stl_util.h"
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
@@ -741,27 +742,26 @@ void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) {
if (info->GetResourceType() == ResourceType::MAIN_FRAME) {
// This enumeration has "3" appended to its name to distinguish it from
// older versions.
- UMA_HISTOGRAM_CUSTOM_ENUMERATION(
+ UMA_HISTOGRAM_SPARSE_SLOWLY(
"Net.ErrorCodesForMainFrame3",
- -loader->request()->status().error(),
- base::CustomHistogram::ArrayToCustomRanges(
- kAllNetErrorCodes, arraysize(kAllNetErrorCodes)));
+ -loader->request()->status().error());
if (loader->request()->url().SchemeIsSecure() &&
loader->request()->url().host() == "www.google.com") {
- UMA_HISTOGRAM_CUSTOM_ENUMERATION(
+ UMA_HISTOGRAM_SPARSE_SLOWLY(
"Net.ErrorCodesForHTTPSGoogleMainFrame2",
- -loader->request()->status().error(),
- base::CustomHistogram::ArrayToCustomRanges(
- kAllNetErrorCodes, arraysize(kAllNetErrorCodes)));
+ -loader->request()->status().error());
}
} else {
+ if (info->GetResourceType() == ResourceType::IMAGE) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY(
+ "Net.ErrorCodesForImages",
+ -loader->request()->status().error());
+ }
// This enumeration has "2" appended to distinguish it from older versions.
- UMA_HISTOGRAM_CUSTOM_ENUMERATION(
+ UMA_HISTOGRAM_SPARSE_SLOWLY(
"Net.ErrorCodesForSubresources2",
- -loader->request()->status().error(),
- base::CustomHistogram::ArrayToCustomRanges(
- kAllNetErrorCodes, arraysize(kAllNetErrorCodes)));
+ -loader->request()->status().error());
}
// Destroy the ResourceLoader.
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698