diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 05:33:20 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 05:33:20 +0000 |
commit | 7ca87c2179917c73feae2f6183d2536dd6690623 (patch) | |
tree | e4bf36cdd3bb3045f82d1d921f760d70b7dc73d5 /ppapi/c | |
parent | 187c54919b3af4cd6dec23d9ea3c1547417fe7be (diff) | |
download | chromium_src-7ca87c2179917c73feae2f6183d2536dd6690623.zip chromium_src-7ca87c2179917c73feae2f6183d2536dd6690623.tar.gz chromium_src-7ca87c2179917c73feae2f6183d2536dd6690623.tar.bz2 |
Add an instance parameter to var objects, audio, and the 2D API. This replaces the module in most cases.
This will be used in the proxy to multiplex one plugin across multiple renderer processes. We need the instance in the proxy to know which process to send it to.
I added a deprecated var object creation function for native client, which
depends on the module and this is very difficult to change. Because it doesn't
have the multiplexing requirements, this is fine for now.
TEST=ppapi ui tests
BUG=none
Review URL: http://codereview.chromium.org/6085009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70721 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c')
-rw-r--r-- | ppapi/c/dev/ppb_audio_config_dev.h | 6 | ||||
-rw-r--r-- | ppapi/c/dev/ppb_var_deprecated.h | 12 | ||||
-rw-r--r-- | ppapi/c/ppb_graphics_2d.h | 11 | ||||
-rw-r--r-- | ppapi/c/ppb_image_data.h | 7 |
4 files changed, 22 insertions, 14 deletions
diff --git a/ppapi/c/dev/ppb_audio_config_dev.h b/ppapi/c/dev/ppb_audio_config_dev.h index cf0df7b..0a1be2a 100644 --- a/ppapi/c/dev/ppb_audio_config_dev.h +++ b/ppapi/c/dev/ppb_audio_config_dev.h @@ -6,12 +6,12 @@ #define PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_ #include "ppapi/c/pp_bool.h" +#include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_macros.h" -#include "ppapi/c/pp_module.h" #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_stdint.h" -#define PPB_AUDIO_CONFIG_DEV_INTERFACE "PPB_AudioConfig(Dev);0.3" +#define PPB_AUDIO_CONFIG_DEV_INTERFACE "PPB_AudioConfig(Dev);0.4" enum { PP_AUDIOMINSAMPLEFRAMECOUNT = 64, @@ -52,7 +52,7 @@ struct PPB_AudioConfig_Dev { * buffer16[2 * (sample_frame_count - 1) + 1] is the last right channel sample * Data will always be in the native endian format of the platform. */ - PP_Resource (*CreateStereo16Bit)(PP_Module module, + PP_Resource (*CreateStereo16Bit)(PP_Instance instance, PP_AudioSampleRate_Dev sample_rate, uint32_t sample_frame_count); diff --git a/ppapi/c/dev/ppb_var_deprecated.h b/ppapi/c/dev/ppb_var_deprecated.h index dd3f8bc..7b5af31 100644 --- a/ppapi/c/dev/ppb_var_deprecated.h +++ b/ppapi/c/dev/ppb_var_deprecated.h @@ -6,13 +6,14 @@ #define PPAPI_C_PPB_VAR_DEPRECATED_H_ #include "ppapi/c/dev/deprecated_bool.h" +#include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_module.h" #include "ppapi/c/pp_stdint.h" #include "ppapi/c/pp_var.h" struct PPP_Class_Deprecated; -#define PPB_VAR_DEPRECATED_INTERFACE "PPB_Var(Deprecated);0.2" +#define PPB_VAR_DEPRECATED_INTERFACE "PPB_Var(Deprecated);0.3" /** * @file @@ -231,9 +232,16 @@ struct PPB_Var_Deprecated { * return CreateObject(&point_class, new Point(x, y)); * }</pre> */ - struct PP_Var (*CreateObject)(PP_Module module, + struct PP_Var (*CreateObject)(PP_Instance instance, const struct PPP_Class_Deprecated* object_class, void* object_data); + + // Like CreateObject but takes a module. This will be deleted when all callers + // can be changed to use the PP_Instance CreateObject one. + struct PP_Var (*CreateObjectWithModuleDeprecated)( + PP_Module module, + const struct PPP_Class_Deprecated* object_class, + void* object_data); }; /** diff --git a/ppapi/c/ppb_graphics_2d.h b/ppapi/c/ppb_graphics_2d.h index 6daa16f..8a166a7 100644 --- a/ppapi/c/ppb_graphics_2d.h +++ b/ppapi/c/ppb_graphics_2d.h @@ -6,6 +6,7 @@ #define PPAPI_C_PPB_GRAPHICS_2D_H_ #include "ppapi/c/pp_bool.h" +#include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_module.h" #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_stdint.h" @@ -15,7 +16,7 @@ struct PP_Point; struct PP_Rect; struct PP_Size; -#define PPB_GRAPHICS_2D_INTERFACE "PPB_Graphics2D;0.2" +#define PPB_GRAPHICS_2D_INTERFACE "PPB_Graphics2D;0.3" /** * @file @@ -28,10 +29,8 @@ struct PP_Size; /** {PENDING: describe PPB_Graphics2D. */ struct PPB_Graphics2D { /** - * The returned graphics context will not be bound to any plugin instance on - * creation (call BindGraphics on the plugin instance to do that. The - * graphics context has a lifetime that can exceed that of the given plugin - * instance. + * The returned graphics context will not be bound to the plugin instance on + * creation (call BindGraphics on the plugin instance to do that). * * Set the is_always_opaque flag if you know that you will be painting only * opaque data to this context. This will disable blending when compositing @@ -45,7 +44,7 @@ struct PPB_Graphics2D { * * If you aren't sure, it is always correct to specify that it it not opaque. */ - PP_Resource (*Create)(PP_Module module, + PP_Resource (*Create)(PP_Instance instance, const struct PP_Size* size, PP_Bool is_always_opaque); diff --git a/ppapi/c/ppb_image_data.h b/ppapi/c/ppb_image_data.h index e1fe5d0..27fbbc0 100644 --- a/ppapi/c/ppb_image_data.h +++ b/ppapi/c/ppb_image_data.h @@ -6,6 +6,7 @@ #define PPAPI_C_PPB_IMAGE_DATA_H_ #include "ppapi/c/pp_bool.h" +#include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_macros.h" #include "ppapi/c/pp_module.h" #include "ppapi/c/pp_resource.h" @@ -31,7 +32,7 @@ struct PP_ImageDataDesc { }; PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_ImageDataDesc, 16); -#define PPB_IMAGEDATA_INTERFACE "PPB_ImageData;0.2" +#define PPB_IMAGEDATA_INTERFACE "PPB_ImageData;0.3" /** * @file @@ -58,7 +59,7 @@ struct PPB_ImageData { /** * Allocates an image data resource with the given format and size. The * return value will have a nonzero ID on success, or zero on failure. - * Failure means the module handle, image size, or format was invalid. + * Failure means the instance, image size, or format was invalid. * * Set the init_to_zero flag if you want the bitmap initialized to * transparent during the creation process. If this flag is not set, the @@ -69,7 +70,7 @@ struct PPB_ImageData { * memory, but may contain data from a previous image produced by the same * plugin if the bitmap was cached and re-used. */ - PP_Resource (*Create)(PP_Module module, + PP_Resource (*Create)(PP_Instance instance, PP_ImageDataFormat format, const struct PP_Size* size, PP_Bool init_to_zero); |