summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-05 23:00:29 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-05 23:00:29 +0000
commitff6a4b888423eca37687252eba7e59cbc938cd43 (patch)
treebea06b227b6f7b77abcdc2e4acba822c0c94b849 /ppapi
parent05252bb29a82e3e3c35c84de176456a83cccfa56 (diff)
downloadchromium_src-ff6a4b888423eca37687252eba7e59cbc938cd43.zip
chromium_src-ff6a4b888423eca37687252eba7e59cbc938cd43.tar.gz
chromium_src-ff6a4b888423eca37687252eba7e59cbc938cd43.tar.bz2
Convert UMA interface to IDL.
This renames the interface strings to be consistent. Since this is only used by the PDF plugin which is built alongside Chrome, this should be OK. BUG= Review URL: https://codereview.chromium.org/11048006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160506 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/api/private/ppb_uma_private.idl48
-rw-r--r--ppapi/c/private/ppb_uma_private.h39
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c39
-rw-r--r--ppapi/tests/test_uma.cc1
-rw-r--r--ppapi/tests/test_uma.h3
5 files changed, 119 insertions, 11 deletions
diff --git a/ppapi/api/private/ppb_uma_private.idl b/ppapi/api/private/ppb_uma_private.idl
new file mode 100644
index 0000000..cdb3908
--- /dev/null
+++ b/ppapi/api/private/ppb_uma_private.idl
@@ -0,0 +1,48 @@
+/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/**
+ * This file defines the <code>PPB_UMA_Private</code> interface.
+ */
+label Chrome {
+ M18 = 0.1
+};
+
+/**
+ * Contains functions for plugins to report UMA usage stats.
+ */
+interface PPB_UMA_Private {
+ /**
+ * HistogramCustomTimes is a pointer to a function which records a time
+ * sample given in milliseconds in the histogram given by |name|, possibly
+ * creating the histogram if it does not exist.
+ */
+ void HistogramCustomTimes([in] PP_Var name,
+ [in] int64_t sample,
+ [in] int64_t min,
+ [in] int64_t max,
+ [in] uint32_t bucket_count);
+
+ /**
+ * HistogramCustomCounts is a pointer to a function which records a sample
+ * in the histogram given by |name|, possibly creating the histogram if it
+ * does not exist.
+ */
+ void HistogramCustomCounts([in] PP_Var name,
+ [in] int32_t sample,
+ [in] int32_t min,
+ [in] int32_t max,
+ [in] uint32_t bucket_count);
+
+ /**
+ * HistogramEnumeration is a pointer to a function which records a sample
+ * in the histogram given by |name|, possibly creating the histogram if it
+ * does not exist. The sample represents a value in an enumeration bounded
+ * by |boundary_value|, that is, sample < boundary_value always.
+ */
+ void HistogramEnumeration([in] PP_Var name,
+ [in] int32_t sample,
+ [in] int32_t boundary_value);
+};
diff --git a/ppapi/c/private/ppb_uma_private.h b/ppapi/c/private/ppb_uma_private.h
index 0b1c5bf..b681add 100644
--- a/ppapi/c/private/ppb_uma_private.h
+++ b/ppapi/c/private/ppb_uma_private.h
@@ -1,16 +1,35 @@
-/* Copyright (c) 2011 The Chromium Authors. All rights reserved.
+/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
+/* From private/ppb_uma_private.idl modified Tue Oct 2 13:17:06 2012. */
+
#ifndef PPAPI_C_PRIVATE_PPB_UMA_PRIVATE_H_
#define PPAPI_C_PRIVATE_PPB_UMA_PRIVATE_H_
+#include "ppapi/c/pp_bool.h"
+#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/pp_var.h"
-#define PPB_UMA_PRIVATE_INTERFACE "PPB_UMA(Private);0.1"
+#define PPB_UMA_PRIVATE_INTERFACE_0_1 "PPB_UMA_Private;0.1"
+#define PPB_UMA_PRIVATE_INTERFACE PPB_UMA_PRIVATE_INTERFACE_0_1
+
+/**
+ * @file
+ * This file defines the <code>PPB_UMA_Private</code> interface.
+ */
+
-struct PPB_UMA_Private {
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
+/**
+ * Contains functions for plugins to report UMA usage stats.
+ */
+struct PPB_UMA_Private_0_1 {
/**
* HistogramCustomTimes is a pointer to a function which records a time
* sample given in milliseconds in the histogram given by |name|, possibly
@@ -18,9 +37,9 @@ struct PPB_UMA_Private {
*/
void (*HistogramCustomTimes)(struct PP_Var name,
int64_t sample,
- int64_t min, int64_t max,
+ int64_t min,
+ int64_t max,
uint32_t bucket_count);
-
/**
* HistogramCustomCounts is a pointer to a function which records a sample
* in the histogram given by |name|, possibly creating the histogram if it
@@ -28,9 +47,9 @@ struct PPB_UMA_Private {
*/
void (*HistogramCustomCounts)(struct PP_Var name,
int32_t sample,
- int32_t min, int32_t max,
+ int32_t min,
+ int32_t max,
uint32_t bucket_count);
-
/**
* HistogramEnumeration is a pointer to a function which records a sample
* in the histogram given by |name|, possibly creating the histogram if it
@@ -42,4 +61,10 @@ struct PPB_UMA_Private {
int32_t boundary_value);
};
+typedef struct PPB_UMA_Private_0_1 PPB_UMA_Private;
+/**
+ * @}
+ */
+
#endif /* PPAPI_C_PRIVATE_PPB_UMA_PRIVATE_H_ */
+
diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
index 2bd5916..f48f42d 100644
--- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
+++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* Last generated from IDL: Thu Oct 4 11:25:54 2012. */
+/* Last generated from IDL: Thu Oct 4 12:24:28 2012. */
#include "ppapi/generators/pnacl_shim.h"
#include "ppapi/c/ppb.h"
@@ -83,6 +83,7 @@
#include "ppapi/c/private/ppb_tcp_server_socket_private.h"
#include "ppapi/c/private/ppb_tcp_socket_private.h"
#include "ppapi/c/private/ppb_udp_socket_private.h"
+#include "ppapi/c/private/ppb_uma_private.h"
#include "ppapi/c/private/ppb_x509_certificate_private.h"
#include "ppapi/c/private/ppp_content_decryptor_private.h"
#include "ppapi/c/private/ppp_flash_browser_operations.h"
@@ -230,6 +231,7 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TCPSocket_Private_0_4;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_2;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_3;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_4;
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UMA_Private_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_X509Certificate_Private_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_2;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Flash_BrowserOperations_1_0;
@@ -3276,6 +3278,28 @@ void Pnacl_M23_PPB_UDPSocket_Private_Close(PP_Resource udp_socket) {
/* End wrapper methods for PPB_UDPSocket_Private_0_4 */
+/* Begin wrapper methods for PPB_UMA_Private_0_1 */
+
+static __attribute__((pnaclcall))
+void Pnacl_M18_PPB_UMA_Private_HistogramCustomTimes(struct PP_Var name, int64_t sample, int64_t min, int64_t max, uint32_t bucket_count) {
+ const struct PPB_UMA_Private_0_1 *iface = Pnacl_WrapperInfo_PPB_UMA_Private_0_1.real_iface;
+ iface->HistogramCustomTimes(name, sample, min, max, bucket_count);
+}
+
+static __attribute__((pnaclcall))
+void Pnacl_M18_PPB_UMA_Private_HistogramCustomCounts(struct PP_Var name, int32_t sample, int32_t min, int32_t max, uint32_t bucket_count) {
+ const struct PPB_UMA_Private_0_1 *iface = Pnacl_WrapperInfo_PPB_UMA_Private_0_1.real_iface;
+ iface->HistogramCustomCounts(name, sample, min, max, bucket_count);
+}
+
+static __attribute__((pnaclcall))
+void Pnacl_M18_PPB_UMA_Private_HistogramEnumeration(struct PP_Var name, int32_t sample, int32_t boundary_value) {
+ const struct PPB_UMA_Private_0_1 *iface = Pnacl_WrapperInfo_PPB_UMA_Private_0_1.real_iface;
+ iface->HistogramEnumeration(name, sample, boundary_value);
+}
+
+/* End wrapper methods for PPB_UMA_Private_0_1 */
+
/* Begin wrapper methods for PPB_X509Certificate_Private_0_1 */
static __attribute__((pnaclcall))
@@ -4107,6 +4131,12 @@ struct PPB_UDPSocket_Private_0_4 Pnacl_Wrappers_PPB_UDPSocket_Private_0_4 = {
.Close = (void (*)(PP_Resource udp_socket))&Pnacl_M23_PPB_UDPSocket_Private_Close
};
+struct PPB_UMA_Private_0_1 Pnacl_Wrappers_PPB_UMA_Private_0_1 = {
+ .HistogramCustomTimes = (void (*)(struct PP_Var name, int64_t sample, int64_t min, int64_t max, uint32_t bucket_count))&Pnacl_M18_PPB_UMA_Private_HistogramCustomTimes,
+ .HistogramCustomCounts = (void (*)(struct PP_Var name, int32_t sample, int32_t min, int32_t max, uint32_t bucket_count))&Pnacl_M18_PPB_UMA_Private_HistogramCustomCounts,
+ .HistogramEnumeration = (void (*)(struct PP_Var name, int32_t sample, int32_t boundary_value))&Pnacl_M18_PPB_UMA_Private_HistogramEnumeration
+};
+
struct PPB_X509Certificate_Private_0_1 Pnacl_Wrappers_PPB_X509Certificate_Private_0_1 = {
.Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M19_PPB_X509Certificate_Private_Create,
.IsX509CertificatePrivate = (PP_Bool (*)(PP_Resource resource))&Pnacl_M19_PPB_X509Certificate_Private_IsX509CertificatePrivate,
@@ -4852,6 +4882,12 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_4 = {
.real_iface = NULL
};
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UMA_Private_0_1 = {
+ .iface_macro = PPB_UMA_PRIVATE_INTERFACE_0_1,
+ .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_UMA_Private_0_1,
+ .real_iface = NULL
+};
+
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_X509Certificate_Private_0_1 = {
.iface_macro = PPB_X509CERTIFICATE_PRIVATE_INTERFACE_0_1,
.wrapped_iface = (void *) &Pnacl_Wrappers_PPB_X509Certificate_Private_0_1,
@@ -4995,6 +5031,7 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = {
&Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_2,
&Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_3,
&Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_4,
+ &Pnacl_WrapperInfo_PPB_UMA_Private_0_1,
&Pnacl_WrapperInfo_PPB_X509Certificate_Private_0_1,
NULL
};
diff --git a/ppapi/tests/test_uma.cc b/ppapi/tests/test_uma.cc
index 46efcbe..8892bea 100644
--- a/ppapi/tests/test_uma.cc
+++ b/ppapi/tests/test_uma.cc
@@ -4,7 +4,6 @@
#include "ppapi/tests/test_uma.h"
-#include "ppapi/c/private/ppb_uma_private.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/module.h"
#include "ppapi/tests/testing_instance.h"
diff --git a/ppapi/tests/test_uma.h b/ppapi/tests/test_uma.h
index d44648f..81fe9909 100644
--- a/ppapi/tests/test_uma.h
+++ b/ppapi/tests/test_uma.h
@@ -7,10 +7,9 @@
#include <string>
+#include "ppapi/c/private/ppb_uma_private.h"
#include "ppapi/tests/test_case.h"
-struct PPB_UMA_Private;
-
class TestUMA : public TestCase {
public:
explicit TestUMA(TestingInstance* instance) : TestCase(instance) {}