diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /dom/bindings/DOMString.h | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/bindings/DOMString.h')
-rw-r--r-- | dom/bindings/DOMString.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/dom/bindings/DOMString.h b/dom/bindings/DOMString.h index c5404f5351..e87d820777 100644 --- a/dom/bindings/DOMString.h +++ b/dom/bindings/DOMString.h @@ -169,8 +169,7 @@ class MOZ_STACK_CLASS DOMString { if (MOZ_UNLIKELY(aString.IsVoid())) { SetNull(); } else if (!aString.IsEmpty()) { - nsStringBuffer* buf = nsStringBuffer::FromString(aString); - if (buf) { + if (nsStringBuffer* buf = aString.GetStringBuffer()) { SetKnownLiveStringBuffer(buf, aString.Length()); } else if (aString.IsLiteral()) { SetLiteralInternal(aString.BeginReading(), aString.Length()); @@ -236,7 +235,7 @@ class MOZ_STACK_CLASS DOMString { auto chars = static_cast<char16_t*>(buf->Data()); if (chars[len] == '\0') { // Safe to share the buffer. - buf->ToString(len, aString); + aString.Assign(buf, len); } else { // We need to copy, unfortunately. aString.Assign(chars, len); |