Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(853)

Unified Diff: ppapi/proxy/ppb_flash_proxy.cc

Issue 10905227: Introduce PPB_Flash_Font. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/ppapi_param_traits.cc ('k') | ppapi/proxy/ppb_pdf_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_flash_proxy.cc
diff --git a/ppapi/proxy/ppb_flash_proxy.cc b/ppapi/proxy/ppb_flash_proxy.cc
index 9a7ace3d0efb5bb238f36a0165caa2f6daa718e6..6a5a9052589bda9d06808db5fb23a7ea02c64e8b 100644
--- a/ppapi/proxy/ppb_flash_proxy.cc
+++ b/ppapi/proxy/ppb_flash_proxy.cc
@@ -33,6 +33,7 @@
#include "ppapi/shared_impl/scoped_pp_resource.h"
#include "ppapi/shared_impl/time_conversion.h"
#include "ppapi/shared_impl/var.h"
+#include "ppapi/shared_impl/var_tracker.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_instance_api.h"
#include "ppapi/thunk/ppb_url_request_info_api.h"
@@ -60,6 +61,8 @@ IPC::PlatformFileForTransit PlatformFileToPlatformFileForTransit(
}
void InvokePrinting(PP_Instance instance) {
+ ProxyAutoLock lock;
+
PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
if (dispatcher) {
dispatcher->Send(new PpapiHostMsg_PPBFlash_InvokePrinting(
@@ -162,7 +165,7 @@ PP_Bool PPB_Flash_Proxy::DrawGlyphs(PP_Instance instance,
PPBFlash_DrawGlyphs_Params params;
params.image_data = image_data->host_resource();
- params.font_desc.SetFromPPFontDescription(dispatcher(), *font_desc, true);
+ params.font_desc.SetFromPPFontDescription(*font_desc);
params.color = color;
params.position = *position;
params.clip = *clip;
@@ -631,13 +634,13 @@ void PPB_Flash_Proxy::OnHostMsgDrawGlyphs(
if (enter.failed())
return;
- PP_FontDescription_Dev font_desc;
- params.font_desc.SetToPPFontDescription(dispatcher(), &font_desc, false);
-
if (params.glyph_indices.size() != params.glyph_advances.size() ||
params.glyph_indices.empty())
return;
+ PP_FontDescription_Dev font_desc;
+ params.font_desc.SetToPPFontDescription(&font_desc);
+
*result = enter.functions()->GetFlashAPI()->DrawGlyphs(
0, // Unused instance param.
params.image_data.host_resource(), &font_desc,
@@ -647,6 +650,9 @@ void PPB_Flash_Proxy::OnHostMsgDrawGlyphs(
static_cast<uint32_t>(params.glyph_indices.size()),
const_cast<uint16_t*>(&params.glyph_indices[0]),
const_cast<PP_Point*>(&params.glyph_advances[0]));
+
+ // SetToPPFontDescription() creates a var which is owned by the caller.
+ PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(font_desc.face);
}
void PPB_Flash_Proxy::OnHostMsgGetProxyForURL(PP_Instance instance,
« no previous file with comments | « ppapi/proxy/ppapi_param_traits.cc ('k') | ppapi/proxy/ppb_pdf_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698