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

Unified Diff: ppapi/shared_impl/tracked_callback.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 | « ppapi/shared_impl/tracked_callback.h ('k') | webkit/glue/webkit_glue.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/tracked_callback.cc
diff --git a/ppapi/shared_impl/tracked_callback.cc b/ppapi/shared_impl/tracked_callback.cc
index b36569d6de6c4a0f1f9113653fc8606e9913b6fc..a49f4ff942773737777851c549ba042509f5d270 100644
--- a/ppapi/shared_impl/tracked_callback.cc
+++ b/ppapi/shared_impl/tracked_callback.cc
@@ -73,6 +73,29 @@ void TrackedCallback::Run(int32_t result) {
}
}
+// static
+bool TrackedCallback::IsPending(
+ const scoped_refptr<TrackedCallback>& callback) {
+ if (!callback.get())
+ return false;
+ return !callback->completed();
+}
+
+// static
+void TrackedCallback::ClearAndRun(scoped_refptr<TrackedCallback>* callback,
+ int32_t result) {
+ scoped_refptr<TrackedCallback> temp;
+ temp.swap(*callback);
+ temp->Run(result);
+}
+
+// static
+void TrackedCallback::ClearAndAbort(scoped_refptr<TrackedCallback>* callback) {
+ scoped_refptr<TrackedCallback> temp;
+ temp.swap(*callback);
+ temp->Abort();
+}
+
void TrackedCallback::MarkAsCompleted() {
DCHECK(!completed());
« no previous file with comments | « ppapi/shared_impl/tracked_callback.h ('k') | webkit/glue/webkit_glue.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698