[Storage] Blob Storage Refactoring pt 1:
[chromium-blink-merge.git] / content / browser / service_worker / service_worker_metrics.cc
blob6e3ddf1d7aaded7762fd92449e45077a38047d8d
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/browser/service_worker/service_worker_metrics.h"
7 #include "base/metrics/histogram.h"
8 #include "base/metrics/user_metrics_action.h"
9 #include "content/public/browser/user_metrics.h"
11 namespace content {
13 // static
14 void ServiceWorkerMetrics::CountInitDiskCacheResult(bool result) {
15 UMA_HISTOGRAM_BOOLEAN("ServiceWorker.DiskCache.InitResult", result);
18 // static
19 void ServiceWorkerMetrics::CountReadResponseResult(
20 ServiceWorkerMetrics::ReadResponseResult result) {
21 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.DiskCache.ReadResponseResult",
22 result, NUM_READ_RESPONSE_RESULT_TYPES);
25 // static
26 void ServiceWorkerMetrics::CountWriteResponseResult(
27 ServiceWorkerMetrics::WriteResponseResult result) {
28 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.DiskCache.WriteResponseResult",
29 result, NUM_WRITE_RESPONSE_RESULT_TYPES);
32 // static
33 void ServiceWorkerMetrics::CountOpenDatabaseResult(
34 ServiceWorkerDatabase::Status status) {
35 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.Database.OpenResult",
36 status, ServiceWorkerDatabase::STATUS_ERROR_MAX);
39 // static
40 void ServiceWorkerMetrics::CountReadDatabaseResult(
41 ServiceWorkerDatabase::Status status) {
42 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.Database.ReadResult",
43 status, ServiceWorkerDatabase::STATUS_ERROR_MAX);
46 // static
47 void ServiceWorkerMetrics::CountWriteDatabaseResult(
48 ServiceWorkerDatabase::Status status) {
49 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.Database.WriteResult",
50 status, ServiceWorkerDatabase::STATUS_ERROR_MAX);
53 // static
54 void ServiceWorkerMetrics::CountControlledPageLoad() {
55 RecordAction(base::UserMetricsAction("ServiceWorker.ControlledPageLoad"));
58 } // namespace content