Closed Bug 1488659 Opened 6 years ago Closed 6 years ago

Remove XPCOM registration of nsICharsetDetector

Categories

(Core :: Internationalization, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: hsivonen, Assigned: ehsan.akhgari)

References

(Blocks 1 open bug)

Details

(Whiteboard: [overhead:noted])

Attachments

(2 files)

nsICharsetDetector is only used from C++.
Whiteboard: [overhead:noted]
The XPCOM category seems to be unused to me...
(In reply to :Ehsan Akhgari from comment #1)
> Is this even possible given that this component is used in these categories?

It's possible. There are three implementation classes: Japanese, Russian and Ukrainian. There's one instantiation site: https://searchfox.org/mozilla-central/source/parser/html/nsHtml5StreamParser.cpp#209

All that's needed is exposing three constructors or factory methods and making the instantiation site check for three magic strings to decide which one to use.
Flags: needinfo?(hsivonen)
Assignee: nobody → ehsan
Flagging Jorg.K as c-c still has a reference to nsICharsetDetector:
https://dxr.mozilla.org/comm-central/rev/e5e1510b8d914bfa8439b21ba3f73e4f2e83e957/mailnews/base/util/nsMsgUtils.cpp#1941-1955

Please see here how to rewrite the code:
https://phabricator.services.mozilla.com/D5392#C122482NL203
Flags: needinfo?(jorgk)
Comment on attachment 9007652 [details]
Bug 1488659 - Part 1: Remove the XPCOM registrations for character detector classes; r=hsivonen

Henri Sivonen (:hsivonen) has approved the revision.
Attachment #9007652 - Flags: review+
Comment on attachment 9007653 [details]
Bug 1488659 - Part 2: Remove some dead code and mark the remaining detector classes as final; r=hsivonen

Henri Sivonen (:hsivonen) has approved the revision.
Attachment #9007653 - Flags: review+
Depends on: 1489949
(In reply to Masatoshi Kimura [:emk] from comment #6)
> Flagging Jorg.K as c-c still has a reference to nsICharsetDetector:
Thanks, I filed bug 1489949 for the C-C work. Awaiting the final version of the code here to copy/paste.
Flags: needinfo?(jorgk)
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d94ad30a3001
Part 1: Remove the XPCOM registrations for character detector classes; r=hsivonen
https://hg.mozilla.org/integration/mozilla-inbound/rev/68ad5bdca1ce
Part 2: Remove some dead code and mark the remaining detector classes as final; r=hsivonen
https://hg.mozilla.org/mozilla-central/rev/d94ad30a3001
https://hg.mozilla.org/mozilla-central/rev/68ad5bdca1ce
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: