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
6/* From private/ppb_uma_private.idl modified Fri Mar 14 16:59:33 2014. */
7
8#ifndef PPAPI_C_PRIVATE_PPB_UMA_PRIVATE_H_
9#define PPAPI_C_PRIVATE_PPB_UMA_PRIVATE_H_
10
11#include "ppapi/c/pp_bool.h"
12#include "ppapi/c/pp_completion_callback.h"
13#include "ppapi/c/pp_instance.h"
14#include "ppapi/c/pp_macros.h"
15#include "ppapi/c/pp_stdint.h"
16#include "ppapi/c/pp_var.h"
17
18#define PPB_UMA_PRIVATE_INTERFACE_0_3 "PPB_UMA_Private;0.3"
19#define PPB_UMA_PRIVATE_INTERFACE PPB_UMA_PRIVATE_INTERFACE_0_3
20
21/**
22 * @file
23 * This file defines the <code>PPB_UMA_Private</code> interface.
24 */
25
26
27/**
28 * @addtogroup Interfaces
29 * @{
30 */
31/**
32 * Contains functions for plugins to report UMA usage stats.
33 */
34struct PPB_UMA_Private_0_3 {
35  /**
36   * HistogramCustomTimes is a pointer to a function which records a time
37   * sample given in milliseconds in the histogram given by |name|, possibly
38   * creating the histogram if it does not exist.
39   */
40  void (*HistogramCustomTimes)(PP_Instance instance,
41                               struct PP_Var name,
42                               int64_t sample,
43                               int64_t min,
44                               int64_t max,
45                               uint32_t bucket_count);
46  /**
47   * HistogramCustomCounts is a pointer to a function which records a sample
48   * in the histogram given by |name|, possibly creating the histogram if it
49   * does not exist.
50   */
51  void (*HistogramCustomCounts)(PP_Instance instance,
52                                struct PP_Var name,
53                                int32_t sample,
54                                int32_t min,
55                                int32_t max,
56                                uint32_t bucket_count);
57  /**
58   * HistogramEnumeration is a pointer to a function which records a sample
59   * in the histogram given by |name|, possibly creating the histogram if it
60   * does not exist.  The sample represents a value in an enumeration bounded
61   * by |boundary_value|, that is, sample < boundary_value always.
62   */
63  void (*HistogramEnumeration)(PP_Instance instance,
64                               struct PP_Var name,
65                               int32_t sample,
66                               int32_t boundary_value);
67  /**
68   * IsCrashReportingEnabled returns PP_OK to the completion callback to
69   * indicate that the current user has opted-in to crash reporting, or
70   * PP_ERROR_* on failure or when a user has not opted-in.  This can be used to
71   * gate other reporting processes such as analytics and crash reporting.
72   */
73  int32_t (*IsCrashReportingEnabled)(PP_Instance instance,
74                                     struct PP_CompletionCallback callback);
75};
76
77typedef struct PPB_UMA_Private_0_3 PPB_UMA_Private;
78/**
79 * @}
80 */
81
82#endif  /* PPAPI_C_PRIVATE_PPB_UMA_PRIVATE_H_ */
83
84