OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/c/pp_errors.h" | 5 #include "ppapi/c/pp_errors.h" |
6 #include "ppapi/thunk/common.h" | 6 #include "ppapi/thunk/common.h" |
7 #include "ppapi/thunk/enter.h" | 7 #include "ppapi/thunk/enter.h" |
8 #include "ppapi/thunk/thunk.h" | 8 #include "ppapi/thunk/thunk.h" |
9 #include "ppapi/thunk/ppb_video_decoder_api.h" | 9 #include "ppapi/thunk/ppb_video_decoder_api.h" |
10 #include "ppapi/thunk/resource_creation_api.h" | 10 #include "ppapi/thunk/resource_creation_api.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 | 74 |
75 int32_t Reset(PP_Resource video_decoder, | 75 int32_t Reset(PP_Resource video_decoder, |
76 PP_CompletionCallback callback) { | 76 PP_CompletionCallback callback) { |
77 EnterVideoDecoder enter(video_decoder, true); | 77 EnterVideoDecoder enter(video_decoder, true); |
78 if (enter.failed()) | 78 if (enter.failed()) |
79 return MayForceCallback(callback, PP_ERROR_BADRESOURCE); | 79 return MayForceCallback(callback, PP_ERROR_BADRESOURCE); |
80 int32_t result = enter.object()->Reset(callback); | 80 int32_t result = enter.object()->Reset(callback); |
81 return MayForceCallback(callback, result); | 81 return MayForceCallback(callback, result); |
82 } | 82 } |
83 | 83 |
84 int32_t Destroy(PP_Resource video_decoder, | 84 void Destroy(PP_Resource video_decoder) { |
85 PP_CompletionCallback callback) { | |
86 EnterVideoDecoder enter(video_decoder, true); | 85 EnterVideoDecoder enter(video_decoder, true); |
87 if (enter.failed()) | 86 if (enter.failed()) |
brettw
2011/07/15 16:57:21
In this case I would do:
if (enter.succeeded())
Ami GONE FROM CHROMIUM
2011/07/15 17:10:15
Done.
| |
88 return MayForceCallback(callback, PP_ERROR_BADRESOURCE); | 87 return; |
89 int32_t result = enter.object()->Destroy(callback); | 88 enter.object()->Destroy(); |
90 return MayForceCallback(callback, result); | |
91 } | 89 } |
92 | 90 |
93 const PPB_VideoDecoder_Dev g_ppb_videodecoder_thunk = { | 91 const PPB_VideoDecoder_Dev g_ppb_videodecoder_thunk = { |
94 &Create, | 92 &Create, |
95 &IsVideoDecoder, | 93 &IsVideoDecoder, |
96 &Initialize, | 94 &Initialize, |
97 &Decode, | 95 &Decode, |
98 &AssignGLESBuffers, | 96 &AssignGLESBuffers, |
99 &ReusePictureBuffer, | 97 &ReusePictureBuffer, |
100 &Flush, | 98 &Flush, |
101 &Reset, | 99 &Reset, |
102 &Destroy | 100 &Destroy |
103 }; | 101 }; |
104 | 102 |
105 } // namespace | 103 } // namespace |
106 | 104 |
107 const PPB_VideoDecoder_Dev* GetPPB_VideoDecoder_Thunk() { | 105 const PPB_VideoDecoder_Dev* GetPPB_VideoDecoder_Thunk() { |
108 return &g_ppb_videodecoder_thunk; | 106 return &g_ppb_videodecoder_thunk; |
109 } | 107 } |
110 | 108 |
111 } // namespace thunk | 109 } // namespace thunk |
112 } // namespace ppapi | 110 } // namespace ppapi |
OLD | NEW |