diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-10 23:47:53 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-10 23:47:53 +0000 |
commit | 5d0cf2d4df97e6d429d816a9a2e0d0a00978d7a9 (patch) | |
tree | 4433ea2ec733913547ff8159b9742acbd42092e2 | |
parent | 94b0625a464ba5fa6a55f6e57927acd9895a49c1 (diff) | |
download | chromium_src-5d0cf2d4df97e6d429d816a9a2e0d0a00978d7a9.zip chromium_src-5d0cf2d4df97e6d429d816a9a2e0d0a00978d7a9.tar.gz chromium_src-5d0cf2d4df97e6d429d816a9a2e0d0a00978d7a9.tar.bz2 |
Convert flash font file to use the browser font trusted code.
BUG=
Review URL: https://codereview.chromium.org/11470026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172188 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ppapi/api/private/ppb_flash_font_file.idl | 2 | ||||
-rw-r--r-- | ppapi/c/private/ppb_flash_font_file.h | 11 | ||||
-rw-r--r-- | ppapi/cpp/private/DEPS | 1 | ||||
-rw-r--r-- | ppapi/cpp/private/flash_font_file.cc | 9 | ||||
-rw-r--r-- | ppapi/cpp/private/flash_font_file.h | 4 | ||||
-rw-r--r-- | ppapi/proxy/flash_font_file_resource.cc | 4 | ||||
-rw-r--r-- | ppapi/proxy/flash_font_file_resource.h | 4 | ||||
-rw-r--r-- | ppapi/proxy/resource_creation_proxy.cc | 2 | ||||
-rw-r--r-- | ppapi/proxy/resource_creation_proxy.h | 2 | ||||
-rw-r--r-- | ppapi/thunk/ppb_flash_font_file_thunk.cc | 2 | ||||
-rw-r--r-- | ppapi/thunk/resource_creation_api.h | 2 | ||||
-rw-r--r-- | webkit/plugins/ppapi/resource_creation_impl.cc | 2 | ||||
-rw-r--r-- | webkit/plugins/ppapi/resource_creation_impl.h | 2 |
13 files changed, 27 insertions, 20 deletions
diff --git a/ppapi/api/private/ppb_flash_font_file.idl b/ppapi/api/private/ppb_flash_font_file.idl index 51309f1..5a48f02b 100644 --- a/ppapi/api/private/ppb_flash_font_file.idl +++ b/ppapi/api/private/ppb_flash_font_file.idl @@ -17,7 +17,7 @@ interface PPB_Flash_FontFile { */ PP_Resource Create( [in] PP_Instance instance, - [in] PP_FontDescription_Dev description, + [in] PP_BrowserFont_Trusted_Description description, [in] PP_PrivateFontCharset charset); /* Determines if a given resource is Flash font file. diff --git a/ppapi/c/private/ppb_flash_font_file.h b/ppapi/c/private/ppb_flash_font_file.h index 53bbfda..80eff5a 100644 --- a/ppapi/c/private/ppb_flash_font_file.h +++ b/ppapi/c/private/ppb_flash_font_file.h @@ -3,12 +3,11 @@ * found in the LICENSE file. */ -/* From private/ppb_flash_font_file.idl modified Mon Oct 08 10:46:09 2012. */ +/* From private\ppb_flash_font_file.idl modified Fri Dec 07 15:00:36 2012. */ #ifndef PPAPI_C_PRIVATE_PPB_FLASH_FONT_FILE_H_ #define PPAPI_C_PRIVATE_PPB_FLASH_FONT_FILE_H_ -#include "ppapi/c/dev/ppb_font_dev.h" #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_macros.h" @@ -16,6 +15,7 @@ #include "ppapi/c/pp_stdint.h" #include "ppapi/c/pp_var.h" #include "ppapi/c/private/pp_private_font_charset.h" +#include "ppapi/c/trusted/ppb_browser_font_trusted.h" #define PPB_FLASH_FONTFILE_INTERFACE_0_1 "PPB_Flash_FontFile;0.1" #define PPB_FLASH_FONTFILE_INTERFACE PPB_FLASH_FONTFILE_INTERFACE_0_1 @@ -34,9 +34,10 @@ struct PPB_Flash_FontFile_0_1 { /* Returns a resource identifying a font file corresponding to the given font * request after applying the browser-specific fallback. */ - PP_Resource (*Create)(PP_Instance instance, - const struct PP_FontDescription_Dev* description, - PP_PrivateFontCharset charset); + PP_Resource (*Create)( + PP_Instance instance, + const struct PP_BrowserFont_Trusted_Description* description, + PP_PrivateFontCharset charset); /* Determines if a given resource is Flash font file. */ PP_Bool (*IsFlashFontFile)(PP_Resource resource); diff --git a/ppapi/cpp/private/DEPS b/ppapi/cpp/private/DEPS index 18adee2..89916e4 100644 --- a/ppapi/cpp/private/DEPS +++ b/ppapi/cpp/private/DEPS @@ -1,4 +1,5 @@ include_rules = [ "+ppapi/c/private", + "+ppapi/c/trusted", "+ppapi/cpp/trusted", ] diff --git a/ppapi/cpp/private/flash_font_file.cc b/ppapi/cpp/private/flash_font_file.cc index 8400d8f..406f0ac 100644 --- a/ppapi/cpp/private/flash_font_file.cc +++ b/ppapi/cpp/private/flash_font_file.cc @@ -7,6 +7,7 @@ #include "ppapi/c/dev/ppb_font_dev.h" #include "ppapi/c/private/ppb_flash_font_file.h" #include "ppapi/c/private/ppb_pdf.h" +#include "ppapi/c/trusted/ppb_browser_font_trusted.h" #include "ppapi/cpp/instance_handle.h" #include "ppapi/cpp/module_impl.h" @@ -32,14 +33,18 @@ FontFile::FontFile() { } FontFile::FontFile(const InstanceHandle& instance, - const PP_FontDescription_Dev* description, + const PP_BrowserFont_Trusted_Description* description, PP_PrivateFontCharset charset) { if (has_interface<PPB_Flash_FontFile_0_1>()) { PassRefFromConstructor(get_interface<PPB_Flash_FontFile_0_1>()->Create( instance.pp_instance(), description, charset)); } else if (has_interface<PPB_PDF>()) { + // PP_Font_Description_Dev and PP_BrowserFont_Trusted_Description are the + // same struct so we can call this old interface by casting. PassRefFromConstructor(get_interface<PPB_PDF>()->GetFontFileWithFallback( - instance.pp_instance(), description, charset)); + instance.pp_instance(), + reinterpret_cast<const PP_FontDescription_Dev*>(description), + charset)); } } diff --git a/ppapi/cpp/private/flash_font_file.h b/ppapi/cpp/private/flash_font_file.h index 8b61986..053fca2 100644 --- a/ppapi/cpp/private/flash_font_file.h +++ b/ppapi/cpp/private/flash_font_file.h @@ -8,7 +8,7 @@ #include "ppapi/c/private/pp_private_font_charset.h" #include "ppapi/cpp/resource.h" -struct PP_FontDescription_Dev; +struct PP_BrowserFont_Trusted_Description; namespace pp { @@ -21,7 +21,7 @@ class FontFile : public Resource { // Default constructor for making an is_null() FontFile resource. FontFile(); FontFile(const InstanceHandle& instance, - const PP_FontDescription_Dev* description, + const PP_BrowserFont_Trusted_Description* description, PP_PrivateFontCharset charset); virtual ~FontFile(); diff --git a/ppapi/proxy/flash_font_file_resource.cc b/ppapi/proxy/flash_font_file_resource.cc index e835ac1..86caf1f 100644 --- a/ppapi/proxy/flash_font_file_resource.cc +++ b/ppapi/proxy/flash_font_file_resource.cc @@ -16,11 +16,11 @@ namespace proxy { FlashFontFileResource::FlashFontFileResource( Connection connection, PP_Instance instance, - const PP_FontDescription_Dev* description, + const PP_BrowserFont_Trusted_Description* description, PP_PrivateFontCharset charset) : PluginResource(connection, instance), charset_(charset) { - description_.SetFromPPFontDescription(*description); + description_.SetFromPPBrowserFontDescription(*description); } FlashFontFileResource::~FlashFontFileResource() { diff --git a/ppapi/proxy/flash_font_file_resource.h b/ppapi/proxy/flash_font_file_resource.h index 1644394..5bc633a 100644 --- a/ppapi/proxy/flash_font_file_resource.h +++ b/ppapi/proxy/flash_font_file_resource.h @@ -16,7 +16,7 @@ #include "ppapi/proxy/serialized_structs.h" #include "ppapi/thunk/ppb_flash_font_file_api.h" -struct PP_FontDescription_Dev; +struct PP_BrowserFont_Trusted_Description; namespace ppapi { namespace proxy { @@ -27,7 +27,7 @@ class FlashFontFileResource : public PluginResource, public: FlashFontFileResource(Connection connection, PP_Instance instance, - const PP_FontDescription_Dev* description, + const PP_BrowserFont_Trusted_Description* description, PP_PrivateFontCharset charset); virtual ~FlashFontFileResource(); diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc index 0c995891..90a23bb8 100644 --- a/ppapi/proxy/resource_creation_proxy.cc +++ b/ppapi/proxy/resource_creation_proxy.cc @@ -327,7 +327,7 @@ PP_Resource ResourceCreationProxy::CreateFlashDeviceID(PP_Instance instance) { PP_Resource ResourceCreationProxy::CreateFlashFontFile( PP_Instance instance, - const PP_FontDescription_Dev* description, + const PP_BrowserFont_Trusted_Description* description, PP_PrivateFontCharset charset) { return (new FlashFontFileResource( GetConnection(), instance, description, charset))->GetReference(); diff --git a/ppapi/proxy/resource_creation_proxy.h b/ppapi/proxy/resource_creation_proxy.h index d81cd45..d873d422 100644 --- a/ppapi/proxy/resource_creation_proxy.h +++ b/ppapi/proxy/resource_creation_proxy.h @@ -145,7 +145,7 @@ class ResourceCreationProxy : public InterfaceProxy, virtual PP_Resource CreateFlashDeviceID(PP_Instance instance) OVERRIDE; virtual PP_Resource CreateFlashFontFile( PP_Instance instance, - const PP_FontDescription_Dev* description, + const PP_BrowserFont_Trusted_Description* description, PP_PrivateFontCharset charset) OVERRIDE; virtual PP_Resource CreateFlashMenu(PP_Instance instance, const PP_Flash_Menu* menu_data) OVERRIDE; diff --git a/ppapi/thunk/ppb_flash_font_file_thunk.cc b/ppapi/thunk/ppb_flash_font_file_thunk.cc index ee338f0..3a07365 100644 --- a/ppapi/thunk/ppb_flash_font_file_thunk.cc +++ b/ppapi/thunk/ppb_flash_font_file_thunk.cc @@ -14,7 +14,7 @@ namespace thunk { namespace { PP_Resource Create(PP_Instance instance, - const PP_FontDescription_Dev* description, + const PP_BrowserFont_Trusted_Description* description, PP_PrivateFontCharset charset) { EnterResourceCreation enter(instance); if (enter.failed()) diff --git a/ppapi/thunk/resource_creation_api.h b/ppapi/thunk/resource_creation_api.h index 4da36c1..b8b6a66 100644 --- a/ppapi/thunk/resource_creation_api.h +++ b/ppapi/thunk/resource_creation_api.h @@ -151,7 +151,7 @@ class ResourceCreationAPI { virtual PP_Resource CreateFlashDeviceID(PP_Instance instance) = 0; virtual PP_Resource CreateFlashFontFile( PP_Instance instance, - const PP_FontDescription_Dev* description, + const PP_BrowserFont_Trusted_Description* description, PP_PrivateFontCharset charset) = 0; virtual PP_Resource CreateFlashMenu(PP_Instance instance, const PP_Flash_Menu* menu_data) = 0; diff --git a/webkit/plugins/ppapi/resource_creation_impl.cc b/webkit/plugins/ppapi/resource_creation_impl.cc index 96713c8..1ef878f 100644 --- a/webkit/plugins/ppapi/resource_creation_impl.cc +++ b/webkit/plugins/ppapi/resource_creation_impl.cc @@ -107,7 +107,7 @@ PP_Resource ResourceCreationImpl::CreateFlashDeviceID(PP_Instance instance) { PP_Resource ResourceCreationImpl::CreateFlashFontFile( PP_Instance instance, - const PP_FontDescription_Dev* description, + const PP_BrowserFont_Trusted_Description* description, PP_PrivateFontCharset charset) { return 0; // Not supported in-process. } diff --git a/webkit/plugins/ppapi/resource_creation_impl.h b/webkit/plugins/ppapi/resource_creation_impl.h index ea18798..7216b46 100644 --- a/webkit/plugins/ppapi/resource_creation_impl.h +++ b/webkit/plugins/ppapi/resource_creation_impl.h @@ -43,7 +43,7 @@ class WEBKIT_PLUGINS_EXPORT ResourceCreationImpl virtual PP_Resource CreateFlashDeviceID(PP_Instance instance) OVERRIDE; virtual PP_Resource CreateFlashFontFile( PP_Instance instance, - const PP_FontDescription_Dev* description, + const PP_BrowserFont_Trusted_Description* description, PP_PrivateFontCharset charset) OVERRIDE; virtual PP_Resource CreateFlashMenu(PP_Instance instance, const PP_Flash_Menu* menu_data) OVERRIDE; |