Closed Bug 1424898 Opened 7 years ago Closed 6 years ago

nsILineBreaker and nsIWordBreaker don't need to be COM services or have virtual methods

Categories

(Core :: Internationalization, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

Details

Attachments

(2 files)

In theory, I guess there was an intention to support dropping in replacement implementations of the nsILineBreaker and nsIWordBreaker services, but we've never actually done that. And if/when we do extend these (e.g. to support language-dependent breaking, bug 203016), the way to do that will be by passing a locale or other "options" argument, not by implementing a separate service.

Accordingly, we can just make these simple concrete interfaces that client code calls directly, eliminating the virtual methods that we currently use.

(At present, the line- and word-breakers don't actually maintain any state, and don't really need to be objects at all; their instance methods could just as well  be static functions. But I propose to maintain their object-ness here, in anticipation of upcoming API changes that will introduce actual state to these classes.)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Assuming we do this, it will also impact a couple of places in comm-central code that use the existing interfaces and will need to be updated. I'll file a separate c-c bug for that.
Blocks: 1424912
Attachment #8936435 - Flags: review?(m_kato) → review+
Attachment #8936436 - Flags: review?(m_kato) → review+
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/80ed22b2c35c
patch 1 - De-virtualize nsILineBreaker and rename to mozilla::intl::LineBreaker. r=m_kato
https://hg.mozilla.org/integration/mozilla-inbound/rev/4c6d8b6d91b1
patch 2 - De-virtualize nsIWordBreaker and rename to mozilla::intl::WordBreaker. r=m_kato
https://hg.mozilla.org/mozilla-central/rev/80ed22b2c35c
https://hg.mozilla.org/mozilla-central/rev/4c6d8b6d91b1
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
No longer blocks: 1424912
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: