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

Unified Diff: webrtc/base/buffer.h

Issue 2290343002: Added an empty() method to rtc::Buffer (Closed)
Patch Set: Added IsConsistent() check Created 4 years, 4 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 | « no previous file | webrtc/base/buffer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/buffer.h
diff --git a/webrtc/base/buffer.h b/webrtc/base/buffer.h
index 545ddb2be7cc91df5b2b695948d1610abe9fe331..e9f7cfac1058828ce555e528b9dc601daae876ec 100644
--- a/webrtc/base/buffer.h
+++ b/webrtc/base/buffer.h
@@ -124,6 +124,11 @@ class BufferT {
return reinterpret_cast<U*>(data_.get());
}
+ bool empty() const {
+ RTC_DCHECK(IsConsistent());
+ return size_ == 0;
+ }
+
size_t size() const {
RTC_DCHECK(IsConsistent());
return size_;
« no previous file with comments | « no previous file | webrtc/base/buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698