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

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

Issue 9015009: Use the new callback tracker and delete the old one (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add IsPending Created 8 years, 12 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_flash_net_connector_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 895aa4d958d09132b17f0ee45d3480a8b2d1bac1..6c181d097f506f90d8b2be5551a94c85e4114e69 100644
--- a/webkit/plugins/ppapi/ppb_flash_menu_impl.cc
+++ b/webkit/plugins/ppapi/ppb_flash_menu_impl.cc
@@ -14,7 +14,8 @@
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
#include "webkit/plugins/ppapi/resource_helper.h"
-using ::ppapi::thunk::PPB_Flash_Menu_API;
+using ppapi::thunk::PPB_Flash_Menu_API;
+using ppapi::TrackedCallback;
namespace webkit {
namespace ppapi {
@@ -138,7 +139,7 @@ int32_t PPB_Flash_Menu_Impl::Show(const PP_Point* location,
if (!callback.func)
return PP_ERROR_BLOCKS_MAIN_THREAD;
- if (callback_.get() && !callback_->completed())
+ if (TrackedCallback::IsPending(callback_))
return PP_ERROR_INPROGRESS;
PluginInstance* plugin_instance = ResourceHelper::GetPluginInstance(this);
@@ -149,9 +150,7 @@ 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 TrackedCompletionCallback(
- plugin_instance->module()->GetCallbackTracker(),
- pp_resource(), callback);
+ callback_ = new TrackedCallback(this, callback);
selected_id_out_ = selected_id_out;
} else {
// This should never be completed synchronously successfully.
@@ -182,11 +181,8 @@ void PPB_Flash_Menu_Impl::CompleteShow(int32_t result,
}
}
- scoped_refptr<TrackedCompletionCallback> callback;
- callback.swap(callback_);
selected_id_out_ = NULL;
-
- callback->Run(rv); // Will complete abortively if necessary.
+ TrackedCallback::ClearAndRun(&callback_, rv);
}
} // namespace ppapi
« no previous file with comments | « webkit/plugins/ppapi/ppb_flash_menu_impl.h ('k') | webkit/plugins/ppapi/ppb_flash_net_connector_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698