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

Unified Diff: ppapi/thunk/ppb_video_decoder_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_video_capture_thunk.cc ('k') | ppapi/thunk/ppb_websocket_thunk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/thunk/ppb_video_decoder_thunk.cc
diff --git a/ppapi/thunk/ppb_video_decoder_thunk.cc b/ppapi/thunk/ppb_video_decoder_thunk.cc
index 5ff707c143b12d47f3d51a57ac3249e1dd9332b3..3895c71d907332dc7b01303363aba655a7b0a156 100644
--- a/ppapi/thunk/ppb_video_decoder_thunk.cc
+++ b/ppapi/thunk/ppb_video_decoder_thunk.cc
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#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_video_decoder_api.h"
@@ -33,11 +32,10 @@ PP_Bool IsVideoDecoder(PP_Resource resource) {
int32_t Decode(PP_Resource video_decoder,
const PP_VideoBitstreamBuffer_Dev* bitstream_buffer,
PP_CompletionCallback callback) {
- EnterVideoDecoder enter(video_decoder, true);
+ EnterVideoDecoder enter(video_decoder, callback, true);
if (enter.failed())
- return MayForceCallback(callback, PP_ERROR_BADRESOURCE);
- int32_t result = enter.object()->Decode(bitstream_buffer, callback);
- return MayForceCallback(callback, result);
+ return enter.retval();
+ return enter.SetResult(enter.object()->Decode(bitstream_buffer, callback));
}
void AssignPictureBuffers(PP_Resource video_decoder,
@@ -55,20 +53,18 @@ void ReusePictureBuffer(PP_Resource video_decoder, int32_t picture_buffer_id) {
}
int32_t Flush(PP_Resource video_decoder, PP_CompletionCallback callback) {
- EnterVideoDecoder enter(video_decoder, true);
+ EnterVideoDecoder enter(video_decoder, callback, true);
if (enter.failed())
- return MayForceCallback(callback, PP_ERROR_BADRESOURCE);
- int32_t result = enter.object()->Flush(callback);
- return MayForceCallback(callback, result);
+ return enter.retval();
+ return enter.SetResult(enter.object()->Flush(callback));
}
int32_t Reset(PP_Resource video_decoder,
PP_CompletionCallback callback) {
- EnterVideoDecoder enter(video_decoder, true);
+ EnterVideoDecoder enter(video_decoder, callback, true);
if (enter.failed())
- return MayForceCallback(callback, PP_ERROR_BADRESOURCE);
- int32_t result = enter.object()->Reset(callback);
- return MayForceCallback(callback, result);
+ return enter.retval();
+ return enter.SetResult(enter.object()->Reset(callback));
}
void Destroy(PP_Resource video_decoder) {
« no previous file with comments | « ppapi/thunk/ppb_video_capture_thunk.cc ('k') | ppapi/thunk/ppb_websocket_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698