Bug 1637869 - P4. Access pref via staticpref. r=mattwoodrow,necko-reviewers
☠☠ backed out by 128a2c474755 ☠ ☠
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 22 May 2020 04:12:42 +0000
changeset 531633 a0c0203ee8c91f6897f5c1d1435d6d7ee7b1c5a8
parent 531632 75359ba23865c590d0a84b94a0073ba548c3962e
child 531634 0c7f55b96d599ccdf605abd903ed3b6a62187ae3
push id37441
push userapavel@mozilla.com
push dateFri, 22 May 2020 21:38:53 +0000
treeherdermozilla-central@d6abd35b54ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, necko-reviewers
bugs1637869
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1637869 - P4. Access pref via staticpref. r=mattwoodrow,necko-reviewers It would otherwise triggers browser/base/content/test/performance/browser_preferences_usage.js That pref would have been checked with every single load, a staticpref is O-1 . Differential Revision: https://phabricator.services.mozilla.com/D76317
docshell/base/nsDocShell.cpp
modules/libpref/init/StaticPrefList.yaml
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -8998,17 +8998,17 @@ bool nsDocShell::CanLoadInParentProcess(
   // Allow ext+foo URIs (extension-registered custom protocols). See
   // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/protocol_handlers
   if (StringBeginsWith(scheme, NS_LITERAL_CSTRING("ext+")) &&
       !StaticPrefs::extensions_webextensions_remote()) {
     return true;
   }
   // Final exception for some legacy automated tests:
   if (xpc::IsInAutomation() &&
-      Preferences::GetBool("security.allow_unsafe_parent_loads", false)) {
+      StaticPrefs::security_allow_unsafe_parent_loads()) {
     return true;
   }
   return false;
 }
 
 nsIPrincipal* nsDocShell::GetInheritedPrincipal(
     bool aConsiderCurrentDocument, bool aConsiderStoragePrincipal) {
   RefPtr<Document> document;
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -8404,16 +8404,23 @@
 
 # Allowed by default so it doesn't affect Thunderbird/SeaMonkey, but
 # not allowed for Firefox Desktop in firefox.js
 - name: security.allow_eval_in_parent_process
   type: RelaxedAtomicBool
   value: true
   mirror: always
 
+# Disallowed by default, ensure not disallowed content is loaded in the parent
+# process.
+- name: security.allow_unsafe_parent_loads
+  type: bool
+  value: false
+  mirror: always
+
 # Pref to block mixed scripts (fonts, plugin content, scripts, stylesheets,
 # iframes, websockets, XHR).
 - name: security.mixed_content.block_active_content
   type: bool
   value: @IS_ANDROID@
   mirror: always
 
 # Pref to block sub requests that happen within an object.