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

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: Rebase Created 3 years, 7 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..b7d02726bb90d7981872a416e69ab746cf2076e2 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,7 +38,7 @@ RtcEventLogHelperThread::RtcEventLogHelperThread(
SwapQueue<std::unique_ptr<rtclog::Event>>* event_queue)
: message_queue_(message_queue),
event_queue_(event_queue),
- history_(kEventsInHistory),
+ history_(),
tommi 2017/06/01 21:29:43 Nit: might as well just remove from the list
config_history_(),
file_(FileWrapper::Create()),
thread_(&ThreadOutputFunction, this, "RtcEventLog thread"),
@@ -120,6 +120,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