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

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

Issue 7149026: Implement flash menu and net connector resources using the API/thunk model. (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_image_data_impl.h ('k') | webkit/plugins/ppapi/resource_creation_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_image_data_impl.cc
===================================================================
--- webkit/plugins/ppapi/ppb_image_data_impl.cc (revision 89119)
+++ webkit/plugins/ppapi/ppb_image_data_impl.cc (working copy)
@@ -19,29 +19,11 @@
#include "webkit/plugins/ppapi/common.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
+using ::ppapi::thunk::PPB_ImageData_API;
+
namespace webkit {
namespace ppapi {
-namespace {
-
-int32_t GetSharedMemory(PP_Resource resource,
- int* handle,
- uint32_t* byte_count) {
- scoped_refptr<PPB_ImageData_Impl> image_data(
- Resource::GetAs<PPB_ImageData_Impl>(resource));
- if (image_data) {
- *handle = image_data->GetSharedMemoryHandle(byte_count);
- return PP_OK;
- }
- return PP_ERROR_BADRESOURCE;
-}
-
-const PPB_ImageDataTrusted ppb_imagedata_trusted = {
- &GetSharedMemory,
-};
-
-} // namespace
-
PPB_ImageData_Impl::PPB_ImageData_Impl(PluginInstance* instance)
: Resource(instance),
format_(PP_IMAGEDATAFORMAT_BGRA_PREMUL),
@@ -52,17 +34,7 @@
PPB_ImageData_Impl::~PPB_ImageData_Impl() {
}
-// static
-const PPB_ImageData* PPB_ImageData_Impl::GetInterface() {
- return ::ppapi::thunk::GetPPB_ImageData_Thunk();
-}
-
-// static
-const PPB_ImageDataTrusted* PPB_ImageData_Impl::GetTrustedInterface() {
- return &ppb_imagedata_trusted;
-}
-
-::ppapi::thunk::PPB_ImageData_API* PPB_ImageData_Impl::AsPPB_ImageData_API() {
+PPB_ImageData_API* PPB_ImageData_Impl::AsPPB_ImageData_API() {
return this;
}
@@ -122,8 +94,10 @@
// in the future to save some memory.
}
-int PPB_ImageData_Impl::GetSharedMemoryHandle(uint32* byte_count) const {
- return platform_image_->GetSharedMemoryHandle(byte_count);
+int32_t PPB_ImageData_Impl::GetSharedMemory(int* handle,
+ uint32_t* byte_count) {
+ *handle = platform_image_->GetSharedMemoryHandle(byte_count);
+ return PP_OK;
}
const SkBitmap* PPB_ImageData_Impl::GetMappedBitmap() const {
« no previous file with comments | « webkit/plugins/ppapi/ppb_image_data_impl.h ('k') | webkit/plugins/ppapi/resource_creation_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698