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

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

Issue 10081020: PPAPI: Make blocking completion callbacks work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated TestURLLoader to test blocking callbacks. Created 8 years, 8 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
Index: webkit/plugins/ppapi/ppb_flash_menu_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_flash_menu_impl.cc b/webkit/plugins/ppapi/ppb_flash_menu_impl.cc
index aa3f768398763bce105da4383e9a85d3543d0d7d..97fe3dba89d8fe9e08379642e24d6b742599f893 100644
--- a/webkit/plugins/ppapi/ppb_flash_menu_impl.cc
+++ b/webkit/plugins/ppapi/ppb_flash_menu_impl.cc
@@ -14,6 +14,7 @@
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
#include "webkit/plugins/ppapi/resource_helper.h"
+using ppapi::ApiCallbackType;
using ppapi::thunk::PPB_Flash_Menu_API;
using ppapi::TrackedCallback;
@@ -130,15 +131,12 @@ PPB_Flash_Menu_API* PPB_Flash_Menu_Impl::AsPPB_Flash_Menu_API() {
int32_t PPB_Flash_Menu_Impl::Show(const PP_Point* location,
int32_t* selected_id_out,
- PP_CompletionCallback callback) {
+ ApiCallbackType callback) {
// |location| is not (currently) optional.
// TODO(viettrungluu): Make it optional and default to the current mouse pos?
if (!location)
return PP_ERROR_BADARGUMENT;
- if (!callback.func)
- return PP_ERROR_BLOCKS_MAIN_THREAD;
-
if (TrackedCallback::IsPending(callback_))
return PP_ERROR_INPROGRESS;
@@ -150,16 +148,13 @@ int32_t PPB_Flash_Menu_Impl::Show(const PP_Point* location,
plugin_instance, this, gfx::Point(location->x, location->y));
if (rv == PP_OK_COMPLETIONPENDING) {
// Record callback and output buffers.
- callback_ = new TrackedCallback(this, callback);
+ callback_ = callback;
selected_id_out_ = selected_id_out;
} else {
// This should never be completed synchronously successfully.
DCHECK_NE(rv, PP_OK);
}
return rv;
-
- NOTIMPLEMENTED();
- return PP_ERROR_FAILED;
}
void PPB_Flash_Menu_Impl::CompleteShow(int32_t result,

Powered by Google App Engine
This is Rietveld 408576698