summaryrefslogtreecommitdiff
path: root/message_buffer.h
diff options
context:
space:
mode:
authormukesh agrawal <quiche@google.com>2016-09-21 15:19:38 -0700
committermukesh agrawal <quiche@google.com>2016-09-27 10:26:39 -0700
commit0e465b480b9067a9795139a0aa1f4144d10c485e (patch)
tree7356af152ec1a8281bf2cc6a4eb538964e8d2862 /message_buffer.h
parent5f88ee735e1cf0c12f96c3add65d798ec58ad4bd (diff)
downloadwifilogd-0e465b480b9067a9795139a0aa1f4144d10c485e.tar.gz
MessageBuffer: add CanFitEver()
The CanFitEver() method will be used to determine whether the MessageBuffer can host an incoming message, or if the incoming message requires compression. Bug: 31653003 Test: ./runtests.sh (on bullhead) Change-Id: If09ae5bc6c7c80a71e490e945187bd6fc25529b1
Diffstat (limited to 'message_buffer.h')
-rw-r--r--message_buffer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/message_buffer.h b/message_buffer.h
index 6058813..1a1932b 100644
--- a/message_buffer.h
+++ b/message_buffer.h
@@ -39,6 +39,10 @@ class MessageBuffer {
// true if the message was added to the buffer.
bool Append(NONNULL const uint8_t* data, uint16_t data_len);
+ // Returns true if the buffer is large enough to hold |length| bytes of user
+ // data, when the buffer is empty.
+ bool CanFitEver(uint16_t length) const;
+
// Returns true if the buffer currently has enough free space to hold |length|
// bytes of user data.
bool CanFitNow(uint16_t length) const;