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

Unified Diff: webrtc/base/asyncinvoker.h

Issue 1173353002: Remove all glue interfaces and use existing webrtc interfaces (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 6 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 | « no previous file | webrtc/base/asyncinvoker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/asyncinvoker.h
diff --git a/webrtc/base/asyncinvoker.h b/webrtc/base/asyncinvoker.h
index 6e298e60cc66e251e4e500a9e97bd5a92bfe7325..fe1506d99f8688ca53f92d6f7b3da401dbe84107 100644
--- a/webrtc/base/asyncinvoker.h
+++ b/webrtc/base/asyncinvoker.h
@@ -82,6 +82,18 @@ class AsyncInvoker : public MessageHandler {
DoInvoke(thread, closure, id);
}
+ // Call |functor| asynchronously on |thread| with |delay_ms|, with no callback
+ // upon completion. Returns immediately.
+ template <class ReturnT, class FunctorT>
+ void AsyncInvokeDelayed(Thread* thread,
+ const FunctorT& functor,
+ uint32 delay_ms,
+ uint32 id = 0) {
+ scoped_refptr<AsyncClosure> closure(
+ new RefCountedObject<FireAndForgetAsyncClosure<FunctorT> >(functor));
+ DoInvokeDelayed(thread, closure, delay_ms, id);
+ }
+
// Call |functor| asynchronously on |thread|, calling |callback| when done.
template <class ReturnT, class FunctorT, class HostT>
void AsyncInvoke(Thread* thread,
@@ -123,7 +135,10 @@ class AsyncInvoker : public MessageHandler {
void OnMessage(Message* msg) override;
void DoInvoke(Thread* thread, const scoped_refptr<AsyncClosure>& closure,
uint32 id);
-
+ void DoInvokeDelayed(Thread* thread,
+ const scoped_refptr<AsyncClosure>& closure,
+ uint32 delay_ms,
+ uint32 id);
bool destroying_;
DISALLOW_COPY_AND_ASSIGN(AsyncInvoker);
« no previous file with comments | « no previous file | webrtc/base/asyncinvoker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698