Closed Bug 1591514 Opened 6 years ago Closed 6 years ago

Improve support for literals on FakeString

Categories

(Core :: DOM: Bindings (WebIDL), task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(2 files)

We could flag ourselves with DataFlags::Literal when we know we have a literal. And we can make the bindings code nicer in the process too. For example, this:

    static const char16_t data[] = { 0 };
    mName.Rebind(data, ArrayLength(data) - 1);

becomes:

    mName.AssignLiteral(u"");

in the generated code.

Priority: -- → P1

Also removes some unused API bits to make the number of entry points smaller
and safer.

    mName.AssignLiteral(u"");

I guess we could also try to special-case the empty-string common case to just call Truncate...

Depends on: 1591481
Depends on: 1591491
Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/eed1acc4c779 part 1. Change bindings to use actual literal strings for string constants. r=mccr8 https://hg.mozilla.org/integration/autoland/rev/e91fee31774b part 2. Add assertions to FakeString that its mData is only initialized once and not used before initialization. r=mccr8
Blocks: 1592771
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: