Remove XPCOM registration of nsICharsetDetector

RESOLVED FIXED in Firefox 64

Status

()

RESOLVED FIXED
3 months ago
3 months ago

People

(Reporter: hsivonen, Assigned: Ehsan)

Tracking

(Blocks: 1 bug)

unspecified
mozilla64
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox64 fixed)

Details

(Whiteboard: [overhead:noted])

Attachments

(2 attachments)

(Reporter)

Description

3 months ago
nsICharsetDetector is only used from C++.
Whiteboard: [overhead:noted]
(Assignee)

Comment 2

3 months ago
The XPCOM category seems to be unused to me...
(Reporter)

Comment 3

3 months ago
(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)

Updated

3 months ago
Assignee: nobody → ehsan
(Assignee)

Comment 4

3 months ago
Created attachment 9007652 [details]
Bug 1488659 - Part 1: Remove the XPCOM registrations for character detector classes; r=hsivonen
(Assignee)

Comment 5

3 months ago
Created attachment 9007653 [details]
Bug 1488659 - Part 2: Remove some dead code and mark the remaining detector classes as final; r=hsivonen

Depends on D5392
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)
(Reporter)

Comment 7

3 months ago
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+
(Reporter)

Comment 8

3 months ago
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+

Updated

3 months ago
Depends on: 1489949

Comment 9

3 months ago
(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)

Comment 10

3 months ago
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

Comment 11

3 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/d94ad30a3001
https://hg.mozilla.org/mozilla-central/rev/68ad5bdca1ce
Status: NEW → RESOLVED
Last Resolved: 3 months ago
status-firefox64: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.