Enforce thread invoke policy for invokes to itself
Bug: None Change-Id: Ic4a80973bd0901f69c66ecabd3c135566f4ef247 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219629 Commit-Queue: Tommi <tommi@webrtc.org> Reviewed-by: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34119}
This commit is contained in:
parent
4fbc3fc59e
commit
157371643d
@ -103,11 +103,13 @@ ConnectionContext::ConnectionContext(
|
||||
signaling_thread_->AllowInvokesToThread(network_thread_);
|
||||
worker_thread_->AllowInvokesToThread(network_thread_);
|
||||
if (network_thread_->IsCurrent()) {
|
||||
network_thread_->DisallowAllInvokes();
|
||||
// TODO(https://crbug.com/webrtc/12802) switch to DisallowAllInvokes
|
||||
network_thread_->AllowInvokesToThread(network_thread_);
|
||||
} else {
|
||||
network_thread_->PostTask(ToQueuedTask([thread = network_thread_] {
|
||||
thread->DisallowBlockingCalls();
|
||||
thread->DisallowAllInvokes();
|
||||
// TODO(https://crbug.com/webrtc/12802) switch to DisallowAllInvokes
|
||||
thread->AllowInvokesToThread(thread);
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@ -929,6 +929,7 @@ void Thread::Send(const Location& posted_from,
|
||||
msg.pdata = pdata;
|
||||
if (IsCurrent()) {
|
||||
#if RTC_DCHECK_IS_ON
|
||||
RTC_DCHECK(this->IsInvokeToThreadAllowed(this));
|
||||
RTC_DCHECK_RUN_ON(this);
|
||||
could_be_blocking_call_count_++;
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user