0

Fix CPU overuse caused by WebRTC event logs not being batched

Use batches of 5 seconds instead of immediate log emission.
(An upcoming CL should make this configurable from JS.)

Bug: 910576
Change-Id: Ib2b804e1e8c7798b744548fb343776fa8a315a65
Reviewed-on: https://chromium-review.googlesource.com/c/1356800
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Commit-Queue: Elad Alon <eladalon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612663}
This commit is contained in:
Elad Alon
2018-11-30 16:04:33 +00:00
committed by Commit Bot
parent b14651e72d
commit de9c922fc0

@ -1848,13 +1848,14 @@ void RTCPeerConnectionHandler::StartEventLog(IPC::PlatformFileForTransit file,
void RTCPeerConnectionHandler::StartEventLog() {
DCHECK(task_runner_->RunsTasksInCurrentSequence());
constexpr int64_t kOutputPeriodMs = 5000;
// TODO(eladalon): StartRtcEventLog() return value is not useful; remove it
// or find a way to be able to use it.
// https://crbug.com/775415
native_peer_connection_->StartRtcEventLog(
std::make_unique<RtcEventLogOutputSinkProxy>(
peer_connection_observer_.get()),
webrtc::RtcEventLog::kImmediateOutput);
kOutputPeriodMs);
}
void RTCPeerConnectionHandler::StopEventLog() {