diff --git a/dom/xhr/XMLHttpRequestMainThread.cpp b/dom/xhr/XMLHttpRequestMainThread.cpp index aa97f8b0b51e..ec4212aa501e 100644 --- a/dom/xhr/XMLHttpRequestMainThread.cpp +++ b/dom/xhr/XMLHttpRequestMainThread.cpp @@ -2858,7 +2858,7 @@ nsresult XMLHttpRequestMainThread::SendInternal(const BodyExtractorBase* aBody, mIsMappedArrayBuffer = false; if (mResponseType == XMLHttpRequestResponseType::Arraybuffer && - IsMappedArrayBufferEnabled()) { + StaticPrefs::dom_mapped_arraybuffer_enabled()) { nsCOMPtr 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, diff --git a/dom/xhr/XMLHttpRequestMainThread.h b/dom/xhr/XMLHttpRequestMainThread.h index 2a3f6ae9250c..0b6581f7b466 100644 --- a/dom/xhr/XMLHttpRequestMainThread.h +++ b/dom/xhr/XMLHttpRequestMainThread.h @@ -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: diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 5c75336efea3..2dacd59b8d48 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -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. diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 80373b3783a3..c8066ebd751f 100755 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -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