Bug 1573720 - Convert dom.mapped_arraybuffer.enabled to a static pref. r=mccr8

Differential Revision: https://phabricator.services.mozilla.com/D41918

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicholas Nethercote 2019-08-15 05:31:10 +00:00
Родитель 735faa5294
Коммит e3f4932e1c
4 изменённых файлов: 7 добавлений и 22 удалений

Просмотреть файл

@ -2858,7 +2858,7 @@ nsresult XMLHttpRequestMainThread::SendInternal(const BodyExtractorBase* aBody,
mIsMappedArrayBuffer = false;
if (mResponseType == XMLHttpRequestResponseType::Arraybuffer &&
IsMappedArrayBufferEnabled()) {
StaticPrefs::dom_mapped_arraybuffer_enabled()) {
nsCOMPtr<nsIURI> uri;
nsAutoCString scheme;
@ -2954,20 +2954,6 @@ nsresult XMLHttpRequestMainThread::SendInternal(const BodyExtractorBase* aBody,
return rv;
}
/* static */
bool XMLHttpRequestMainThread::IsMappedArrayBufferEnabled() {
static bool sMappedArrayBufferAdded = false;
static bool sIsMappedArrayBufferEnabled;
if (!sMappedArrayBufferAdded) {
Preferences::AddBoolVarCache(&sIsMappedArrayBufferEnabled,
"dom.mapped_arraybuffer.enabled", true);
sMappedArrayBufferAdded = true;
}
return sIsMappedArrayBufferEnabled;
}
// http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-setrequestheader
void XMLHttpRequestMainThread::SetRequestHeader(const nsACString& aName,
const nsACString& aValue,

Просмотреть файл

@ -300,10 +300,6 @@ class XMLHttpRequestMainThread final : public XMLHttpRequest,
void UnsuppressEventHandlingAndResume();
// Check pref "dom.mapped_arraybuffer.enabled" to make sure ArrayBuffer is
// supported.
static bool IsMappedArrayBufferEnabled();
void MaybeLowerChannelPriority();
public:

Просмотреть файл

@ -1628,6 +1628,12 @@
value: false
mirror: always
# Enable mapped array buffer by default.
- name: dom.mapped_arraybuffer.enabled
type: bool
value: true
mirror: always
# This pref is used to enable/disable the `document.autoplayPolicy` API which
# returns a enum string which presents current autoplay policy and can change
# overtime based on user session activity.

Просмотреть файл

@ -5035,9 +5035,6 @@ pref("captivedetect.maxWaitingTime", 5000);
pref("captivedetect.pollingTime", 3000);
pref("captivedetect.maxRetryCount", 5);
// Enable mapped array buffer by default.
pref("dom.mapped_arraybuffer.enabled", true);
// The tables used for Safebrowsing phishing and malware checks
pref("urlclassifier.malwareTable", "goog-malware-proto,goog-unwanted-proto,moztest-harmful-simple,moztest-malware-simple,moztest-unwanted-simple");
#ifdef MOZILLA_OFFICIAL