summaryrefslogtreecommitdiffstats
path: root/ppapi/c/trusted
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-05 15:41:52 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-05 15:41:52 +0000
commit25651387cceb1a50869c8c2d1f93d4227e5a6352 (patch)
tree86d3ecef68f8548cde47a978ecafa1de0ae4e039 /ppapi/c/trusted
parent4b649887e1241a43c0d2a1cd81a8867d1be46b49 (diff)
downloadchromium_src-25651387cceb1a50869c8c2d1f93d4227e5a6352.zip
chromium_src-25651387cceb1a50869c8c2d1f93d4227e5a6352.tar.gz
chromium_src-25651387cceb1a50869c8c2d1f93d4227e5a6352.tar.bz2
Update PPAPI IDL generator to define versioned structs, and unversioned typedef.
For interface Foo with versions A and B, structs will be defined for Foo_A and Foo_B, and a typedef generated from Foo_B to Foo. Versioning of IDL structs remains unchanged. (Follow-up to discussion on CL 8931019) *** This change breaks compatibility with C code that makes use of unversioned-named interface structs. :( *** We need to define a versioned-named struct for each interface's current version. We could: 1. Carry on defining the current struct unversioned and typedef a versioned name for it. The versioned type for the interface would be a typedef for the latest version and a struct for later versions, causing calling C code that uses it to break when a new version is added. 2. Define structs for all versions, and a separate unversioned struct. This would lose type equivalence between the versioned and unversioned copies of the latest interface specification, and lead to needless duplication, especially for one-version interfaces. 3. Do this CL. We break some C code once, by change the unversioned type from struct to typedef, but we avoid these headaches in future. C++ code shouldn't be affected. *** Contents of this CL, including notes on to-dos: This change requires updating thunk-getters to be defined using versioned names, so that the interface structs can be forward declared; the thunk-getters now have versioned names and return values. Changing the thunk-getter naming requires updating unit-tests to call the versioned names. It also requires some interface headers not generated from IDL to be manually updated to the new scheme (PPB_CharSet_Dev, PPB_Crypto_Dev, PPB_DirectoryReader_Dev, PPB_LayerCompositor_Dev, PPB_Graphics3D, PPB_Flash_Menu, PPB_Instance_Private, PPP_Pdf, PPB_Flash_NetConnector, PPB_GLESChromiumTextureMapping_Dev and PPB_Graphics3D_Trusted). The proxy GetInfo() calls are updated to use versioned interface macros and thunks. Similarly, most PPBs added in interface_list.cc are now added using versioned interface macros and thunk getters. Ditto PluginModule, and some of PluginInstance. Some implementations (e.g. PPB_CharSet_Dev) needed updating to use versioned thunk getters to fetch interfaces to use. The VideoDecoder interface size checks are for 32-bit are updated not to expect structs. It was necessary to replace forward declarations of interface structs with includes, and remove "struct" prefixes where unversioned names were used. In most cases the affected code should really be updated to cope with versions. PPP_Pdf has become PPP_Pdf_1. Other versionless structs that should be updated for consistenct include PPB_UMA_Private, PPB_GPU_Blacklist_Private, PPB_Proxy_Private, PPP_PDF, PPB_OpenGLES2, PPB_Flash_File_FileRef and PPB_Flash_File_ModuleLocal. Also PPP_Class_Deprecated, PPP_CursorControl_Dev, PPP_Find_Dev, PPP_NetworkState_Dev, PPP_Scrollbar_Dev, PPP_Selection_Dev, PPP_VideoCapture_Dev, PPP_Graphics3D and PPP_Instance_Private. The Graphics2D and GLES2 examples now use unversioned interface type names without "struct" prefix. It's not clear whether examples should use versioned names, to show best practice, or unversioned. The typedef hack in PPP_Instance IDL is gone. Yay. BUG=107398,108379 TEST=All Pepper and NaCl tests should continue to pass on Chromium bots. NaCl SDK examples build correctly. Review URL: http://codereview.chromium.org/8989006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116490 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c/trusted')
-rw-r--r--ppapi/c/trusted/ppb_audio_input_trusted_dev.h6
-rw-r--r--ppapi/c/trusted/ppb_audio_trusted.h8
-rw-r--r--ppapi/c/trusted/ppb_broker_trusted.h8
-rw-r--r--ppapi/c/trusted/ppb_buffer_trusted.h8
-rw-r--r--ppapi/c/trusted/ppb_file_chooser_trusted.h6
-rw-r--r--ppapi/c/trusted/ppb_file_io_trusted.h8
-rw-r--r--ppapi/c/trusted/ppb_graphics_3d_trusted.h7
-rw-r--r--ppapi/c/trusted/ppb_image_data_trusted.h8
-rw-r--r--ppapi/c/trusted/ppb_url_loader_trusted.h8
9 files changed, 42 insertions, 25 deletions
diff --git a/ppapi/c/trusted/ppb_audio_input_trusted_dev.h b/ppapi/c/trusted/ppb_audio_input_trusted_dev.h
index 9b26938..3d558ea 100644
--- a/ppapi/c/trusted/ppb_audio_input_trusted_dev.h
+++ b/ppapi/c/trusted/ppb_audio_input_trusted_dev.h
@@ -4,7 +4,7 @@
*/
/* From trusted/ppb_audio_input_trusted_dev.idl,
- * modified Wed Jan 4 09:11:42 2012.
+ * modified Wed Jan 4 11:09:00 2012.
*/
#ifndef PPAPI_C_TRUSTED_PPB_AUDIO_INPUT_TRUSTED_DEV_H_
@@ -37,7 +37,7 @@
* resource; most of the PPB_AudioInput interface is also usable on this
* resource.
*/
-struct PPB_AudioInputTrusted_Dev {
+struct PPB_AudioInputTrusted_Dev_0_1 {
/** Returns an audio input resource. */
PP_Resource (*CreateTrusted)(PP_Instance instance);
/**
@@ -62,6 +62,8 @@ struct PPB_AudioInputTrusted_Dev {
int* shm_handle,
uint32_t* shm_size);
};
+
+typedef struct PPB_AudioInputTrusted_Dev_0_1 PPB_AudioInputTrusted_Dev;
/**
* @}
*/
diff --git a/ppapi/c/trusted/ppb_audio_trusted.h b/ppapi/c/trusted/ppb_audio_trusted.h
index 152a850..72416df 100644
--- a/ppapi/c/trusted/ppb_audio_trusted.h
+++ b/ppapi/c/trusted/ppb_audio_trusted.h
@@ -1,9 +1,9 @@
-/* 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 trusted/ppb_audio_trusted.idl modified Sat Jul 16 16:51:03 2011. */
+/* From trusted/ppb_audio_trusted.idl modified Wed Oct 5 14:06:02 2011. */
#ifndef PPAPI_C_TRUSTED_PPB_AUDIO_TRUSTED_H_
#define PPAPI_C_TRUSTED_PPB_AUDIO_TRUSTED_H_
@@ -33,7 +33,7 @@
* resource returned is an Audio resource; most of the PPB_Audio
* interface is also usable on this resource.
*/
-struct PPB_AudioTrusted {
+struct PPB_AudioTrusted_0_6 {
/** Returns an audio resource. */
PP_Resource (*CreateTrusted)(PP_Instance instance);
/**
@@ -59,6 +59,8 @@ struct PPB_AudioTrusted {
int* shm_handle,
uint32_t* shm_size);
};
+
+typedef struct PPB_AudioTrusted_0_6 PPB_AudioTrusted;
/**
* @}
*/
diff --git a/ppapi/c/trusted/ppb_broker_trusted.h b/ppapi/c/trusted/ppb_broker_trusted.h
index 9acd9cd..44b6118 100644
--- a/ppapi/c/trusted/ppb_broker_trusted.h
+++ b/ppapi/c/trusted/ppb_broker_trusted.h
@@ -1,9 +1,9 @@
-/* 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 trusted/ppb_broker_trusted.idl modified Sat Jul 16 16:51:03 2011. */
+/* From trusted/ppb_broker_trusted.idl modified Wed Oct 5 14:06:02 2011. */
#ifndef PPAPI_C_TRUSTED_PPB_BROKER_TRUSTED_H_
#define PPAPI_C_TRUSTED_PPB_BROKER_TRUSTED_H_
@@ -40,7 +40,7 @@
* handle is closed. The handle should be closed before the resource is
* released.
*/
-struct PPB_BrokerTrusted {
+struct PPB_BrokerTrusted_0_2 {
/**
* Returns a trusted broker resource.
*/
@@ -75,6 +75,8 @@ struct PPB_BrokerTrusted {
*/
int32_t (*GetHandle)(PP_Resource broker, int32_t* handle);
};
+
+typedef struct PPB_BrokerTrusted_0_2 PPB_BrokerTrusted;
/**
* @}
*/
diff --git a/ppapi/c/trusted/ppb_buffer_trusted.h b/ppapi/c/trusted/ppb_buffer_trusted.h
index b81f8d6..b24f340 100644
--- a/ppapi/c/trusted/ppb_buffer_trusted.h
+++ b/ppapi/c/trusted/ppb_buffer_trusted.h
@@ -1,9 +1,9 @@
-/* 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 trusted/ppb_buffer_trusted.idl modified Fri Jul 15 13:34:45 2011. */
+/* From trusted/ppb_buffer_trusted.idl modified Wed Oct 5 14:06:02 2011. */
#ifndef PPAPI_C_TRUSTED_PPB_BUFFER_TRUSTED_H_
#define PPAPI_C_TRUSTED_PPB_BUFFER_TRUSTED_H_
@@ -25,7 +25,7 @@
* @addtogroup Interfaces
* @{
*/
-struct PPB_BufferTrusted {
+struct PPB_BufferTrusted_0_1 {
/**
* Returns the internal shared memory pointer associated with the given
* Buffer resource. Used for proxying. Returns PP_OK on success, or
@@ -35,6 +35,8 @@ struct PPB_BufferTrusted {
*/
int32_t (*GetSharedMemory)(PP_Resource buffer, int* handle);
};
+
+typedef struct PPB_BufferTrusted_0_1 PPB_BufferTrusted;
/**
* @}
*/
diff --git a/ppapi/c/trusted/ppb_file_chooser_trusted.h b/ppapi/c/trusted/ppb_file_chooser_trusted.h
index 8c3c933..85187a7 100644
--- a/ppapi/c/trusted/ppb_file_chooser_trusted.h
+++ b/ppapi/c/trusted/ppb_file_chooser_trusted.h
@@ -4,7 +4,7 @@
*/
/* From trusted/ppb_file_chooser_trusted.idl,
- * modified Wed Jan 4 09:12:36 2012.
+ * modified Wed Jan 4 11:09:00 2012.
*/
#ifndef PPAPI_C_TRUSTED_PPB_FILE_CHOOSER_TRUSTED_H_
@@ -30,7 +30,7 @@
* @addtogroup Interfaces
* @{
*/
-struct PPB_FileChooserTrusted {
+struct PPB_FileChooserTrusted_0_5 {
/**
* This function displays a previously created file chooser resource as a
* dialog box, prompting the user to choose a file or files to open, or a
@@ -54,6 +54,8 @@ struct PPB_FileChooserTrusted {
struct PP_Var suggested_file_name,
struct PP_CompletionCallback callback);
};
+
+typedef struct PPB_FileChooserTrusted_0_5 PPB_FileChooserTrusted;
/**
* @}
*/
diff --git a/ppapi/c/trusted/ppb_file_io_trusted.h b/ppapi/c/trusted/ppb_file_io_trusted.h
index 877c157..53953fbd 100644
--- a/ppapi/c/trusted/ppb_file_io_trusted.h
+++ b/ppapi/c/trusted/ppb_file_io_trusted.h
@@ -1,9 +1,9 @@
-/* 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 trusted/ppb_file_io_trusted.idl modified Mon Jul 18 10:45:10 2011. */
+/* From trusted/ppb_file_io_trusted.idl modified Wed Oct 5 14:06:02 2011. */
#ifndef PPAPI_C_TRUSTED_PPB_FILE_IO_TRUSTED_H_
#define PPAPI_C_TRUSTED_PPB_FILE_IO_TRUSTED_H_
@@ -28,7 +28,7 @@
* @{
*/
/* Available only to trusted implementations. */
-struct PPB_FileIOTrusted {
+struct PPB_FileIOTrusted_0_4 {
/**
* Returns a file descriptor corresponding to the given FileIO object. On
* Windows, returns a HANDLE; on all other platforms, returns a POSIX file
@@ -61,6 +61,8 @@ struct PPB_FileIOTrusted {
int64_t length,
struct PP_CompletionCallback callback);
};
+
+typedef struct PPB_FileIOTrusted_0_4 PPB_FileIOTrusted;
/**
* @}
*/
diff --git a/ppapi/c/trusted/ppb_graphics_3d_trusted.h b/ppapi/c/trusted/ppb_graphics_3d_trusted.h
index 353b6dd..099ffdc 100644
--- a/ppapi/c/trusted/ppb_graphics_3d_trusted.h
+++ b/ppapi/c/trusted/ppb_graphics_3d_trusted.h
@@ -1,4 +1,4 @@
-// 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.
@@ -51,7 +51,7 @@ struct PP_Graphics3DTrustedState {
uint32_t generation;
};
-struct PPB_Graphics3DTrusted {
+struct PPB_Graphics3DTrusted_1_0 {
// Creates a raw Graphics3D resource. A raw Graphics3D is intended to be used
// with the trusted interface, through the command buffer (for proxying).
PP_Resource (*CreateRaw)(PP_Instance instance_id,
@@ -99,5 +99,6 @@ struct PPB_Graphics3DTrusted {
int32_t last_known_get);
};
-#endif // PPAPI_C_TRUSTED_PPB_GRAPHICS_3D_TRUSTED_H_
+typedef struct PPB_Graphics3DTrusted_1_0 PPB_Graphics3DTrusted;
+#endif // PPAPI_C_TRUSTED_PPB_GRAPHICS_3D_TRUSTED_H_
diff --git a/ppapi/c/trusted/ppb_image_data_trusted.h b/ppapi/c/trusted/ppb_image_data_trusted.h
index 824fb9e..c6b266c 100644
--- a/ppapi/c/trusted/ppb_image_data_trusted.h
+++ b/ppapi/c/trusted/ppb_image_data_trusted.h
@@ -1,9 +1,9 @@
-/* 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 trusted/ppb_image_data_trusted.idl modified Sat Jul 16 16:51:03 2011. */
+/* From trusted/ppb_image_data_trusted.idl modified Wed Oct 5 14:06:02 2011. */
#ifndef PPAPI_C_TRUSTED_PPB_IMAGE_DATA_TRUSTED_H_
#define PPAPI_C_TRUSTED_PPB_IMAGE_DATA_TRUSTED_H_
@@ -26,7 +26,7 @@
* @{
*/
/** Trusted interface */
-struct PPB_ImageDataTrusted {
+struct PPB_ImageDataTrusted_0_4 {
/**
* Returns the internal shared memory pointer associated with the given
* ImageData resource. Used for proxying. Returns PP_OK on success, or
@@ -38,6 +38,8 @@ struct PPB_ImageDataTrusted {
int* handle,
uint32_t* byte_count);
};
+
+typedef struct PPB_ImageDataTrusted_0_4 PPB_ImageDataTrusted;
/**
* @}
*/
diff --git a/ppapi/c/trusted/ppb_url_loader_trusted.h b/ppapi/c/trusted/ppb_url_loader_trusted.h
index 8d1a248..71b21b36 100644
--- a/ppapi/c/trusted/ppb_url_loader_trusted.h
+++ b/ppapi/c/trusted/ppb_url_loader_trusted.h
@@ -1,9 +1,9 @@
-/* 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 trusted/ppb_url_loader_trusted.idl modified Sat Jul 16 16:51:03 2011. */
+/* From trusted/ppb_url_loader_trusted.idl modified Wed Oct 5 14:06:02 2011. */
#ifndef PPAPI_C_TRUSTED_PPB_URL_LOADER_TRUSTED_H_
#define PPAPI_C_TRUSTED_PPB_URL_LOADER_TRUSTED_H_
@@ -45,7 +45,7 @@ typedef void (*PP_URLLoaderTrusted_StatusCallback)(
* @{
*/
/* Available only to trusted implementations. */
-struct PPB_URLLoaderTrusted {
+struct PPB_URLLoaderTrusted_0_3 {
/**
* Grant this URLLoader the capability to make unrestricted cross-origin
* requests.
@@ -67,6 +67,8 @@ struct PPB_URLLoaderTrusted {
void (*RegisterStatusCallback)(PP_Resource loader,
PP_URLLoaderTrusted_StatusCallback cb);
};
+
+typedef struct PPB_URLLoaderTrusted_0_3 PPB_URLLoaderTrusted;
/**
* @}
*/