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

Unified Diff: webrtc/base/asyncinvoker.cc

Issue 2871403003: Delete unused features of AsyncInvoke. (Closed)
Patch Set: Rebased. Created 3 years, 7 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
Index: webrtc/base/asyncinvoker.cc
diff --git a/webrtc/base/asyncinvoker.cc b/webrtc/base/asyncinvoker.cc
index cabd8b506d0575ee3e3b41a479f6f7b9fcf63ee8..bfd13172f70329598dc9393d41eb660f8877e8f7 100644
--- a/webrtc/base/asyncinvoker.cc
+++ b/webrtc/base/asyncinvoker.cc
@@ -116,39 +116,4 @@ AsyncClosure::~AsyncClosure() {
invoker_->invocation_complete_.Set();
}
-NotifyingAsyncClosureBase::NotifyingAsyncClosureBase(
- AsyncInvoker* invoker,
- const Location& callback_posted_from,
- Thread* calling_thread)
- : AsyncClosure(invoker),
- callback_posted_from_(callback_posted_from),
- calling_thread_(calling_thread) {
- calling_thread->SignalQueueDestroyed.connect(
- this, &NotifyingAsyncClosureBase::CancelCallback);
- // Note: We don't need to listen for the invoker being destroyed, because it
- // will wait for this closure to be destroyed (and pending_invocations_ to go
- // to 0) before its destructor completes.
-}
-
-NotifyingAsyncClosureBase::~NotifyingAsyncClosureBase() {
- disconnect_all();
-}
-
-void NotifyingAsyncClosureBase::TriggerCallback() {
- CritScope cs(&crit_);
- if (!CallbackCanceled() && !callback_.empty()) {
- invoker_->AsyncInvoke<void>(callback_posted_from_, calling_thread_,
- callback_);
- }
-}
-
-void NotifyingAsyncClosureBase::CancelCallback() {
- // If the callback is triggering when this is called, block the
- // destructor of the dying object here by waiting until the callback
- // is done triggering.
- CritScope cs(&crit_);
- // calling_thread_ == nullptr means do not trigger the callback.
- calling_thread_ = nullptr;
-}
-
} // namespace rtc

Powered by Google App Engine
This is Rietveld 408576698