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:
@ -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() {
|
||||
|
Reference in New Issue
Block a user