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

Unified Diff: webkit/browser/appcache/appcache_histograms.cc

Issue 344493002: Move all remaining appcache-related code to content namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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
Index: webkit/browser/appcache/appcache_histograms.cc
diff --git a/webkit/browser/appcache/appcache_histograms.cc b/webkit/browser/appcache/appcache_histograms.cc
deleted file mode 100644
index b7299e658f378cc2aae075fafe2cad8e34192ea8..0000000000000000000000000000000000000000
--- a/webkit/browser/appcache/appcache_histograms.cc
+++ /dev/null
@@ -1,154 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "webkit/browser/appcache/appcache_histograms.h"
-
-#include "base/metrics/histogram.h"
-
-namespace appcache {
-
-static std::string OriginToCustomHistogramSuffix(const GURL& origin_url) {
- if (origin_url.host() == "docs.google.com")
- return ".Docs";
- return std::string();
-}
-
-void AppCacheHistograms::CountInitResult(InitResultType init_result) {
- UMA_HISTOGRAM_ENUMERATION(
- "appcache.InitResult",
- init_result, NUM_INIT_RESULT_TYPES);
-}
-
-void AppCacheHistograms::CountReinitAttempt(bool repeated_attempt) {
- UMA_HISTOGRAM_BOOLEAN("appcache.ReinitAttempt", repeated_attempt);
-}
-
-void AppCacheHistograms::CountCorruptionDetected() {
- UMA_HISTOGRAM_BOOLEAN("appcache.CorruptionDetected", true);
-}
-
-void AppCacheHistograms::CountUpdateJobResult(
- AppCacheUpdateJob::ResultType result,
- const GURL& origin_url) {
- UMA_HISTOGRAM_ENUMERATION(
- "appcache.UpdateJobResult",
- result, AppCacheUpdateJob::NUM_UPDATE_JOB_RESULT_TYPES);
-
- const std::string suffix = OriginToCustomHistogramSuffix(origin_url);
- if (!suffix.empty()) {
- base::LinearHistogram::FactoryGet(
- "appcache.UpdateJobResult" + suffix,
- 1,
- AppCacheUpdateJob::NUM_UPDATE_JOB_RESULT_TYPES,
- AppCacheUpdateJob::NUM_UPDATE_JOB_RESULT_TYPES + 1,
- base::HistogramBase::kUmaTargetedHistogramFlag)->Add(result);
- }
-}
-
-void AppCacheHistograms::CountCheckResponseResult(
- CheckResponseResultType result) {
- UMA_HISTOGRAM_ENUMERATION(
- "appcache.CheckResponseResult",
- result, NUM_CHECK_RESPONSE_RESULT_TYPES);
-}
-
-void AppCacheHistograms::CountResponseRetrieval(
- bool success, bool is_main_resource, const GURL& origin_url) {
- std::string label;
- if (is_main_resource) {
- label = "appcache.MainResourceResponseRetrieval";
- UMA_HISTOGRAM_BOOLEAN(label, success);
- } else {
- label = "appcache.SubResourceResponseRetrieval";
- UMA_HISTOGRAM_BOOLEAN(label, success);
- }
- const std::string suffix = OriginToCustomHistogramSuffix(origin_url);
- if (!suffix.empty()) {
- base::BooleanHistogram::FactoryGet(
- label + suffix,
- base::HistogramBase::kUmaTargetedHistogramFlag)->Add(success);
- }
-}
-
-void AppCacheHistograms::LogUpdateFailureStats(
- const GURL& origin_url,
- int percent_complete,
- bool was_stalled,
- bool was_off_origin_resource_failure) {
- const std::string suffix = OriginToCustomHistogramSuffix(origin_url);
-
- std::string label = "appcache.UpdateProgressAtPointOfFaliure";
- UMA_HISTOGRAM_PERCENTAGE(label, percent_complete);
- if (!suffix.empty()) {
- base::LinearHistogram::FactoryGet(
- label + suffix,
- 1, 101, 102,
- base::HistogramBase::kUmaTargetedHistogramFlag)->Add(percent_complete);
- }
-
- label = "appcache.UpdateWasStalledAtPointOfFailure";
- UMA_HISTOGRAM_BOOLEAN(label, was_stalled);
- if (!suffix.empty()) {
- base::BooleanHistogram::FactoryGet(
- label + suffix,
- base::HistogramBase::kUmaTargetedHistogramFlag)->Add(was_stalled);
- }
-
- label = "appcache.UpdateWasOffOriginAtPointOfFailure";
- UMA_HISTOGRAM_BOOLEAN(label, was_off_origin_resource_failure);
- if (!suffix.empty()) {
- base::BooleanHistogram::FactoryGet(
- label + suffix,
- base::HistogramBase::kUmaTargetedHistogramFlag)->Add(
- was_off_origin_resource_failure);
- }
-}
-
-void AppCacheHistograms::AddTaskQueueTimeSample(
- const base::TimeDelta& duration) {
- UMA_HISTOGRAM_TIMES("appcache.TaskQueueTime", duration);
-}
-
-void AppCacheHistograms::AddTaskRunTimeSample(
- const base::TimeDelta& duration) {
- UMA_HISTOGRAM_TIMES("appcache.TaskRunTime", duration);
-}
-
-void AppCacheHistograms::AddCompletionQueueTimeSample(
- const base::TimeDelta& duration) {
- UMA_HISTOGRAM_TIMES("appcache.CompletionQueueTime", duration);
-}
-
-void AppCacheHistograms::AddCompletionRunTimeSample(
- const base::TimeDelta& duration) {
- UMA_HISTOGRAM_TIMES("appcache.CompletionRunTime", duration);
-}
-
-void AppCacheHistograms::AddNetworkJobStartDelaySample(
- const base::TimeDelta& duration) {
- UMA_HISTOGRAM_TIMES("appcache.JobStartDelay.Network", duration);
-}
-
-void AppCacheHistograms::AddErrorJobStartDelaySample(
- const base::TimeDelta& duration) {
- UMA_HISTOGRAM_TIMES("appcache.JobStartDelay.Error", duration);
-}
-
-void AppCacheHistograms::AddAppCacheJobStartDelaySample(
- const base::TimeDelta& duration) {
- UMA_HISTOGRAM_TIMES("appcache.JobStartDelay.AppCache", duration);
-}
-
-void AppCacheHistograms::AddMissingManifestEntrySample() {
- UMA_HISTOGRAM_BOOLEAN("appcache.MissingManifestEntry", true);
-}
-
-void AppCacheHistograms::AddMissingManifestDetectedAtCallsite(
- MissingManifestCallsiteType callsite) {
- UMA_HISTOGRAM_ENUMERATION(
- "appcache.MissingManifestDetectedAtCallsite",
- callsite, NUM_MISSING_MANIFEST_CALLSITE_TYPES);
-}
-
-} // namespace appcache

Powered by Google App Engine
This is Rietveld 408576698