summaryrefslogtreecommitdiff
path: root/core/fxcrt/widestring.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-04-16 21:09:57 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-16 21:09:57 +0000
commit0d32b8fda53e02c1036d39f7290d4f59f2b58ca4 (patch)
tree820ea3b95c5ef566ea6c6c11fd6f113f0f895e70 /core/fxcrt/widestring.h
parent574ee81e426a7390e5cdf28f2fe8ec03f6c2da98 (diff)
downloadpdfium-0d32b8fda53e02c1036d39f7290d4f59f2b58ca4.tar.xz
Revert "Return pdfium::span<wchar_t> from WideString::GetBuffer()."
This reverts commit 154e18f9a862975abecebe77b8f5fb418418d14c. Reason for revert: Generate CL to merge to beta branch Original change's description: > Return pdfium::span<wchar_t> from WideString::GetBuffer(). > > Adds bounds checking "for free", but beware of span outliving > a ReleaseBuffer() call. Scoping as such avoids the possibility > of using an invalid span (and it is flagged as a lifetime issue). > > Change-Id: Ica63f4b1429823d0254ec6951aeaeb08160cb93c > Reviewed-on: https://pdfium-review.googlesource.com/30310 > Reviewed-by: dsinclair <dsinclair@chromium.org> > Commit-Queue: Tom Sepez <tsepez@chromium.org> TBR=tsepez@chromium.org,dsinclair@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: Ie1ec9434215584a024538ca8edeb59dea555af48 Reviewed-on: https://pdfium-review.googlesource.com/30830 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcrt/widestring.h')
-rw-r--r--core/fxcrt/widestring.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/core/fxcrt/widestring.h b/core/fxcrt/widestring.h
index b668b0292c..cefdfabcd0 100644
--- a/core/fxcrt/widestring.h
+++ b/core/fxcrt/widestring.h
@@ -17,7 +17,7 @@
#include "core/fxcrt/string_data_template.h"
#include "core/fxcrt/string_view_template.h"
#include "third_party/base/optional.h"
-#include "third_party/base/span.h"
+
namespace fxcrt {
@@ -171,10 +171,7 @@ class WideString {
void TrimRight(const WideStringView& targets);
void Reserve(size_t len);
-
- // Note: any modification of the string (including ReleaseBuffer()) may
- // invalidate the span, which must not outlive its buffer.
- pdfium::span<wchar_t> GetBuffer(size_t len);
+ wchar_t* GetBuffer(size_t len);
void ReleaseBuffer(size_t len);
int GetInteger() const;