diff options
author | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 02:44:44 +0000 |
---|---|---|
committer | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 02:44:44 +0000 |
commit | 52e211459b22e0ce7d993b53614a5e66b55e9c72 (patch) | |
tree | df26238888d1b2fd1df6701a66c3410649966693 /webkit | |
parent | 205574060e1f2dbbacba32d2afdcc7455be863b3 (diff) | |
download | chromium_src-52e211459b22e0ce7d993b53614a5e66b55e9c72.zip chromium_src-52e211459b22e0ce7d993b53614a5e66b55e9c72.tar.gz chromium_src-52e211459b22e0ce7d993b53614a5e66b55e9c72.tar.bz2 |
First pass at revving stable pepper interfaces to 1.0.
Missing PPB_Core (pending removal of MemAlloc/MemFree) and new input event interfaces, in case we want to change them in the next ~week.
BUG=84519
TEST=ppapi tests
Review URL: http://codereview.chromium.org/7292033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92302 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/plugins/ppapi/plugin_module.cc | 66 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.cc | 8 |
2 files changed, 57 insertions, 17 deletions
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc index 65d702d..5c5eb38 100644 --- a/webkit/plugins/ppapi/plugin_module.cc +++ b/webkit/plugins/ppapi/plugin_module.cc @@ -232,9 +232,9 @@ const void* GetInterface(const char* name) { // Please keep alphabetized by interface macro name with "special" stuff at // the bottom. - if (strcmp(name, PPB_AUDIO_CONFIG_INTERFACE) == 0) + if (strcmp(name, PPB_AUDIO_CONFIG_INTERFACE_1_0) == 0) return ::ppapi::thunk::GetPPB_AudioConfig_Thunk(); - if (strcmp(name, PPB_AUDIO_INTERFACE) == 0) + if (strcmp(name, PPB_AUDIO_INTERFACE_1_0) == 0) return ::ppapi::thunk::GetPPB_Audio_Thunk(); if (strcmp(name, PPB_AUDIO_TRUSTED_INTERFACE) == 0) return ::ppapi::thunk::GetPPB_AudioTrusted_Thunk(); @@ -258,13 +258,13 @@ const void* GetInterface(const char* name) { return ::ppapi::thunk::GetPPB_DirectoryReader_Thunk(); if (strcmp(name, PPB_FILECHOOSER_DEV_INTERFACE) == 0) return ::ppapi::thunk::GetPPB_FileChooser_Thunk(); - if (strcmp(name, PPB_FILEIO_INTERFACE) == 0) + if (strcmp(name, PPB_FILEIO_INTERFACE_1_0) == 0) return ::ppapi::thunk::GetPPB_FileIO_Thunk(); if (strcmp(name, PPB_FILEIOTRUSTED_INTERFACE) == 0) return ::ppapi::thunk::GetPPB_FileIOTrusted_Thunk(); - if (strcmp(name, PPB_FILEREF_INTERFACE) == 0) + if (strcmp(name, PPB_FILEREF_INTERFACE_1_0) == 0) return ::ppapi::thunk::GetPPB_FileRef_Thunk(); - if (strcmp(name, PPB_FILESYSTEM_INTERFACE) == 0) + if (strcmp(name, PPB_FILESYSTEM_INTERFACE_1_0) == 0) return ::ppapi::thunk::GetPPB_FileSystem_Thunk(); if (strcmp(name, PPB_FIND_DEV_INTERFACE) == 0) return ::ppapi::thunk::GetPPB_Find_Thunk(); @@ -284,25 +284,23 @@ const void* GetInterface(const char* name) { return ::ppapi::thunk::GetPPB_Font_Thunk(); if (strcmp(name, PPB_FULLSCREEN_DEV_INTERFACE) == 0) return ::ppapi::thunk::GetPPB_Fullscreen_Thunk(); - if (strcmp(name, PPB_GRAPHICS_2D_INTERFACE) == 0) + if (strcmp(name, PPB_GRAPHICS_2D_INTERFACE_1_0) == 0) return ::ppapi::thunk::GetPPB_Graphics2D_Thunk(); - if (strcmp(name, PPB_IMAGEDATA_INTERFACE) == 0) + if (strcmp(name, PPB_IMAGEDATA_INTERFACE_1_0) == 0) return ::ppapi::thunk::GetPPB_ImageData_Thunk(); if (strcmp(name, PPB_IMAGEDATA_TRUSTED_INTERFACE) == 0) return ::ppapi::thunk::GetPPB_ImageDataTrusted_Thunk(); if (strcmp(name, PPB_INPUT_EVENT_INTERFACE) == 0) return ::ppapi::thunk::GetPPB_InputEvent_Thunk(); - if (strcmp(name, PPB_INSTANCE_INTERFACE_0_4) == 0) - return ::ppapi::thunk::GetPPB_Instance_0_4_Thunk(); - if (strcmp(name, PPB_INSTANCE_INTERFACE_0_5) == 0) - return ::ppapi::thunk::GetPPB_Instance_0_5_Thunk(); + if (strcmp(name, PPB_INSTANCE_INTERFACE_1_0) == 0) + return ::ppapi::thunk::GetPPB_Instance_1_0_Thunk(); if (strcmp(name, PPB_INSTANCE_PRIVATE_INTERFACE) == 0) return ::ppapi::thunk::GetPPB_Instance_Private_Thunk(); if (strcmp(name, PPB_KEYBOARD_INPUT_EVENT_INTERFACE) == 0) return ::ppapi::thunk::GetPPB_KeyboardInputEvent_Thunk(); if (strcmp(name, PPB_MEMORY_DEV_INTERFACE) == 0) return PPB_Memory_Impl::GetInterface(); - if (strcmp(name, PPB_MESSAGING_INTERFACE) == 0) + if (strcmp(name, PPB_MESSAGING_INTERFACE_1_0) == 0) return ::ppapi::thunk::GetPPB_Messaging_Thunk(); if (strcmp(name, PPB_MOUSE_INPUT_EVENT_INTERFACE) == 0) return ::ppapi::thunk::GetPPB_MouseInputEvent_Thunk(); @@ -314,19 +312,19 @@ const void* GetInterface(const char* name) { return PPB_Scrollbar_Impl::Get0_3Interface(); if (strcmp(name, PPB_UMA_PRIVATE_INTERFACE) == 0) return PPB_UMA_Private_Impl::GetInterface(); - if (strcmp(name, PPB_URLLOADER_INTERFACE) == 0) + if (strcmp(name, PPB_URLLOADER_INTERFACE_1_0) == 0) return ::ppapi::thunk::GetPPB_URLLoader_Thunk(); if (strcmp(name, PPB_URLLOADERTRUSTED_INTERFACE) == 0) return ::ppapi::thunk::GetPPB_URLLoaderTrusted_Thunk(); - if (strcmp(name, PPB_URLREQUESTINFO_INTERFACE) == 0) + if (strcmp(name, PPB_URLREQUESTINFO_INTERFACE_1_0) == 0) return ::ppapi::thunk::GetPPB_URLRequestInfo_Thunk(); - if (strcmp(name, PPB_URLRESPONSEINFO_INTERFACE) == 0) + if (strcmp(name, PPB_URLRESPONSEINFO_INTERFACE_1_0) == 0) return ::ppapi::thunk::GetPPB_URLResponseInfo_Thunk(); if (strcmp(name, PPB_URLUTIL_DEV_INTERFACE) == 0) return PPB_URLUtil_Impl::GetInterface(); if (strcmp(name, PPB_VAR_DEPRECATED_INTERFACE) == 0) return Var::GetDeprecatedInterface(); - if (strcmp(name, PPB_VAR_INTERFACE) == 0) + if (strcmp(name, PPB_VAR_INTERFACE_1_0) == 0) return Var::GetInterface(); if (strcmp(name, PPB_VIDEODECODER_DEV_INTERFACE) == 0) return ::ppapi::thunk::GetPPB_VideoDecoder_Thunk(); @@ -369,6 +367,42 @@ const void* GetInterface(const char* name) { return ::ppapi::thunk::GetPPB_Transport_Thunk(); #endif + // Support pre-1.0 version strings of stable interfaces until the changes + // have rippled through the system (especially NaCl tree). + // TODO(dmichael): Remove this. + if (strcmp(name, PPB_AUDIO_CONFIG_INTERFACE_0_5) == 0) + return ::ppapi::thunk::GetPPB_AudioConfig_Thunk(); + if (strcmp(name, PPB_AUDIO_INTERFACE_0_6) == 0) + return ::ppapi::thunk::GetPPB_Audio_Thunk(); + if (strcmp(name, PPB_FILEIO_INTERFACE_0_5) == 0) + return ::ppapi::thunk::GetPPB_FileIO_Thunk(); + if (strcmp(name, PPB_FILEREF_INTERFACE_0_9) == 0) + return ::ppapi::thunk::GetPPB_FileRef_Thunk(); + if (strcmp(name, PPB_FILESYSTEM_INTERFACE_0_7) == 0) + return ::ppapi::thunk::GetPPB_FileSystem_Thunk(); + if (strcmp(name, PPB_GRAPHICS_2D_INTERFACE_0_4) == 0) + return PPB_Graphics2D_Impl::GetInterface(); + if (strcmp(name, PPB_IMAGEDATA_INTERFACE_0_3) == 0) + return ::ppapi::thunk::GetPPB_ImageData_Thunk(); + if (strcmp(name, PPB_INSTANCE_INTERFACE_0_5) == 0) + return ::ppapi::thunk::GetPPB_Instance_1_0_Thunk(); + if (strcmp(name, PPB_MESSAGING_INTERFACE_0_1) == 0) + return ::ppapi::thunk::GetPPB_Messaging_Thunk(); + if (strcmp(name, PPB_URLLOADER_INTERFACE_0_2) == 0) + return ::ppapi::thunk::GetPPB_URLLoader_Thunk(); + if (strcmp(name, PPB_URLREQUESTINFO_INTERFACE_0_2) == 0) + return ::ppapi::thunk::GetPPB_URLRequestInfo_Thunk(); + if (strcmp(name, PPB_URLRESPONSEINFO_INTERFACE_0_1) == 0) + return ::ppapi::thunk::GetPPB_URLResponseInfo_Thunk(); + if (strcmp(name, PPB_VAR_INTERFACE_0_5) == 0) + return Var::GetInterface(); + + // Support the 0.4 version of PPB_Instance that includes scripting, until it + // is no longer being used. + // TODO(dmichael): Remove this. + if (strcmp(name, PPB_INSTANCE_INTERFACE_0_4) == 0) + return ::ppapi::thunk::GetPPB_Instance_0_4_Thunk(); + // Support the dev interfaces for file io, fileref and file system // until relevant tests and examples are migrated over to non-dev interfaces // in order to prevent breaking the tests and examples. diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc index 6ed2ea8..c7df634 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc @@ -700,7 +700,13 @@ bool PluginInstance::LoadMessagingInterface() { checked_for_plugin_messaging_interface_ = true; plugin_messaging_interface_ = static_cast<const PPP_Messaging*>(module_->GetPluginInterface( - PPP_MESSAGING_INTERFACE)); + PPP_MESSAGING_INTERFACE_1_0)); + // TODO(dmichael): Remove support for 0.1. + if (!plugin_messaging_interface_) { + plugin_messaging_interface_ = + static_cast<const PPP_Messaging*>(module_->GetPluginInterface( + PPP_MESSAGING_INTERFACE_0_1)); + } } return !!plugin_messaging_interface_; |