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

Unified Diff: chrome/renderer/chrome_ppb_pdf_impl.cc

Issue 7669055: Remove webkit::ppapi::Resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix self-assignment 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
Index: chrome/renderer/chrome_ppb_pdf_impl.cc
diff --git a/chrome/renderer/chrome_ppb_pdf_impl.cc b/chrome/renderer/chrome_ppb_pdf_impl.cc
index 8f4f31a74185691b4652ee68643df4d3a300ff00..d17e7da7d58f72437630f8c311421c2117783389 100644
--- a/chrome/renderer/chrome_ppb_pdf_impl.cc
+++ b/chrome/renderer/chrome_ppb_pdf_impl.cc
@@ -27,15 +27,14 @@
#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_tracker.h"
namespace chrome {
#if defined(OS_LINUX)
-class PrivateFontFile : public webkit::ppapi::Resource {
+class PrivateFontFile : public ppapi::Resource {
public:
- PrivateFontFile(webkit::ppapi::PluginInstance* instance, int fd)
- : webkit::ppapi::Resource(instance),
- fd_(fd) {
+ PrivateFontFile(PP_Instance instance, int fd) : Resource(instance), fd_(fd) {
}
virtual ~PrivateFontFile() {
}
@@ -134,7 +133,7 @@ PP_Var GetLocalizedString(PP_Instance instance_id,
return ppapi::StringVar::StringToPPVar(instance->module()->pp_module(), rv);
}
-PP_Resource GetResourceImage(PP_Instance instance_id,
+PP_Resource GetResourceImage(PP_Instance instance,
PP_ResourceImage image_id) {
int res_id = 0;
for (size_t i = 0; i < arraysize(kResourceImageMap); ++i) {
@@ -149,9 +148,8 @@ PP_Resource GetResourceImage(PP_Instance instance_id,
SkBitmap* res_bitmap =
ResourceBundle::GetSharedInstance().GetBitmapNamed(res_id);
- webkit::ppapi::PluginInstance* instance =
- webkit::ppapi::ResourceTracker::Get()->GetInstance(instance_id);
- if (!instance)
+ // Validate the instance.
+ if (!webkit::ppapi::ResourceTracker::Get()->GetInstance(instance))
viettrungluu 2011/08/22 23:19:46 I really wish we had a consistent convention for i
brettw 2011/08/23 17:16:28 This patch generally removes uses of PluginInstanc
return 0;
scoped_refptr<webkit::ppapi::PPB_ImageData_Impl> image_data(
new webkit::ppapi::PPB_ImageData_Impl(instance));
@@ -174,13 +172,12 @@ PP_Resource GetResourceImage(PP_Instance instance_id,
}
PP_Resource GetFontFileWithFallback(
- PP_Instance instance_id,
+ PP_Instance instance,
const PP_FontDescription_Dev* description,
PP_PrivateFontCharset charset) {
#if defined(OS_LINUX)
- webkit::ppapi::PluginInstance* instance =
- webkit::ppapi::ResourceTracker::Get()->GetInstance(instance_id);
- if (!instance)
+ // Validate the instance before using it below.
+ if (!webkit::ppapi::ResourceTracker::Get()->GetInstance(instance))
return 0;
scoped_refptr<ppapi::StringVar> face_name(ppapi::StringVar::FromPPVar(

Powered by Google App Engine
This is Rietveld 408576698