Closed Bug 1874376 Opened 2 years ago Closed 2 years ago

Use latin-1 external string in XPCConvert with T_UTF8STRING is possible

Categories

(Core :: XPConnect, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox125 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(2 external files, 4 obsolete files)

similar to bug 1869687, but for UTF-8.
bug 1869726 will add xpc functions to convert UTF-8 string to external string if possible.
XPCConvert::NativeData2JS and XPCConvert::JSData2Native with nsXPTType::T_UTF8STRING can use them.

here's a result with prototype:

when starting up browser, there are:

  • 932 calls to NativeData2JS with T_UTF8STRING
    • 258 of them are nsStringBuffer with ASCII, and can use latin-1 external string (doesn't fit inline string)
      • total 28612 bytes of string data can be shared
    • 24 of them are literal string with ASCII, and can use latin-1 external string (doesn't fit inline string)
      • total 1837 bytes of string data can be shared
  • 2346 calls to JSData2Native with T_UTF8STRING
    • 38 of them are latin-1 external string created by the prototype
      • total 2941 bytes of string data can be shared

when opening YouTube top page after startup:

  • 676 calls to NativeData2JS with T_UTF8STRING
    • 609 of them are nsStringBuffer with ASCII, and can use latin-1 external string (doesn't fit inline string)
      • total 91696 bytes of string data can be shared
    • 1 of them are literal string with ASCII, and can use latin-1 external string (doesn't fit inline string)
      • total 145 bytes of string data can be shared
  • 1293 calls to JSData2Native with T_UTF8STRING
    • 7 of them are latin-1 external string created by the prototype
      • total 168 bytes of string data can be shared
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/798348b12f54 Use latin-1 external string in XPCConvert with T_UTF8STRING is possible. r=nika
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/3d4152f6f05d Use latin-1 external string in XPCConvert with T_UTF8STRING is possible. r=nika
Flags: needinfo?(arai.unmht)
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
Regressions: 1878862

backed out by bug 1878862 patch.
This needs to handle malformed UTF-8 string, by extending XPCStringConvert::UTF8ToJSVal.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Also backed out from 123 beta.

Status: REOPENED → ASSIGNED
Target Milestone: 123 Branch → ---
Depends on: 1879753
Attachment #9379884 - Attachment is obsolete: true
Attachment #9379883 - Attachment is obsolete: true
Attachment #9379885 - Attachment is obsolete: true
Attachment #9379886 - Attachment is obsolete: true
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/b778b4b9d36f Use latin-1 external string in XPCConvert with T_UTF8STRING is possible. r=nika
Status: ASSIGNED → RESOLVED
Closed: 2 years ago → 2 years ago
Closed: 2 years ago → 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: