forked from mirrors/gecko-dev
Bug 1951017 - Dispatch nsRFPService::MaybeReportFontFingerprinter() to the main thread. a=pascalc
Original Revision: https://phabricator.services.mozilla.com/D240306 Differential Revision: https://phabricator.services.mozilla.com/D241048
This commit is contained in:
parent
1c991445bc
commit
3298ef52f1
2 changed files with 16 additions and 2 deletions
|
|
@ -1823,11 +1823,25 @@ static void MaybeCurrentCaller(nsACString& aFilename, uint32_t& aLineNum,
|
|||
}
|
||||
|
||||
/* static */ void nsRFPService::MaybeReportFontFingerprinter(
|
||||
nsIChannel* aChannel, nsACString& aOriginNoSuffix) {
|
||||
nsIChannel* aChannel, const nsACString& aOriginNoSuffix) {
|
||||
if (!aChannel) {
|
||||
return;
|
||||
}
|
||||
|
||||
// The logging of the event will access nsLoadGroup which is main-thread only.
|
||||
// So we need to dispatch the task to the main thread if we are reporting
|
||||
// the event off-main-thread.
|
||||
if (!NS_IsMainThread()) {
|
||||
NS_DispatchToMainThread(NS_NewRunnableFunction(
|
||||
"nsRFPService::MaybeReportFontFingerprinter",
|
||||
[channel = nsCOMPtr{aChannel},
|
||||
originNoSuffix = nsCString(aOriginNoSuffix)]() {
|
||||
nsRFPService::MaybeReportFontFingerprinter(channel, originNoSuffix);
|
||||
}));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (MOZ_LOG_TEST(gFingerprinterDetection, LogLevel::Info)) {
|
||||
nsAutoCString filename;
|
||||
uint32_t lineNum = 0;
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ class nsRFPService final : public nsIObserver, public nsIRFPService {
|
|||
nsACString& aOriginNoSuffix);
|
||||
|
||||
static void MaybeReportFontFingerprinter(nsIChannel* aChannel,
|
||||
nsACString& aOriginNoSuffix);
|
||||
const nsACString& aOriginNoSuffix);
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue