Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Unified Diff: webrtc/api/peerconnection.cc

Issue 2353033005: Refactoring: move ownership of RtcEventLog from Call to PeerConnection (Closed)
Patch Set: Moved the constructor Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/peerconnection.h ('k') | webrtc/api/peerconnectionfactory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnection.cc
diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc
index 7cc5d00a30f5f55ab0da0067a7d952a6801b2ca3..dd99e36b3dc2bdd28f78e3ae10568388c8803ce3 100644
--- a/webrtc/api/peerconnection.cc
+++ b/webrtc/api/peerconnection.cc
@@ -37,8 +37,10 @@
#include "webrtc/base/stringutils.h"
#include "webrtc/base/trace_event.h"
#include "webrtc/call.h"
+#include "webrtc/logging/rtc_event_log/rtc_event_log.h"
#include "webrtc/media/sctp/sctpdataengine.h"
#include "webrtc/pc/channelmanager.h"
+#include "webrtc/system_wrappers/include/clock.h"
#include "webrtc/system_wrappers/include/field_trial.h"
namespace {
@@ -571,6 +573,7 @@ PeerConnection::PeerConnection(PeerConnectionFactory* factory)
ice_state_(kIceNew),
ice_connection_state_(kIceConnectionNew),
ice_gathering_state_(kIceGatheringNew),
+ event_log_(RtcEventLog::Create(webrtc::Clock::GetRealTimeClock())),
rtcp_cname_(GenerateRtcpCname()),
local_streams_(StreamCollection::Create()),
remote_streams_(StreamCollection::Create()) {}
@@ -619,8 +622,8 @@ bool PeerConnection::Initialize(
return false;
}
- media_controller_.reset(
- factory_->CreateMediaController(configuration.media_config));
+ media_controller_.reset(factory_->CreateMediaController(
+ configuration.media_config, event_log_.get()));
session_.reset(new WebRtcSession(
media_controller_.get(), factory_->network_thread(),
@@ -2343,10 +2346,10 @@ bool PeerConnection::ReconfigurePortAllocator_n(
bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file,
int64_t max_size_bytes) {
- return media_controller_->call_w()->StartEventLog(file, max_size_bytes);
+ return event_log_->StartLogging(file, max_size_bytes);
}
void PeerConnection::StopRtcEventLog_w() {
- media_controller_->call_w()->StopEventLog();
+ event_log_->StopLogging();
}
} // namespace webrtc
« no previous file with comments | « webrtc/api/peerconnection.h ('k') | webrtc/api/peerconnectionfactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698