author | Boris Zbarsky <bzbarsky@mit.edu> |
Thu, 01 Mar 2018 14:24:17 -0500 | |
changeset 406273 | cb363ac1897a78d1d8c4cbd0b2f4b7636097547c |
parent 406272 | 9552b5f236a56a89edbe0625231502b3d8fe5bcd |
child 406274 | 0d9766eb6f0f77235b0184a5fbc41e1dfa1e2320 |
push id | 33551 |
push user | bzbarsky@mozilla.com |
push date | Fri, 02 Mar 2018 17:28:07 +0000 |
treeherder | mozilla-central@9caf14e0b300 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | bholley |
bugs | 1442313 |
milestone | 60.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
|
--- a/js/xpconnect/src/xpcpublic.h +++ b/js/xpconnect/src/xpcpublic.h @@ -672,20 +672,26 @@ AreNonLocalConnectionsDisabled() } } return disabledForTest; } inline bool IsInAutomation() { - const char* prefName = - "security.turn_off_all_security_so_that_viruses_can_take_over_this_computer"; - return mozilla::Preferences::GetBool(prefName) && - AreNonLocalConnectionsDisabled(); + static bool sAutomationPrefIsSet; + static bool sPrefCacheAdded = false; + if (!sPrefCacheAdded) { + mozilla::Preferences::AddBoolVarCache( + &sAutomationPrefIsSet, + "security.turn_off_all_security_so_that_viruses_can_take_over_this_computer", + false); + sPrefCacheAdded = true; + } + return sAutomationPrefIsSet && AreNonLocalConnectionsDisabled(); } void CreateCooperativeContext(); void DestroyCooperativeContext();