summaryrefslogtreecommitdiffstats
path: root/dom/bindings/DOMString.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /dom/bindings/DOMString.h
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/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.h5
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);