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

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

Issue 7206016: Convert most remaining resources to use the API/thunk system. The significant (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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: webkit/plugins/ppapi/ppb_flash_file_impl.cc
===================================================================
--- webkit/plugins/ppapi/ppb_flash_file_impl.cc (revision 89610)
+++ webkit/plugins/ppapi/ppb_flash_file_impl.cc (working copy)
@@ -11,6 +11,7 @@
#include "ppapi/c/dev/pp_file_info_dev.h"
#include "ppapi/c/dev/ppb_file_io_dev.h"
#include "ppapi/c/private/ppb_flash_file.h"
+#include "ppapi/thunk/enter.h"
#include "webkit/plugins/ppapi/common.h"
#include "webkit/plugins/ppapi/file_path.h"
#include "webkit/plugins/ppapi/file_type_conversions.h"
@@ -24,6 +25,9 @@
#include "base/utf_string_conversions.h"
#endif
+using ppapi::thunk::EnterResource;
+using ppapi::thunk::PPB_FileRef_API;
+
namespace webkit {
namespace ppapi {
@@ -214,10 +218,10 @@
if (!PepperFileOpenFlagsToPlatformFileFlags(mode, &flags) || !file)
return PP_ERROR_BADARGUMENT;
- scoped_refptr<PPB_FileRef_Impl> file_ref(
- Resource::GetAs<PPB_FileRef_Impl>(file_ref_id));
- if (!file_ref)
+ EnterResource<PPB_FileRef_API> enter(file_ref_id, true);
+ if (enter.failed())
return PP_ERROR_BADRESOURCE;
+ PPB_FileRef_Impl* file_ref = static_cast<PPB_FileRef_Impl*>(enter.object());
PluginInstance* instance = file_ref->instance();
if (!instance)
@@ -234,10 +238,10 @@
int32_t QueryFileRefFile(PP_Resource file_ref_id,
PP_FileInfo_Dev* info) {
- scoped_refptr<PPB_FileRef_Impl> file_ref(
- Resource::GetAs<PPB_FileRef_Impl>(file_ref_id));
- if (!file_ref)
+ EnterResource<PPB_FileRef_API> enter(file_ref_id, true);
+ if (enter.failed())
return PP_ERROR_BADRESOURCE;
+ PPB_FileRef_Impl* file_ref = static_cast<PPB_FileRef_Impl*>(enter.object());
PluginInstance* instance = file_ref->instance();
if (!instance)

Powered by Google App Engine
This is Rietveld 408576698