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

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: Address comments Created 9 years 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: ppapi/shared_impl/tracked_callback.cc
diff --git a/ppapi/shared_impl/tracked_callback.cc b/ppapi/shared_impl/tracked_callback.cc
index b36569d6de6c4a0f1f9113653fc8606e9913b6fc..bee4578f88d42f2f08faee9acabe285ab4739d1d 100644
--- a/ppapi/shared_impl/tracked_callback.cc
+++ b/ppapi/shared_impl/tracked_callback.cc
@@ -73,6 +73,21 @@ void TrackedCallback::Run(int32_t result) {
}
}
+// 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());

Powered by Google App Engine
This is Rietveld 408576698