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

Unified Diff: webrtc/logging/rtc_event_log/rtc_event_log_helper_thread.cc

Issue 2875823003: Replace RingBuffer by std::deque in RtcEventLog. (Closed)
Patch Set: Remove default-constructed members from constructor. Created 3 years, 6 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/logging/rtc_event_log/rtc_event_log_helper_thread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/logging/rtc_event_log/rtc_event_log_helper_thread.cc
diff --git a/webrtc/logging/rtc_event_log/rtc_event_log_helper_thread.cc b/webrtc/logging/rtc_event_log/rtc_event_log_helper_thread.cc
index 04186a7c581d1550bbc8b80c139969f85e7df74a..cdc30f9c36db469a85e320439654a20f69646142 100644
--- a/webrtc/logging/rtc_event_log/rtc_event_log_helper_thread.cc
+++ b/webrtc/logging/rtc_event_log/rtc_event_log_helper_thread.cc
@@ -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;
« no previous file with comments | « webrtc/logging/rtc_event_log/rtc_event_log_helper_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698