Bug 1834274 - Part 1: Implement nsIRFPService.idl for nsRFPService. r=emilio

To allow remote settings client to set fingerprinting overrides from
Javascript, we need to implement nsIRFPService for nsRFPService.

This patch changes the return format of nsRFPService::GetOrCreate() to
match the singleton implementation of nsIRFPService. As a result of it,
we need to change the first init call in nsContentUtils because we
cannot forward a already_AddRefed<> to mozilla::Unused. It will cause a
memory leak.

Differential Revision: https://phabricator.services.mozilla.com/D182809
This commit is contained in:
Tim Huang
2023-09-27 14:58:25 +00:00
parent d7ab65e6d6
commit a1849d963f
7 changed files with 53 additions and 6 deletions

View File

@@ -825,7 +825,8 @@ nsresult nsContentUtils::Init() {
Element::InitCCCallbacks();
Unused << nsRFPService::GetOrCreate();
RefPtr<nsRFPService> rfpService = nsRFPService::GetOrCreate();
MOZ_ASSERT(rfpService);
if (XRE_IsParentProcess()) {
AsyncPrecreateStringBundles();