Home | History | Annotate | Download | only in appcache
      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.
      4 
      5 #ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_HISTOGRAMS_H_
      6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_HISTOGRAMS_H_
      7 
      8 #include "base/basictypes.h"
      9 
     10 namespace base {
     11 class TimeDelta;
     12 }
     13 
     14 namespace appcache {
     15 
     16 class AppCacheHistograms {
     17  public:
     18   enum InitResultType {
     19     INIT_OK, SQL_DATABASE_ERROR, DISK_CACHE_ERROR,
     20     NUM_INIT_RESULT_TYPES
     21   };
     22   static void CountInitResult(InitResultType init_result);
     23 
     24   enum CheckResponseResultType {
     25     RESPONSE_OK, MANIFEST_OUT_OF_DATE, RESPONSE_OUT_OF_DATE, ENTRY_NOT_FOUND,
     26     READ_HEADERS_ERROR, READ_DATA_ERROR, UNEXPECTED_DATA_SIZE, CHECK_CANCELED,
     27     NUM_CHECK_RESPONSE_RESULT_TYPES
     28   };
     29   static void CountCheckResponseResult(CheckResponseResultType result);
     30 
     31   static void AddTaskQueueTimeSample(const base::TimeDelta& duration);
     32   static void AddTaskRunTimeSample(const base::TimeDelta& duration);
     33   static void AddCompletionQueueTimeSample(const base::TimeDelta& duration);
     34   static void AddCompletionRunTimeSample(const base::TimeDelta& duration);
     35   static void AddNetworkJobStartDelaySample(const base::TimeDelta& duration);
     36   static void AddErrorJobStartDelaySample(const base::TimeDelta& duration);
     37   static void AddAppCacheJobStartDelaySample(const base::TimeDelta& duration);
     38   static void AddMissingManifestEntrySample();
     39 
     40   enum MissingManifestCallsiteType {
     41     CALLSITE_0, CALLSITE_1, CALLSITE_2, CALLSITE_3,
     42     NUM_MISSING_MANIFEST_CALLSITE_TYPES
     43   };
     44   static void AddMissingManifestDetectedAtCallsite(
     45       MissingManifestCallsiteType type);
     46 
     47  private:
     48   DISALLOW_IMPLICIT_CONSTRUCTORS(AppCacheHistograms);
     49 };
     50 
     51 }  // namespace appcache
     52 
     53 #endif  // WEBKIT_BROWSER_APPCACHE_APPCACHE_HISTOGRAMS_H_
     54