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

RESOLVED FIXED in Firefox 59

Status

()

enhancement
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: jfkthame, Assigned: jfkthame)

Tracking

Trunk
mozilla59
Points:
---

Firefox Tracking Flags

(firefox59 fixed)

Details

Attachments

(2 attachments)

Assignee

Description

2 years ago
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

Updated

2 years ago
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Assignee

Comment 3

2 years ago
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.
Assignee

Updated

2 years ago
Blocks: 1424912
Attachment #8936435 - Flags: review?(m_kato) → review+
Attachment #8936436 - Flags: review?(m_kato) → review+

Comment 5

2 years ago
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

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/80ed22b2c35c
https://hg.mozilla.org/mozilla-central/rev/4c6d8b6d91b1
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59

Updated

2 years ago
No longer blocks: 1424912
Duplicate of this bug: 1424912
You need to log in before you can comment on or make changes to this bug.