| Index: webrtc/pc/channel.cc
|
| diff --git a/webrtc/pc/channel.cc b/webrtc/pc/channel.cc
|
| index 7e4d5d2dac1e9596566fc591ef992519616f8594..9ef2a3b4ccc2e28fd97c46e7386f382dd5cb604e 100644
|
| --- a/webrtc/pc/channel.cc
|
| +++ b/webrtc/pc/channel.cc
|
| @@ -184,7 +184,8 @@ BaseChannel::~BaseChannel() {
|
| Deinit();
|
| StopConnectionMonitor();
|
| // Send any outstanding RTCP packets.
|
| - network_thread_->Invoke<void>(Bind(&BaseChannel::FlushRtcpMessages_n, this));
|
| + network_thread_->Invoke<void>(FROM_HERE,
|
| + Bind(&BaseChannel::FlushRtcpMessages_n, this));
|
| // Eats any outstanding messages or packets.
|
| worker_thread_->Clear(&invoker_);
|
| worker_thread_->Clear(this);
|
| @@ -194,7 +195,8 @@ BaseChannel::~BaseChannel() {
|
| delete media_channel_;
|
| // Note that we don't just call SetTransportChannel_n(nullptr) because that
|
| // would call a pure virtual method which we can't do from a destructor.
|
| - network_thread_->Invoke<void>(Bind(&BaseChannel::DeinitNetwork_n, this));
|
| + network_thread_->Invoke<void>(FROM_HERE,
|
| + Bind(&BaseChannel::DeinitNetwork_n, this));
|
| LOG(LS_INFO) << "Destroyed channel";
|
| }
|
|
|
| @@ -213,7 +215,8 @@ void BaseChannel::DeinitNetwork_n() {
|
| }
|
|
|
| bool BaseChannel::Init_w() {
|
| - if (!network_thread_->Invoke<bool>(Bind(&BaseChannel::InitNetwork_n, this))) {
|
| + if (!network_thread_->Invoke<bool>(FROM_HERE,
|
| + Bind(&BaseChannel::InitNetwork_n, this))) {
|
| return false;
|
| }
|
|
|
| @@ -247,7 +250,7 @@ void BaseChannel::Deinit() {
|
|
|
| bool BaseChannel::SetTransport(const std::string& transport_name) {
|
| return network_thread_->Invoke<bool>(
|
| - Bind(&BaseChannel::SetTransport_n, this, transport_name));
|
| + FROM_HERE, Bind(&BaseChannel::SetTransport_n, this, transport_name));
|
| }
|
|
|
| bool BaseChannel::SetTransport_n(const std::string& transport_name) {
|
| @@ -391,9 +394,10 @@ void BaseChannel::DisconnectFromTransportChannel(TransportChannel* tc) {
|
| }
|
|
|
| bool BaseChannel::Enable(bool enable) {
|
| - worker_thread_->Invoke<void>(Bind(
|
| - enable ? &BaseChannel::EnableMedia_w : &BaseChannel::DisableMedia_w,
|
| - this));
|
| + worker_thread_->Invoke<void>(
|
| + FROM_HERE,
|
| + Bind(enable ? &BaseChannel::EnableMedia_w : &BaseChannel::DisableMedia_w,
|
| + this));
|
| return true;
|
| }
|
|
|
| @@ -468,7 +472,7 @@ bool BaseChannel::IsReadyToSend_w() const {
|
| return enabled() && IsReceiveContentDirection(remote_content_direction_) &&
|
| IsSendContentDirection(local_content_direction_) &&
|
| network_thread_->Invoke<bool>(
|
| - Bind(&BaseChannel::IsTransportReadyToSend_n, this));
|
| + FROM_HERE, Bind(&BaseChannel::IsTransportReadyToSend_n, this));
|
| }
|
|
|
| bool BaseChannel::IsTransportReadyToSend_n() const {
|
| @@ -489,7 +493,7 @@ bool BaseChannel::SendRtcp(rtc::CopyOnWriteBuffer* packet,
|
| int BaseChannel::SetOption(SocketType type, rtc::Socket::Option opt,
|
| int value) {
|
| return network_thread_->Invoke<int>(
|
| - Bind(&BaseChannel::SetOption_n, this, type, opt, value));
|
| + FROM_HERE, Bind(&BaseChannel::SetOption_n, this, type, opt, value));
|
| }
|
|
|
| int BaseChannel::SetOption_n(SocketType type,
|
| @@ -570,8 +574,9 @@ void BaseChannel::OnSelectedCandidatePairChanged(
|
| last_sent_packet_id);
|
| }
|
| invoker_.AsyncInvoke<void>(
|
| - worker_thread_, Bind(&MediaChannel::OnNetworkRouteChanged, media_channel_,
|
| - transport_name, network_route));
|
| + FROM_HERE, worker_thread_,
|
| + Bind(&MediaChannel::OnNetworkRouteChanged, media_channel_, transport_name,
|
| + network_route));
|
| }
|
|
|
| void BaseChannel::SetReadyToSend(bool rtcp, bool ready) {
|
| @@ -588,7 +593,7 @@ void BaseChannel::SetReadyToSend(bool rtcp, bool ready) {
|
| (rtcp_ready_to_send_ || !rtcp_transport_channel_));
|
|
|
| invoker_.AsyncInvoke<void>(
|
| - worker_thread_,
|
| + FROM_HERE, worker_thread_,
|
| Bind(&MediaChannel::OnReadyToSend, media_channel_, ready_to_send));
|
| }
|
|
|
| @@ -614,7 +619,7 @@ bool BaseChannel::SendPacket(bool rtcp,
|
| SendPacketMessageData* data = new SendPacketMessageData;
|
| data->packet = std::move(*packet);
|
| data->options = options;
|
| - network_thread_->Post(this, message_id, data);
|
| + network_thread_->Post(FROM_HERE, this, message_id, data);
|
| return true;
|
| }
|
| TRACE_EVENT0("webrtc", "BaseChannel::SendPacket");
|
| @@ -749,7 +754,7 @@ void BaseChannel::HandlePacket(bool rtcp, rtc::CopyOnWriteBuffer* packet,
|
| // indicates the media has started flowing.
|
| if (!has_received_packet_ && !rtcp) {
|
| has_received_packet_ = true;
|
| - signaling_thread()->Post(this, MSG_FIRSTPACKETRECEIVED);
|
| + signaling_thread()->Post(FROM_HERE, this, MSG_FIRSTPACKETRECEIVED);
|
| }
|
|
|
| // Unprotect the packet, if needed.
|
| @@ -799,7 +804,7 @@ void BaseChannel::HandlePacket(bool rtcp, rtc::CopyOnWriteBuffer* packet,
|
| }
|
|
|
| invoker_.AsyncInvoke<void>(
|
| - worker_thread_,
|
| + FROM_HERE, worker_thread_,
|
| Bind(&BaseChannel::OnPacketReceived, this, rtcp, *packet, packet_time));
|
| }
|
|
|
| @@ -903,7 +908,7 @@ void BaseChannel::ChannelWritable_n() {
|
| void BaseChannel::SignalDtlsSetupFailure_n(bool rtcp) {
|
| RTC_DCHECK(network_thread_->IsCurrent());
|
| invoker_.AsyncInvoke<void>(
|
| - signaling_thread(),
|
| + FROM_HERE, signaling_thread(),
|
| Bind(&BaseChannel::SignalDtlsSetupFailure_s, this, rtcp));
|
| }
|
|
|
| @@ -1062,8 +1067,8 @@ bool BaseChannel::SetRtpTransportParameters(
|
|
|
| // Cache secure_required_ for belt and suspenders check on SendPacket
|
| return network_thread_->Invoke<bool>(
|
| - Bind(&BaseChannel::SetRtpTransportParameters_n, this, content, action,
|
| - src, error_desc));
|
| + FROM_HERE, Bind(&BaseChannel::SetRtpTransportParameters_n, this, content,
|
| + action, src, error_desc));
|
| }
|
|
|
| bool BaseChannel::SetRtpTransportParameters_n(
|
| @@ -1149,7 +1154,8 @@ bool BaseChannel::SetSrtp_n(const std::vector<CryptoParams>& cryptos,
|
| }
|
|
|
| void BaseChannel::ActivateRtcpMux() {
|
| - network_thread_->Invoke<void>(Bind(&BaseChannel::ActivateRtcpMux_n, this));
|
| + network_thread_->Invoke<void>(FROM_HERE,
|
| + Bind(&BaseChannel::ActivateRtcpMux_n, this));
|
| }
|
|
|
| void BaseChannel::ActivateRtcpMux_n() {
|
| @@ -1375,8 +1381,9 @@ void BaseChannel::MaybeCacheRtpAbsSendTimeHeaderExtension_w(
|
| int rtp_abs_sendtime_extn_id =
|
| send_time_extension ? send_time_extension->id : -1;
|
| invoker_.AsyncInvoke<void>(
|
| - network_thread_, Bind(&BaseChannel::CacheRtpAbsSendTimeHeaderExtension_n,
|
| - this, rtp_abs_sendtime_extn_id));
|
| + FROM_HERE, network_thread_,
|
| + Bind(&BaseChannel::CacheRtpAbsSendTimeHeaderExtension_n, this,
|
| + rtp_abs_sendtime_extn_id));
|
| #endif
|
| }
|
|
|
| @@ -1412,7 +1419,7 @@ void BaseChannel::FlushRtcpMessages_n() {
|
| rtc::MessageList rtcp_messages;
|
| network_thread_->Clear(this, MSG_SEND_RTCP_PACKET, &rtcp_messages);
|
| for (const auto& message : rtcp_messages) {
|
| - network_thread_->Send(this, MSG_SEND_RTCP_PACKET, message.pdata);
|
| + network_thread_->Send(FROM_HERE, this, MSG_SEND_RTCP_PACKET, message.pdata);
|
| }
|
| }
|
|
|
| @@ -1420,7 +1427,7 @@ void BaseChannel::SignalSentPacket_n(TransportChannel* /* channel */,
|
| const rtc::SentPacket& sent_packet) {
|
| RTC_DCHECK(network_thread_->IsCurrent());
|
| invoker_.AsyncInvoke<void>(
|
| - worker_thread_,
|
| + FROM_HERE, worker_thread_,
|
| rtc::Bind(&BaseChannel::SignalSentPacket_w, this, sent_packet));
|
| }
|
|
|
| @@ -1477,8 +1484,8 @@ bool VoiceChannel::SetAudioSend(uint32_t ssrc,
|
| void VoiceChannel::SetEarlyMedia(bool enable) {
|
| if (enable) {
|
| // Start the early media timeout
|
| - worker_thread()->PostDelayed(kEarlyMediaTimeout, this,
|
| - MSG_EARLYMEDIATIMEOUT);
|
| + worker_thread()->PostDelayed(FROM_HERE, kEarlyMediaTimeout, this,
|
| + MSG_EARLYMEDIATIMEOUT);
|
| } else {
|
| // Stop the timeout if currently going.
|
| worker_thread()->Clear(this, MSG_EARLYMEDIATIMEOUT);
|
| @@ -1513,7 +1520,7 @@ void VoiceChannel::SetRawAudioSink(
|
|
|
| webrtc::RtpParameters VoiceChannel::GetRtpParameters(uint32_t ssrc) const {
|
| return worker_thread()->Invoke<webrtc::RtpParameters>(
|
| - Bind(&VoiceChannel::GetRtpParameters_w, this, ssrc));
|
| + FROM_HERE, Bind(&VoiceChannel::GetRtpParameters_w, this, ssrc));
|
| }
|
|
|
| webrtc::RtpParameters VoiceChannel::GetRtpParameters_w(uint32_t ssrc) const {
|
| @@ -1597,7 +1604,7 @@ void VoiceChannel::OnChannelRead(TransportChannel* channel,
|
|
|
| void BaseChannel::ChangeState() {
|
| RTC_DCHECK(network_thread_->IsCurrent());
|
| - invoker_.AsyncInvoke<void>(worker_thread_,
|
| + invoker_.AsyncInvoke<void>(FROM_HERE, worker_thread_,
|
| Bind(&BaseChannel::ChangeState_w, this));
|
| }
|
|
|
| @@ -1802,16 +1809,16 @@ VideoChannel::~VideoChannel() {
|
|
|
| bool VideoChannel::SetSink(uint32_t ssrc,
|
| rtc::VideoSinkInterface<VideoFrame>* sink) {
|
| - worker_thread()->Invoke<void>(
|
| - Bind(&VideoMediaChannel::SetSink, media_channel(), ssrc, sink));
|
| + worker_thread()->Invoke<void>(FROM_HERE, Bind(&VideoMediaChannel::SetSink,
|
| + media_channel(), ssrc, sink));
|
| return true;
|
| }
|
|
|
| void VideoChannel::SetSource(
|
| uint32_t ssrc,
|
| rtc::VideoSourceInterface<cricket::VideoFrame>* source) {
|
| - worker_thread()->Invoke<void>(
|
| - Bind(&VideoMediaChannel::SetSource, media_channel(), ssrc, source));
|
| + worker_thread()->Invoke<void>(FROM_HERE, Bind(&VideoMediaChannel::SetSource,
|
| + media_channel(), ssrc, source));
|
| }
|
|
|
| bool VideoChannel::SetVideoSend(uint32_t ssrc,
|
| @@ -1823,7 +1830,7 @@ bool VideoChannel::SetVideoSend(uint32_t ssrc,
|
|
|
| webrtc::RtpParameters VideoChannel::GetRtpParameters(uint32_t ssrc) const {
|
| return worker_thread()->Invoke<webrtc::RtpParameters>(
|
| - Bind(&VideoChannel::GetRtpParameters_w, this, ssrc));
|
| + FROM_HERE, Bind(&VideoChannel::GetRtpParameters_w, this, ssrc));
|
| }
|
|
|
| webrtc::RtpParameters VideoChannel::GetRtpParameters_w(uint32_t ssrc) const {
|
| @@ -2297,21 +2304,21 @@ void DataChannel::OnDataReceived(
|
| const ReceiveDataParams& params, const char* data, size_t len) {
|
| DataReceivedMessageData* msg = new DataReceivedMessageData(
|
| params, data, len);
|
| - signaling_thread()->Post(this, MSG_DATARECEIVED, msg);
|
| + signaling_thread()->Post(FROM_HERE, this, MSG_DATARECEIVED, msg);
|
| }
|
|
|
| void DataChannel::OnDataChannelError(uint32_t ssrc,
|
| DataMediaChannel::Error err) {
|
| DataChannelErrorMessageData* data = new DataChannelErrorMessageData(
|
| ssrc, err);
|
| - signaling_thread()->Post(this, MSG_CHANNEL_ERROR, data);
|
| + signaling_thread()->Post(FROM_HERE, this, MSG_CHANNEL_ERROR, data);
|
| }
|
|
|
| void DataChannel::OnDataChannelReadyToSend(bool writable) {
|
| // This is usded for congestion control to indicate that the stream is ready
|
| // to send by the MediaChannel, as opposed to OnReadyToSend, which indicates
|
| // that the transport channel is ready.
|
| - signaling_thread()->Post(this, MSG_READYTOSENDDATA,
|
| + signaling_thread()->Post(FROM_HERE, this, MSG_READYTOSENDDATA,
|
| new DataChannelReadyToSendMessageData(writable));
|
| }
|
|
|
| @@ -2326,7 +2333,7 @@ bool DataChannel::ShouldSetupDtlsSrtp_n() const {
|
| void DataChannel::OnStreamClosedRemotely(uint32_t sid) {
|
| rtc::TypedMessageData<uint32_t>* message =
|
| new rtc::TypedMessageData<uint32_t>(sid);
|
| - signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message);
|
| + signaling_thread()->Post(FROM_HERE, this, MSG_STREAMCLOSEDREMOTELY, message);
|
| }
|
|
|
| } // namespace cricket
|
|
|