summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_bytestring.h
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-08-01 16:20:40 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-01 20:42:42 +0000
commit0186c1817bd1503051597dbcf0b032d4ff1277ab (patch)
treed6fa77d9a14936838de8a54756dc2c27eed85bfe /core/fxcrt/cfx_bytestring.h
parentda129ab38c3fb6ed3de85ffb6f8938eb31130a53 (diff)
downloadpdfium-0186c1817bd1503051597dbcf0b032d4ff1277ab.tar.xz
Remove support for negative params to ReleaseBuffer()
This CL removes the default param value for this method, which was negative. It also adds in a method to get buffer lengths, so that the callsites can explictly passing in the length of the buffer if they were using the default value previously. BUG=pdfium:828 Change-Id: I0170771ee81970b8b601631015ab3e6e39fea8ea Reviewed-on: https://pdfium-review.googlesource.com/9790 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcrt/cfx_bytestring.h')
-rw-r--r--core/fxcrt/cfx_bytestring.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/fxcrt/cfx_bytestring.h b/core/fxcrt/cfx_bytestring.h
index 519cee39d4..8bd9f39fc0 100644
--- a/core/fxcrt/cfx_bytestring.h
+++ b/core/fxcrt/cfx_bytestring.h
@@ -79,6 +79,9 @@ class CFX_ByteString {
}
FX_STRSIZE GetLength() const { return m_pData ? m_pData->m_nDataLength : 0; }
+ FX_STRSIZE GetStringLength() const {
+ return m_pData ? FXSYS_strlen(m_pData->m_String) : 0;
+ }
bool IsEmpty() const { return !GetLength(); }
int Compare(const CFX_ByteStringC& str) const;
@@ -122,7 +125,7 @@ class CFX_ByteString {
void Reserve(FX_STRSIZE len);
char* GetBuffer(FX_STRSIZE len);
- void ReleaseBuffer(FX_STRSIZE len = -1);
+ void ReleaseBuffer(FX_STRSIZE len);
CFX_ByteString Mid(FX_STRSIZE first, FX_STRSIZE count) const;
CFX_ByteString Left(FX_STRSIZE count) const;