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

Unified Diff: ppapi/proxy/ppb_testing_proxy.cc

Issue 11053003: Migrate Graphics2D to new design. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 years, 1 month 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 | « ppapi/proxy/ppb_instance_proxy.cc ('k') | ppapi/proxy/resource_creation_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_testing_proxy.cc
diff --git a/ppapi/proxy/ppb_testing_proxy.cc b/ppapi/proxy/ppb_testing_proxy.cc
index 576302f97b97071ba8f78547f4b75b1e27ed4907..c52528b612e5683be1c5d639439dbe2885cc61ee 100644
--- a/ppapi/proxy/ppb_testing_proxy.cc
+++ b/ppapi/proxy/ppb_testing_proxy.cc
@@ -14,10 +14,13 @@
#include "ppapi/shared_impl/resource.h"
#include "ppapi/shared_impl/resource_tracker.h"
#include "ppapi/thunk/enter.h"
+#include "ppapi/thunk/ppb_graphics_2d_api.h"
#include "ppapi/thunk/ppb_input_event_api.h"
using ppapi::thunk::EnterInstance;
+using ppapi::thunk::EnterResource;
using ppapi::thunk::EnterResourceNoLock;
+using ppapi::thunk::PPB_Graphics2D_API;
using ppapi::thunk::PPB_InputEvent_API;
namespace ppapi {
@@ -39,16 +42,12 @@ PP_Bool ReadImageData(PP_Resource graphics_2d,
image_object->pp_instance() != graphics_2d_object->pp_instance())
return PP_FALSE;
- PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(
- image_object->pp_instance());
- if (!dispatcher)
+ EnterResourceNoLock<PPB_Graphics2D_API> enter(graphics_2d, true);
+ if (enter.failed())
return PP_FALSE;
-
- PP_Bool result = PP_FALSE;
- dispatcher->Send(new PpapiHostMsg_PPBTesting_ReadImageData(
- API_ID_PPB_TESTING, graphics_2d_object->host_resource(),
- image_object->host_resource(), *top_left, &result));
- return result;
+ const HostResource& host_image = image_object->host_resource();
+ return enter.object()->ReadImageData(host_image.host_resource(), top_left) ?
+ PP_TRUE : PP_FALSE;
}
void RunMessageLoop(PP_Instance instance) {
« no previous file with comments | « ppapi/proxy/ppb_instance_proxy.cc ('k') | ppapi/proxy/resource_creation_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698