Add AsyncInvoker::Clear method to allow canceling pending invocations

Change-Id: I85707c0980cdfb64acbb61ff8b6245e8da509db8
Bug: webrtc:8823
Reviewed-on: https://webrtc-review.googlesource.com/46801
Commit-Queue: Chris Dziemborowicz <chrisdz@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21835}
diff --git a/rtc_base/asyncinvoker.cc b/rtc_base/asyncinvoker.cc
index 7f65dfc..7033c1a 100644
--- a/rtc_base/asyncinvoker.cc
+++ b/rtc_base/asyncinvoker.cc
@@ -67,6 +67,10 @@
   }
 }
 
+void AsyncInvoker::Clear() {
+  MessageQueueManager::Clear(this);
+}
+
 void AsyncInvoker::DoInvoke(const Location& posted_from,
                             Thread* thread,
                             std::unique_ptr<AsyncClosure> closure,