Chromium Code Reviews

Unified Diff: webrtc/pc/channel.cc

Issue 1967193002: ThreadScope concept to check variable accessed on correct thread (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: generalized ThreadScope Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « webrtc/pc/channel.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/channel.cc
diff --git a/webrtc/pc/channel.cc b/webrtc/pc/channel.cc
index 7e4d5d2dac1e9596566fc591ef992519616f8594..656ff269cfd316a73c39a14dbba2308951461fde 100644
--- a/webrtc/pc/channel.cc
+++ b/webrtc/pc/channel.cc
@@ -20,6 +20,7 @@
#include "webrtc/base/dscp.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/networkroute.h"
+#include "webrtc/base/thread_scope.h"
#include "webrtc/base/trace_event.h"
#include "webrtc/media/base/mediaconstants.h"
#include "webrtc/media/base/rtputils.h"
@@ -199,6 +200,8 @@ BaseChannel::~BaseChannel() {
}
void BaseChannel::DeinitNetwork_n() {
+ RTC_DCHECK_RUN_ON(network_thread_);
+
if (transport_channel_) {
DisconnectFromTransportChannel(transport_channel_);
transport_controller_->DestroyTransportChannel_n(
@@ -251,7 +254,7 @@ bool BaseChannel::SetTransport(const std::string& transport_name) {
}
bool BaseChannel::SetTransport_n(const std::string& transport_name) {
- RTC_DCHECK(network_thread_->IsCurrent());
+ RTC_DCHECK_RUN_ON(network_thread_);
if (transport_name == transport_name_) {
// Nothing to do if transport name isn't changing
@@ -300,8 +303,6 @@ bool BaseChannel::SetTransport_n(const std::string& transport_name) {
}
void BaseChannel::SetTransportChannel_n(TransportChannel* new_tc) {
- RTC_DCHECK(network_thread_->IsCurrent());
-
TransportChannel* old_tc = transport_channel_;
if (!old_tc && !new_tc) {
// Nothing to do
@@ -332,7 +333,7 @@ void BaseChannel::SetTransportChannel_n(TransportChannel* new_tc) {
void BaseChannel::SetRtcpTransportChannel_n(TransportChannel* new_tc,
bool update_writablity) {
- RTC_DCHECK(network_thread_->IsCurrent());
+ RTC_DCHECK_RUN_ON(network_thread_);
TransportChannel* old_tc = rtcp_transport_channel_;
if (!old_tc && !new_tc) {
« no previous file with comments | « webrtc/pc/channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine