Chromium Code Reviews| Index: chrome/browser/media/cast_transport_host_filter.cc |
| diff --git a/chrome/browser/media/cast_transport_host_filter.cc b/chrome/browser/media/cast_transport_host_filter.cc |
| index 393090f80a2ab8747900aa7f4bc4d19edccd723c..59e113fd3ec578bc1d71fd1693e08249576e2a71 100644 |
| --- a/chrome/browser/media/cast_transport_host_filter.cc |
| +++ b/chrome/browser/media/cast_transport_host_filter.cc |
| @@ -8,6 +8,13 @@ |
| #include "chrome/browser/net/chrome_net_log.h" |
| #include "media/cast/transport/cast_transport_sender.h" |
| +namespace { |
| + |
| +// How often to send raw events. |
| +const int kSendRawEventsIntervalSecs = 1; |
| + |
| +} |
| + |
| namespace cast { |
| CastTransportHostFilter::CastTransportHostFilter() |
| @@ -61,9 +68,17 @@ void CastTransportHostFilter::ReceivedRtpStatistics( |
| rtp_timestamp)); |
| } |
| +void CastTransportHostFilter::RawEvents( |
| + int32 channel_id, |
| + const std::vector<media::cast::PacketEvent>& packet_events) { |
| + if (!packet_events.empty()) |
| + Send(new CastMsg_RawEvents(channel_id, packet_events)); |
| +} |
| + |
| void CastTransportHostFilter::OnNew( |
| int32 channel_id, |
| - const media::cast::transport::CastTransportConfig& config) { |
| + const media::cast::transport::CastTransportConfig& config, |
| + const media::cast::CastLoggingConfig& logging_config) { |
| media::cast::transport::CastTransportSender* sender = |
| id_map_.Lookup(channel_id); |
| if (sender) { |
| @@ -75,9 +90,14 @@ void CastTransportHostFilter::OnNew( |
| g_browser_process->net_log(), |
| &clock_, |
| config, |
| + logging_config, |
| base::Bind(&CastTransportHostFilter::NotifyStatusChange, |
| base::Unretained(this), |
|
dcheng
2014/02/27 22:27:20
Why is it OK to use base::Unretained(this)? Would
imcheng
2014/02/28 00:15:06
I did not write this code originally but from look
|
| channel_id), |
| + base::Bind(&CastTransportHostFilter::RawEvents, |
| + base::Unretained(this), |
| + channel_id), |
| + base::TimeDelta::FromSeconds(kSendRawEventsIntervalSecs), |
| base::MessageLoopProxy::current()); |
| sender->SetPacketReceiver( |
| base::Bind(&CastTransportHostFilter::ReceivedPacket, |