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

Unified Diff: webrtc/base/bufferqueue.cc

Issue 1566023002: Fix bug 574524: DtlsTransportChannel crashes after SSL closes remotely (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: improve comments. Created 4 years, 11 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/base/bufferqueue.h ('k') | webrtc/base/opensslstreamadapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/bufferqueue.cc
diff --git a/webrtc/base/bufferqueue.cc b/webrtc/base/bufferqueue.cc
index 1ac57abc0cad425d132a0e1b5f69a438f13eab88..ce83e53f691a31f2822784f02b5e2e9ce5479c03 100644
--- a/webrtc/base/bufferqueue.cc
+++ b/webrtc/base/bufferqueue.cc
@@ -32,6 +32,14 @@ size_t BufferQueue::size() const {
return queue_.size();
}
+void BufferQueue::Clear() {
+ CritScope cs(&crit_);
+ while (!queue_.empty()) {
+ free_list_.push_back(queue_.front());
+ queue_.pop_front();
+ }
+}
+
bool BufferQueue::ReadFront(void* buffer, size_t bytes, size_t* bytes_read) {
CritScope cs(&crit_);
if (queue_.empty()) {
« no previous file with comments | « webrtc/base/bufferqueue.h ('k') | webrtc/base/opensslstreamadapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698