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

Depends on D71939

Differential Revision: https://phabricator.services.mozilla.com/D71940
This commit is contained in:
Tim Huang
2020-04-22 14:33:08 +00:00
parent 4b3d366122
commit c2a8d0ac85
7 changed files with 17 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();