diff options
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); |