Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Side by Side Diff: ppapi/thunk/ppb_uma_private_thunk.cc

Issue 238923007: PPAPI: Format ppapi/thunk using clang-format. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // From private/ppb_uma_private.idl modified Thu Mar 13 11:54:51 2014. 5 // From private/ppb_uma_private.idl modified Mon Apr 7 08:56:43 2014.
6 6
7 #include "ppapi/c/pp_completion_callback.h" 7 #include "ppapi/c/pp_completion_callback.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/private/ppb_uma_private.h" 9 #include "ppapi/c/private/ppb_uma_private.h"
10 #include "ppapi/shared_impl/tracked_callback.h" 10 #include "ppapi/shared_impl/tracked_callback.h"
11 #include "ppapi/thunk/enter.h" 11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppapi_thunk_export.h" 12 #include "ppapi/thunk/ppapi_thunk_export.h"
13 #include "ppapi/thunk/ppb_uma_singleton_api.h" 13 #include "ppapi/thunk/ppb_uma_singleton_api.h"
14 14
15 namespace ppapi { 15 namespace ppapi {
16 namespace thunk { 16 namespace thunk {
17 17
18 namespace { 18 namespace {
19 19
20 void HistogramCustomTimes(PP_Instance instance, 20 void HistogramCustomTimes(PP_Instance instance,
21 struct PP_Var name, 21 struct PP_Var name,
22 int64_t sample, 22 int64_t sample,
23 int64_t min, 23 int64_t min,
24 int64_t max, 24 int64_t max,
25 uint32_t bucket_count) { 25 uint32_t bucket_count) {
26 VLOG(4) << "PPB_UMA_Private::HistogramCustomTimes()"; 26 VLOG(4) << "PPB_UMA_Private::HistogramCustomTimes()";
27 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance); 27 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance);
28 if (enter.failed()) 28 if (enter.failed())
29 return; 29 return;
30 enter.functions()->HistogramCustomTimes(instance, 30 enter.functions()->HistogramCustomTimes(
31 name, 31 instance, name, sample, min, max, bucket_count);
32 sample,
33 min,
34 max,
35 bucket_count);
36 } 32 }
37 33
38 void HistogramCustomCounts(PP_Instance instance, 34 void HistogramCustomCounts(PP_Instance instance,
39 struct PP_Var name, 35 struct PP_Var name,
40 int32_t sample, 36 int32_t sample,
41 int32_t min, 37 int32_t min,
42 int32_t max, 38 int32_t max,
43 uint32_t bucket_count) { 39 uint32_t bucket_count) {
44 VLOG(4) << "PPB_UMA_Private::HistogramCustomCounts()"; 40 VLOG(4) << "PPB_UMA_Private::HistogramCustomCounts()";
45 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance); 41 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance);
46 if (enter.failed()) 42 if (enter.failed())
47 return; 43 return;
48 enter.functions()->HistogramCustomCounts(instance, 44 enter.functions()->HistogramCustomCounts(
49 name, 45 instance, name, sample, min, max, bucket_count);
50 sample,
51 min,
52 max,
53 bucket_count);
54 } 46 }
55 47
56 void HistogramEnumeration(PP_Instance instance, 48 void HistogramEnumeration(PP_Instance instance,
57 struct PP_Var name, 49 struct PP_Var name,
58 int32_t sample, 50 int32_t sample,
59 int32_t boundary_value) { 51 int32_t boundary_value) {
60 VLOG(4) << "PPB_UMA_Private::HistogramEnumeration()"; 52 VLOG(4) << "PPB_UMA_Private::HistogramEnumeration()";
61 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance); 53 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance);
62 if (enter.failed()) 54 if (enter.failed())
63 return; 55 return;
64 enter.functions()->HistogramEnumeration(instance, 56 enter.functions()->HistogramEnumeration(
65 name, 57 instance, name, sample, boundary_value);
66 sample,
67 boundary_value);
68 } 58 }
69 59
70 int32_t IsCrashReportingEnabled(PP_Instance instance, 60 int32_t IsCrashReportingEnabled(PP_Instance instance,
71 struct PP_CompletionCallback callback) { 61 struct PP_CompletionCallback callback) {
72 VLOG(4) << "PPB_UMA_Private::IsCrashReportingEnabled()"; 62 VLOG(4) << "PPB_UMA_Private::IsCrashReportingEnabled()";
73 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance, callback); 63 EnterInstanceAPI<PPB_UMA_Singleton_API> enter(instance, callback);
74 if (enter.failed()) 64 if (enter.failed())
75 return enter.retval(); 65 return enter.retval();
76 return enter.SetResult(enter.functions()->IsCrashReportingEnabled( 66 return enter.SetResult(
77 instance, 67 enter.functions()->IsCrashReportingEnabled(instance, enter.callback()));
78 enter.callback()));
79 } 68 }
80 69
81 const PPB_UMA_Private_0_3 g_ppb_uma_private_thunk_0_3 = { 70 const PPB_UMA_Private_0_3 g_ppb_uma_private_thunk_0_3 = { //
82 &HistogramCustomTimes, 71 &HistogramCustomTimes, //
83 &HistogramCustomCounts, 72 &HistogramCustomCounts, //
84 &HistogramEnumeration, 73 &HistogramEnumeration, //
85 &IsCrashReportingEnabled 74 &IsCrashReportingEnabled //
86 }; 75 };
87 76
88 } // namespace 77 } // namespace
89 78
90 PPAPI_THUNK_EXPORT const PPB_UMA_Private_0_3* GetPPB_UMA_Private_0_3_Thunk() { 79 PPAPI_THUNK_EXPORT const PPB_UMA_Private_0_3* GetPPB_UMA_Private_0_3_Thunk() {
91 return &g_ppb_uma_private_thunk_0_3; 80 return &g_ppb_uma_private_thunk_0_3;
92 } 81 }
93 82
94 } // namespace thunk 83 } // namespace thunk
95 } // namespace ppapi 84 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698