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

Unified Diff: webkit/plugins/ppapi/ppb_proxy_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
« no previous file with comments | « webkit/plugins/ppapi/ppb_opengles_impl.cc ('k') | webkit/plugins/ppapi/ppb_scrollbar_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_proxy_impl.cc
===================================================================
--- webkit/plugins/ppapi/ppb_proxy_impl.cc (revision 89672)
+++ webkit/plugins/ppapi/ppb_proxy_impl.cc (working copy)
@@ -5,12 +5,17 @@
#include "webkit/plugins/ppapi/ppb_proxy_impl.h"
#include "ppapi/c/private/ppb_proxy_private.h"
+#include "ppapi/thunk/enter.h"
+#include "ppapi/thunk/ppb_image_data_api.h"
#include "webkit/plugins/ppapi/plugin_module.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
#include "webkit/plugins/ppapi/ppb_url_loader_impl.h"
#include "webkit/plugins/ppapi/resource.h"
#include "webkit/plugins/ppapi/resource_tracker.h"
+using ppapi::thunk::EnterResource;
+using ppapi::thunk::PPB_URLLoader_API;
+
namespace webkit {
namespace ppapi {
@@ -37,11 +42,10 @@
}
int32_t GetURLLoaderBufferedBytes(PP_Resource url_loader) {
- scoped_refptr<PPB_URLLoader_Impl> loader(
- Resource::GetAs<PPB_URLLoader_Impl>(url_loader));
- if (!loader)
- return 0;
- return loader->buffer_size();
+ EnterResource<PPB_URLLoader_API> enter(url_loader, true);
+ if (enter.succeeded())
+ return static_cast<PPB_URLLoader_Impl*>(enter.object())->buffer_size();
+ return 0;
}
void AddRefModule(PP_Module module) {
« no previous file with comments | « webkit/plugins/ppapi/ppb_opengles_impl.cc ('k') | webkit/plugins/ppapi/ppb_scrollbar_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698