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

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: export AssertLockHeld Created 8 years, 6 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 | « webkit/plugins/ppapi/ppb_flash_menu_impl.h ('k') | webkit/plugins/ppapi/ppb_graphics_2d_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e0c405e86f7ad34ae796c13f95b8286a35963b8c 100644
--- a/webkit/plugins/ppapi/ppb_flash_menu_impl.cc
+++ b/webkit/plugins/ppapi/ppb_flash_menu_impl.cc
@@ -130,15 +130,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) {
+ scoped_refptr<TrackedCallback> 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 +147,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,
« no previous file with comments | « webkit/plugins/ppapi/ppb_flash_menu_impl.h ('k') | webkit/plugins/ppapi/ppb_graphics_2d_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698