Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / ppapi / thunk / ppb_uma_private_thunk.cc
blob3003092cbd4e09c51dd7998a65d9efdae2d2f945
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 // From private/ppb_uma_private.idl modified Mon Apr 7 08:56:43 2014.
7 #include "ppapi/c/pp_completion_callback.h"
8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/private/ppb_uma_private.h"
10 #include "ppapi/shared_impl/tracked_callback.h"
11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppapi_thunk_export.h"
13 #include "ppapi/thunk/ppb_uma_singleton_api.h"
15 namespace ppapi {
16 namespace thunk {
18 namespace {
20 void HistogramCustomTimes(PP_Instance instance,
21 struct PP_Var name,
22 int64_t sample,
23 int64_t min,
24 int64_t max,
25 uint32_t bucket_count) {
26 VLOG(4) << "PPB_UMA_Private::HistogramCustomTimes()";
27 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance);
28 if (enter.failed())
29 return;
30 enter.functions()->HistogramCustomTimes(instance, name, sample, min, max,
31 bucket_count);
34 void HistogramCustomCounts(PP_Instance instance,
35 struct PP_Var name,
36 int32_t sample,
37 int32_t min,
38 int32_t max,
39 uint32_t bucket_count) {
40 VLOG(4) << "PPB_UMA_Private::HistogramCustomCounts()";
41 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance);
42 if (enter.failed())
43 return;
44 enter.functions()->HistogramCustomCounts(instance, name, sample, min, max,
45 bucket_count);
48 void HistogramEnumeration(PP_Instance instance,
49 struct PP_Var name,
50 int32_t sample,
51 int32_t boundary_value) {
52 VLOG(4) << "PPB_UMA_Private::HistogramEnumeration()";
53 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance);
54 if (enter.failed())
55 return;
56 enter.functions()->HistogramEnumeration(instance, name, sample,
57 boundary_value);
60 int32_t IsCrashReportingEnabled(PP_Instance instance,
61 struct PP_CompletionCallback callback) {
62 VLOG(4) << "PPB_UMA_Private::IsCrashReportingEnabled()";
63 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance, callback);
64 if (enter.failed())
65 return enter.retval();
66 return enter.SetResult(
67 enter.functions()->IsCrashReportingEnabled(instance, enter.callback()));
70 const PPB_UMA_Private_0_3 g_ppb_uma_private_thunk_0_3 = {
71 &HistogramCustomTimes,
72 &HistogramCustomCounts,
73 &HistogramEnumeration,
74 &IsCrashReportingEnabled};
76 } // namespace
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;
82 } // namespace thunk
83 } // namespace ppapi