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

Unified Diff: ppapi/proxy/ppb_flash_proxy.cc

Issue 6334016: Refactor PPAPI proxy resource handling to maintain which host they came from,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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/ppb_cursor_control_proxy.cc ('k') | ppapi/proxy/ppb_font_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_flash_proxy.cc
===================================================================
--- ppapi/proxy/ppb_flash_proxy.cc (revision 72840)
+++ ppapi/proxy/ppb_flash_proxy.cc (working copy)
@@ -67,13 +67,22 @@
uint32_t glyph_count,
const uint16_t glyph_indices[],
const PP_Point glyph_advances[]) {
- PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
+ PluginResource* image_data = PluginResourceTracker::GetInstance()->
+ GetResourceObject(pp_image_data);
+ if (!image_data)
+ return PP_FALSE;
+ // The instance parameter isn't strictly necessary but we check that it
+ // matches anyway.
+ if (image_data->instance() != instance)
+ return PP_FALSE;
+
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(
+ image_data->instance());
if (!dispatcher)
return PP_FALSE;
PPBFlash_DrawGlyphs_Params params;
- params.instance = instance,
- params.pp_image_data = pp_image_data;
+ params.image_data = image_data->host_resource();
params.font_desc.SetFromPPFontDescription(dispatcher, *font_desc, true);
params.color = color;
params.position = position;
@@ -305,8 +314,9 @@
return;
*result = ppb_flash_target()->DrawGlyphs(
- params.instance, params.pp_image_data, &font_desc, params.color,
- params.position, params.clip,
+ 0, // Unused instance param.
+ params.image_data.host_resource(), &font_desc,
+ params.color, params.position, params.clip,
const_cast<float(*)[3]>(params.transformation),
static_cast<uint32_t>(params.glyph_indices.size()),
const_cast<uint16_t*>(&params.glyph_indices[0]),
« no previous file with comments | « ppapi/proxy/ppb_cursor_control_proxy.cc ('k') | ppapi/proxy/ppb_font_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698