Closed Bug 1943262 Opened 11 months ago Closed 11 months ago

Refactor instantiation of nsEffectiveTLDService

Categories

(Core :: Networking: DNS, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
136 Branch
Tracking Status
firefox136 --- fixed

People

(Reporter: leplatrem, Assigned: valentin)

References

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

In Bug 1786310 we added a safety check around the service destructor.

The service gets instantiated and destroyed in different places, and as Valentin pointed out in https://bugzilla.mozilla.org/show_bug.cgi?id=1786310#c16

The component definition is marked as singletong but refers the constructor - which definitely won't return the same object for every call.

https://searchfox.org/mozilla-central/rev/9a66d18cb35595c89f499a1011c9dd7e573fce77/netwerk/build/components.conf#151-154

'singleton': True,
'type': 'nsEffectiveTLDService',
'headers': ['/netwerk/dns/nsEffectiveTLDService.h'],
'init_method': 'Init',

There seems to be some possible improvements and clean-up around the instantiation of this service.

This ensures that the instantiation of the service always returns the
same singleton. I also changed calls to nsEffectiveTLDService::GetInstance
to use mozilla::components::EffectiveTLD::Service() instead.

Assignee: nobody → valentin.gosu
Status: NEW → ASSIGNED
Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged]
Pushed by valentin.gosu@gmail.com: https://hg.mozilla.org/integration/autoland/rev/b233889facbe Refactor instantiation of nsEffectiveTLDService r=cookie-reviewers,anti-tracking-reviewers,permissions-reviewers,emz
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: