Chromium Code Reviews| Index: webrtc/api/peerconnection.cc |
| diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc |
| index ee359271c2fc2573b2f209d9af2c365ed6a5970c..336a3a356cfe338b9cfe79c0b5dbf0a421de010a 100644 |
| --- a/webrtc/api/peerconnection.cc |
| +++ b/webrtc/api/peerconnection.cc |
| @@ -32,10 +32,13 @@ |
| #include "webrtc/api/videosource.h" |
| #include "webrtc/api/videotrack.h" |
| #include "webrtc/base/arraysize.h" |
| +#include "webrtc/base/bind.h" |
| #include "webrtc/base/logging.h" |
| #include "webrtc/base/stringencode.h" |
| #include "webrtc/base/stringutils.h" |
| #include "webrtc/base/trace_event.h" |
| +#include "webrtc/call.h" |
| +#include "webrtc/call/rtc_event_log.h" |
| #include "webrtc/media/sctp/sctpdataengine.h" |
| #include "webrtc/p2p/client/basicportallocator.h" |
| #include "webrtc/pc/channelmanager.h" |
| @@ -2099,4 +2102,30 @@ DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { |
| return nullptr; |
| } |
| +bool PeerConnection::StartRtcEventLog(rtc::PlatformFile file) { |
|
the sun
2016/03/03 09:25:12
Nit: put methods in the order they are declared in
ivoc
2016/03/10 13:15:36
I moved them to a better place, but it's difficult
|
| + return factory_->worker_thread()->Invoke<bool>( |
| + rtc::Bind(&PeerConnection::StartRtcEventLog_w, this, file)); |
| +} |
| + |
| +void PeerConnection::StopRtcEventLog() { |
| + factory_->worker_thread()->Invoke<void>( |
| + rtc::Bind(&PeerConnection::StopRtcEventLog_w, this)); |
| +} |
| + |
| +bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file) { |
| + RTC_DCHECK(factory_->worker_thread()->IsCurrent()); |
| + webrtc::Call* call = media_controller_->call_w(); |
| + if (call) { |
|
the sun
2016/03/03 09:25:12
Shouldn't need this condition; add an RTC_DCHECK()
terelius
2016/03/10 10:42:32
I agree. The Call is created indirectly by CreateP
ivoc
2016/03/10 13:15:36
Good idea, done.
|
| + return call->RtcEventLog()->StartLogging(file); |
| + } |
| + return false; |
| +} |
| + |
| +void PeerConnection::StopRtcEventLog_w() { |
| + RTC_DCHECK(factory_->worker_thread()->IsCurrent()); |
| + webrtc::Call* call = media_controller_->call_w(); |
| + if (call) { |
| + call->RtcEventLog()->StopLogging(); |
| + } |
| +} |
| } // namespace webrtc |