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 // From private/ppb_uma_private.idl modified Wed Jan 27 17:10:16 2016.
6
7 #include <stdint.h>
8
9 #include "ppapi/c/pp_completion_callback.h"
10 #include "ppapi/c/pp_errors.h"
11 #include "ppapi/c/private/ppb_uma_private.h"
12 #include "ppapi/shared_impl/tracked_callback.h"
13 #include "ppapi/thunk/enter.h"
14 #include "ppapi/thunk/ppapi_thunk_export.h"
15 #include "ppapi/thunk/ppb_uma_singleton_api.h"
16
17 namespace ppapi {
18 namespace thunk {
19
20 namespace {
21
HistogramCustomTimes(PP_Instance instance,struct PP_Var name,int64_t sample,int64_t min,int64_t max,uint32_t bucket_count)22 void HistogramCustomTimes(PP_Instance instance,
23 struct PP_Var name,
24 int64_t sample,
25 int64_t min,
26 int64_t max,
27 uint32_t bucket_count) {
28 VLOG(4) << "PPB_UMA_Private::HistogramCustomTimes()";
29 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance);
30 if (enter.failed())
31 return;
32 enter.functions()->HistogramCustomTimes(instance, name, sample, min, max,
33 bucket_count);
34 }
35
HistogramCustomCounts(PP_Instance instance,struct PP_Var name,int32_t sample,int32_t min,int32_t max,uint32_t bucket_count)36 void HistogramCustomCounts(PP_Instance instance,
37 struct PP_Var name,
38 int32_t sample,
39 int32_t min,
40 int32_t max,
41 uint32_t bucket_count) {
42 VLOG(4) << "PPB_UMA_Private::HistogramCustomCounts()";
43 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance);
44 if (enter.failed())
45 return;
46 enter.functions()->HistogramCustomCounts(instance, name, sample, min, max,
47 bucket_count);
48 }
49
HistogramEnumeration(PP_Instance instance,struct PP_Var name,int32_t sample,int32_t boundary_value)50 void HistogramEnumeration(PP_Instance instance,
51 struct PP_Var name,
52 int32_t sample,
53 int32_t boundary_value) {
54 VLOG(4) << "PPB_UMA_Private::HistogramEnumeration()";
55 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance);
56 if (enter.failed())
57 return;
58 enter.functions()->HistogramEnumeration(instance, name, sample,
59 boundary_value);
60 }
61
IsCrashReportingEnabled(PP_Instance instance,struct PP_CompletionCallback callback)62 int32_t IsCrashReportingEnabled(PP_Instance instance,
63 struct PP_CompletionCallback callback) {
64 VLOG(4) << "PPB_UMA_Private::IsCrashReportingEnabled()";
65 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance, callback);
66 if (enter.failed())
67 return enter.retval();
68 return enter.SetResult(
69 enter.functions()->IsCrashReportingEnabled(instance, enter.callback()));
70 }
71
72 const PPB_UMA_Private_0_3 g_ppb_uma_private_thunk_0_3 = {
73 &HistogramCustomTimes, &HistogramCustomCounts, &HistogramEnumeration,
74 &IsCrashReportingEnabled};
75
76 } // namespace
77
GetPPB_UMA_Private_0_3_Thunk()78 PPAPI_THUNK_EXPORT const PPB_UMA_Private_0_3* GetPPB_UMA_Private_0_3_Thunk() {
79 return &g_ppb_uma_private_thunk_0_3;
80 }
81
82 } // namespace thunk
83 } // namespace ppapi
84