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

Unified Diff: webkit/plugins/ppapi/ppb_font_impl.cc

Issue 7669055: Remove webkit::ppapi::Resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nulls auditeed Created 9 years, 4 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 | « webkit/plugins/ppapi/ppb_font_impl.h ('k') | webkit/plugins/ppapi/ppb_graphics_2d_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_font_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_font_impl.cc b/webkit/plugins/ppapi/ppb_font_impl.cc
index 8db4ed67fbc74671a76b340557328759212fdf29..a714e0311acce0322d8bbd1fc6c8716beed8d188 100644
--- a/webkit/plugins/ppapi/ppb_font_impl.cc
+++ b/webkit/plugins/ppapi/ppb_font_impl.cc
@@ -14,6 +14,7 @@
#include "webkit/plugins/ppapi/plugin_module.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
#include "webkit/plugins/ppapi/ppb_image_data_impl.h"
+#include "webkit/plugins/ppapi/resource_helper.h"
#include "webkit/plugins/ppapi/string.h"
using ppapi::StringVar;
@@ -42,15 +43,18 @@ bool PPTextRunToTextRun(const PP_TextRun_Dev* run,
} // namespace
-PPB_Font_Impl::PPB_Font_Impl(PluginInstance* instance,
+PPB_Font_Impl::PPB_Font_Impl(PP_Instance pp_instance,
const PP_FontDescription_Dev& desc)
- : Resource(instance) {
+ : Resource(pp_instance) {
StringVar* face_name = StringVar::FromPPVar(desc.face);
WebKitForwarding::Font* result = NULL;
- instance->module()->GetWebKitForwarding()->CreateFontForwarding(
- NULL, desc, face_name ? face_name->value() : std::string(),
- instance->delegate()->GetPreferences(), &result);
+ PluginInstance* plugin_instance = ResourceHelper::GetPluginInstance(this);
+ if (plugin_instance) {
+ plugin_instance->module()->GetWebKitForwarding()->CreateFontForwarding(
+ NULL, desc, face_name ? face_name->value() : std::string(),
+ plugin_instance->delegate()->GetPreferences(), &result);
+ }
font_forwarding_.reset(result);
}
@@ -58,7 +62,7 @@ PPB_Font_Impl::~PPB_Font_Impl() {
}
// static
-PP_Resource PPB_Font_Impl::Create(PluginInstance* instance,
+PP_Resource PPB_Font_Impl::Create(PP_Instance instance,
const PP_FontDescription_Dev& description) {
if (!::ppapi::FontImpl::IsPPFontDescriptionValid(description))
return 0;
@@ -77,9 +81,13 @@ PP_Bool PPB_Font_Impl::Describe(PP_FontDescription_Dev* description,
if (!result)
return PP_FALSE;
+ PluginModule* plugin_module = ResourceHelper::GetPluginModule(this);
+ if (!plugin_module)
+ return PP_FALSE;
+
// Convert the string.
- description->face = StringVar::StringToPPVar(
- instance()->module()->pp_module(), face);
+ description->face = StringVar::StringToPPVar(plugin_module->pp_module(),
+ face);
return PP_TRUE;
}
« no previous file with comments | « webkit/plugins/ppapi/ppb_font_impl.h ('k') | webkit/plugins/ppapi/ppb_graphics_2d_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698