Use multiline attribute to check for IA2_STATE_MULTILINE.
[chromium-blink-merge.git] / content / browser / appcache / appcache_histograms.h
blob0fcc54cf65f964ed917d76f830a93c1b6bb82817
1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_HISTOGRAMS_H_
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_HISTOGRAMS_H_
8 #include "base/basictypes.h"
9 #include "content/browser/appcache/appcache_update_job.h"
11 namespace base {
12 class TimeDelta;
15 namespace content {
17 class AppCacheHistograms {
18 public:
19 enum InitResultType {
20 INIT_OK, SQL_DATABASE_ERROR, DISK_CACHE_ERROR,
21 NUM_INIT_RESULT_TYPES
23 static void CountInitResult(InitResultType init_result);
24 static void CountReinitAttempt(bool repeated_attempt);
25 static void CountCorruptionDetected();
26 static void CountUpdateJobResult(AppCacheUpdateJob::ResultType result,
27 const GURL& origin_url);
28 enum CheckResponseResultType {
29 RESPONSE_OK, MANIFEST_OUT_OF_DATE, RESPONSE_OUT_OF_DATE, ENTRY_NOT_FOUND,
30 READ_HEADERS_ERROR, READ_DATA_ERROR, UNEXPECTED_DATA_SIZE, CHECK_CANCELED,
31 NUM_CHECK_RESPONSE_RESULT_TYPES
33 static void CountCheckResponseResult(CheckResponseResultType result);
34 static void CountResponseRetrieval(
35 bool success, bool is_main_resource, const GURL& origin_url);
36 static void LogUpdateFailureStats(
37 const GURL& origin_url,
38 int percent_complete,
39 bool was_making_progress,
40 bool off_origin_resource_failure);
41 static void AddTaskQueueTimeSample(const base::TimeDelta& duration);
42 static void AddTaskRunTimeSample(const base::TimeDelta& duration);
43 static void AddCompletionQueueTimeSample(const base::TimeDelta& duration);
44 static void AddCompletionRunTimeSample(const base::TimeDelta& duration);
45 static void AddNetworkJobStartDelaySample(const base::TimeDelta& duration);
46 static void AddErrorJobStartDelaySample(const base::TimeDelta& duration);
47 static void AddAppCacheJobStartDelaySample(const base::TimeDelta& duration);
48 static void AddMissingManifestEntrySample();
50 enum MissingManifestCallsiteType {
51 CALLSITE_0, CALLSITE_1, CALLSITE_2, CALLSITE_3,
52 NUM_MISSING_MANIFEST_CALLSITE_TYPES
54 static void AddMissingManifestDetectedAtCallsite(
55 MissingManifestCallsiteType type);
57 private:
58 DISALLOW_IMPLICIT_CONSTRUCTORS(AppCacheHistograms);
61 } // namespace content
63 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_HISTOGRAMS_H_