Bug 1608516 - Part 3: Add a pref to prevent sending unnecessary IPC if we are not in testing. r=baku

Differential Revision: https://phabricator.services.mozilla.com/D71940
This commit is contained in:
Tim Huang
2020-04-22 22:22:09 +00:00
parent 2bb3adbba9
commit 96bb2e2aca
8 changed files with 19 additions and 0 deletions

View File

@@ -5994,6 +5994,13 @@ nsresult nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
UrlClassifierFeatureFactory::IsClassifierBlockingErrorCode(aStatus)) {
UnblockEmbedderLoadEventForFailure();
// We don't really need to add the blocked node if we are not testing.
// This could save a IPC here.
if (!StaticPrefs::
privacy_trackingprotection_testing_report_blocked_node()) {
return NS_OK;
}
RefPtr<BrowsingContext> bc = GetBrowsingContext();
RefPtr<BrowsingContext> parentBC = bc->GetParent();