Replace RingBuffer by std::deque in RtcEventLog.
BUG=webrtc:7732 Review-Url: https://codereview.webrtc.org/2875823003 Cr-Commit-Position: refs/heads/master@{#18447}
This commit is contained in:
@ -38,8 +38,6 @@ RtcEventLogHelperThread::RtcEventLogHelperThread(
|
||||
SwapQueue<std::unique_ptr<rtclog::Event>>* event_queue)
|
||||
: message_queue_(message_queue),
|
||||
event_queue_(event_queue),
|
||||
history_(kEventsInHistory),
|
||||
config_history_(),
|
||||
file_(FileWrapper::Create()),
|
||||
thread_(&ThreadOutputFunction, this, "RtcEventLog thread"),
|
||||
max_size_bytes_(std::numeric_limits<int64_t>::max()),
|
||||
@ -47,8 +45,6 @@ RtcEventLogHelperThread::RtcEventLogHelperThread(
|
||||
start_time_(0),
|
||||
stop_time_(std::numeric_limits<int64_t>::max()),
|
||||
has_recent_event_(false),
|
||||
most_recent_event_(),
|
||||
output_string_(),
|
||||
wake_periodically_(false, false),
|
||||
wake_from_hibernation_(false, false),
|
||||
file_finished_(false, false) {
|
||||
@ -120,6 +116,8 @@ bool RtcEventLogHelperThread::LogToMemory() {
|
||||
config_history_.push_back(std::move(most_recent_event_));
|
||||
} else {
|
||||
history_.push_back(std::move(most_recent_event_));
|
||||
if (history_.size() > kEventsInHistory)
|
||||
history_.pop_front();
|
||||
}
|
||||
has_recent_event_ = event_queue_->Remove(&most_recent_event_);
|
||||
message_received = true;
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#ifndef WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_HELPER_THREAD_H_
|
||||
#define WEBRTC_LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_HELPER_THREAD_H_
|
||||
|
||||
#include <deque>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
@ -95,7 +96,7 @@ class RtcEventLogHelperThread final {
|
||||
SwapQueue<std::unique_ptr<rtclog::Event>>* event_queue_;
|
||||
|
||||
// History containing the most recent events (~ 10 s).
|
||||
RingBuffer<std::unique_ptr<rtclog::Event>> history_;
|
||||
std::deque<std::unique_ptr<rtclog::Event>> history_;
|
||||
|
||||
// History containing all past configuration events.
|
||||
std::vector<std::unique_ptr<rtclog::Event>> config_history_;
|
||||
|
||||
Reference in New Issue
Block a user