Open
Bug 1408793
Opened 7 years ago
Updated 2 years ago
Encapsulate SetStringBuffer() and AsAString().Assign() in DOMString::SetString
Categories
(Core :: DOM: Bindings (WebIDL), enhancement, P3)
Core
DOM: Bindings (WebIDL)
Tracking
()
NEW
Tracking | Status | |
---|---|---|
firefox58 | --- | affected |
People
(Reporter: n.nethercote, Unassigned)
Details
DOMString has functions SetOwnedString() and SetOwnedAtom(). It should probably also have SetOwnedEphemeralString(), which would encapsulate the SetEphemeralStringBuffer() and AsAString().Assign() combination.
Comment 1•7 years ago
|
||
What is EphemeralString?
Updated•7 years ago
|
Priority: -- → P3
Reporter | ||
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
So the idea would be to have a SetEphemeralString, which does what the code in XMLHttpRequestStringBuffer::GetAsString is doing right now, yes?
I really hate the naming on these functions, by the way; I am open to ideas on how to change them. The basic point is that we have some Set* calls that are passed a thing that is guaranteed to outlive the DOMString (and hence the DOMString does not need to keep it alive), and others are passed a thing that is _not_ guaranteed to live long enough, so the DOMString needs to copy or addref or something.
Comment 4•7 years ago
|
||
Could we use the word Dependent there, like we use with DependentString?
I guess SetStringBuffer would be SetDependentStringBuffer and SetEphemeralStringBuffer would be just
SetStringBuffer? And should SetOwnedString be SetDependentString.
SetOwnedString has a bit weird behavior, and I can blame myself about that.
I think the cases when DOMString may not own the string data, should be clearly named so.
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Comment 5•5 years ago
|
||
OK, a bunch of the naming stuff got sorted out in bug 1407858. Resummarizing accordingly.
One complication: the one consumer I know of here wants to do a fallible assignment to the nsString, because it can have large chunks of data.
Component: DOM: Core & HTML → DOM: Bindings (WebIDL)
Summary: Encapsulate SetEphemeralStringBuffer() and AsAString().Assign() → Encapsulate SetStringBuffer() and AsAString().Assign() in DOMString::SetString
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•