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

Unified Diff: webkit/plugins/ppapi/ppb_graphics_2d_impl.h

Issue 9015013: Convert callers to use the new TrackedCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Foo 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 | « webkit/plugins/ppapi/ppb_audio_input_impl.cc ('k') | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_graphics_2d_impl.h
diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.h b/webkit/plugins/ppapi/ppb_graphics_2d_impl.h
index 2cce83b371dc5fe902fb97f66325218ce272deae..bfe530d1c223d1d8dfb1fd3222fe21e8200af259 100644
--- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.h
+++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.h
@@ -12,6 +12,7 @@
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/ppb_graphics_2d.h"
#include "ppapi/shared_impl/resource.h"
+#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/ppb_graphics_2d_api.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCanvas.h"
@@ -83,26 +84,29 @@ class PPB_Graphics2D_Impl : public ::ppapi::Resource,
Clear();
}
- explicit FlushCallbackData(const PP_CompletionCallback& callback) {
+ explicit FlushCallbackData(
+ scoped_refptr< ::ppapi::TrackedCallback> callback) {
Set(callback);
}
- bool is_null() const { return !callback_.func; }
+ bool is_null() const {
+ return !::ppapi::TrackedCallback::IsPending(callback_);
+ }
- void Set(const PP_CompletionCallback& callback) {
+ void Set(scoped_refptr< ::ppapi::TrackedCallback> callback) {
callback_ = callback;
}
void Clear() {
- callback_ = PP_MakeCompletionCallback(NULL, 0);
+ callback_ = NULL;
}
void Execute(int32_t result) {
- PP_RunAndClearCompletionCallback(&callback_, result);
+ ::ppapi::TrackedCallback::ClearAndRun(&callback_, result);
}
private:
- PP_CompletionCallback callback_;
+ scoped_refptr< ::ppapi::TrackedCallback> callback_;
};
// Called internally to execute the different queued commands. The
« no previous file with comments | « webkit/plugins/ppapi/ppb_audio_input_impl.cc ('k') | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698