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

Unified Diff: ppapi/thunk/ppb_graphics_3d_thunk.cc

Issue 9113044: Convert to new enter method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: PATCH DESCRIPTIONS ARE A STUPID WASTE OF TIME Created 8 years, 11 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 | « ppapi/thunk/ppb_graphics_2d_thunk.cc ('k') | ppapi/thunk/ppb_image_data_trusted_thunk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/thunk/ppb_graphics_3d_thunk.cc
diff --git a/ppapi/thunk/ppb_graphics_3d_thunk.cc b/ppapi/thunk/ppb_graphics_3d_thunk.cc
index 490561b48639921bae64a513c68253df9bfd46a6..0aeeb27ee071351489c1d9276d3eeecc19fa96b5 100644
--- a/ppapi/thunk/ppb_graphics_3d_thunk.cc
+++ b/ppapi/thunk/ppb_graphics_3d_thunk.cc
@@ -4,7 +4,6 @@
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
-#include "ppapi/thunk/common.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/thunk.h"
#include "ppapi/thunk/ppb_graphics_3d_api.h"
@@ -27,7 +26,7 @@ int32_t GetAttribMaxValue(PP_Resource instance,
PP_Resource Create(PP_Instance instance,
PP_Resource share_context,
const int32_t* attrib_list) {
- EnterFunction<ResourceCreationAPI> enter(instance, true);
+ EnterResourceCreation enter(instance);
if (enter.failed())
return 0;
return enter.functions()->CreateGraphics3D(
@@ -42,38 +41,36 @@ PP_Bool IsGraphics3D(PP_Resource resource) {
int32_t GetAttribs(PP_Resource graphics_3d, int32_t* attrib_list) {
EnterGraphics3D enter(graphics_3d, true);
if (enter.failed())
- return PP_ERROR_BADRESOURCE;
+ return enter.retval();
return enter.object()->GetAttribs(attrib_list);
}
int32_t SetAttribs(PP_Resource graphics_3d, int32_t* attrib_list) {
EnterGraphics3D enter(graphics_3d, true);
if (enter.failed())
- return PP_ERROR_BADRESOURCE;
+ return enter.retval();
return enter.object()->SetAttribs(attrib_list);
}
int32_t GetError(PP_Resource graphics_3d) {
EnterGraphics3D enter(graphics_3d, true);
if (enter.failed())
- return PP_ERROR_BADRESOURCE;
-
+ return enter.retval();
return enter.object()->GetError();
}
int32_t ResizeBuffers(PP_Resource graphics_3d, int32_t width, int32_t height) {
EnterGraphics3D enter(graphics_3d, true);
if (enter.failed())
- return PP_ERROR_BADRESOURCE;
+ return enter.retval();
return enter.object()->ResizeBuffers(width, height);
}
int32_t SwapBuffers(PP_Resource graphics_3d, PP_CompletionCallback callback) {
- EnterGraphics3D enter(graphics_3d, true);
+ EnterGraphics3D enter(graphics_3d, callback, true);
if (enter.failed())
- return MayForceCallback(callback, PP_ERROR_BADRESOURCE);
- int32_t result = enter.object()->SwapBuffers(callback);
- return MayForceCallback(callback, result);
+ return enter.retval();
+ return enter.SetResult(enter.object()->SwapBuffers(callback));
}
const PPB_Graphics3D g_ppb_graphics_3d_thunk = {
« no previous file with comments | « ppapi/thunk/ppb_graphics_2d_thunk.cc ('k') | ppapi/thunk/ppb_image_data_trusted_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698