mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 3566ba4296f7 because of wrong bug number.
--HG-- extra : rebase_source : c5d189308a555c7235d6cd405aa44d36c9b7db9a
This commit is contained in:
parent
36fae3dc88
commit
aac35871dd
@ -6677,14 +6677,6 @@ ConstructorEnabled(const nsGlobalNameStruct *aStruct, nsGlobalWindow *aWin)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't expose ArchiveReader unless user has explicitly enabled it
|
|
||||||
if (aStruct->mDOMClassInfoID == eDOMClassInfo_ArchiveReader_id ||
|
|
||||||
aStruct->mDOMClassInfoID == eDOMClassInfo_ArchiveRequest_id) {
|
|
||||||
if (!dom::file::ArchiveReader::PrefEnabled()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,8 +16,6 @@
|
|||||||
#include "nsIURI.h"
|
#include "nsIURI.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
|
|
||||||
#include "mozilla/Preferences.h"
|
|
||||||
|
|
||||||
USING_FILE_NAMESPACE
|
USING_FILE_NAMESPACE
|
||||||
|
|
||||||
ArchiveReader::ArchiveReader()
|
ArchiveReader::ArchiveReader()
|
||||||
@ -35,12 +33,6 @@ ArchiveReader::~ArchiveReader()
|
|||||||
nsLayoutStatics::Release();
|
nsLayoutStatics::Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
ArchiveReader::PrefEnabled()
|
|
||||||
{
|
|
||||||
return Preferences::GetBool("dom.archivereader.enabled", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
ArchiveReader::Initialize(nsISupports* aOwner,
|
ArchiveReader::Initialize(nsISupports* aOwner,
|
||||||
JSContext* aCx,
|
JSContext* aCx,
|
||||||
@ -50,10 +42,6 @@ ArchiveReader::Initialize(nsISupports* aOwner,
|
|||||||
{
|
{
|
||||||
NS_ENSURE_TRUE(aArgc == 1 || aArgc == 2, NS_ERROR_INVALID_ARG);
|
NS_ENSURE_TRUE(aArgc == 1 || aArgc == 2, NS_ERROR_INVALID_ARG);
|
||||||
|
|
||||||
if (!PrefEnabled()) {
|
|
||||||
return NS_ERROR_UNEXPECTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
// We expect to get a Blob object
|
// We expect to get a Blob object
|
||||||
if (!aArgv[0].isObject()) {
|
if (!aArgv[0].isObject()) {
|
||||||
return NS_ERROR_INVALID_ARG; // We're not interested
|
return NS_ERROR_INVALID_ARG; // We're not interested
|
||||||
|
@ -48,8 +48,6 @@ public:
|
|||||||
nsresult GetInputStream(nsIInputStream** aInputStream);
|
nsresult GetInputStream(nsIInputStream** aInputStream);
|
||||||
nsresult GetSize(uint64_t* aSize);
|
nsresult GetSize(uint64_t* aSize);
|
||||||
|
|
||||||
static bool PrefEnabled();
|
|
||||||
|
|
||||||
public: // for the ArchiveRequest:
|
public: // for the ArchiveRequest:
|
||||||
nsresult RegisterRequest(ArchiveRequest* aRequest);
|
nsresult RegisterRequest(ArchiveRequest* aRequest);
|
||||||
|
|
||||||
|
@ -13,14 +13,11 @@ var fileStorages = [
|
|||||||
|
|
||||||
var utils = SpecialPowers.getDOMWindowUtils(window);
|
var utils = SpecialPowers.getDOMWindowUtils(window);
|
||||||
|
|
||||||
var archiveReaderEnabled = false;
|
|
||||||
|
|
||||||
var testGenerator = testSteps();
|
var testGenerator = testSteps();
|
||||||
|
|
||||||
function runTest()
|
function runTest()
|
||||||
{
|
{
|
||||||
allowUnlimitedQuota();
|
allowUnlimitedQuota();
|
||||||
enableArchiveReader();
|
|
||||||
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
testGenerator.next();
|
testGenerator.next();
|
||||||
@ -29,7 +26,6 @@ function runTest()
|
|||||||
function finishTest()
|
function finishTest()
|
||||||
{
|
{
|
||||||
resetUnlimitedQuota();
|
resetUnlimitedQuota();
|
||||||
resetArchiveReader();
|
|
||||||
|
|
||||||
SimpleTest.executeSoon(function() {
|
SimpleTest.executeSoon(function() {
|
||||||
testGenerator.close();
|
testGenerator.close();
|
||||||
@ -102,17 +98,6 @@ function resetUnlimitedQuota(url)
|
|||||||
removePermission("indexedDB-unlimited", url);
|
removePermission("indexedDB-unlimited", url);
|
||||||
}
|
}
|
||||||
|
|
||||||
function enableArchiveReader()
|
|
||||||
{
|
|
||||||
archiveReaderEnabled = SpecialPowers.getBoolPref("dom.archivereader.enabled");
|
|
||||||
SpecialPowers.setBoolPref("dom.archivereader.enabled", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
function resetArchiveReader()
|
|
||||||
{
|
|
||||||
SpecialPowers.setBoolPref("dom.archivereader.enabled", archiveReaderEnabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getFileHandle(fileStorageKey, name)
|
function getFileHandle(fileStorageKey, name)
|
||||||
{
|
{
|
||||||
var requestService = SpecialPowers.getDOMRequestService();
|
var requestService = SpecialPowers.getDOMRequestService();
|
||||||
|
@ -8,8 +8,14 @@
|
|||||||
|
|
||||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||||
|
</head>
|
||||||
|
|
||||||
<script type="text/javascript;version=1.7">
|
<body>
|
||||||
|
<p id="display">
|
||||||
|
<input id="fileList" type="file"></input>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<script type="text/javascript;version=1.7">
|
||||||
function createZipFileWithData(fileData) {
|
function createZipFileWithData(fileData) {
|
||||||
var Cc = SpecialPowers.Cc;
|
var Cc = SpecialPowers.Cc;
|
||||||
var Ci = SpecialPowers.Ci;
|
var Ci = SpecialPowers.Ci;
|
||||||
@ -52,7 +58,7 @@
|
|||||||
function markTestDone() {
|
function markTestDone() {
|
||||||
++handleFinished;
|
++handleFinished;
|
||||||
if (isFinished()) {
|
if (isFinished()) {
|
||||||
finishTest();
|
SimpleTest.finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function isFinished() {
|
function isFinished() {
|
||||||
@ -245,17 +251,11 @@
|
|||||||
ok(false, "ArchiveReader.getFiles() should not return an 'error'");
|
ok(false, "ArchiveReader.getFiles() should not return an 'error'");
|
||||||
markTestDone();
|
markTestDone();
|
||||||
}
|
}
|
||||||
yield;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SimpleTest.waitForExplicitFinish();
|
||||||
|
testSteps();
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript;version=1.7" src="helpers.js"></script>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body onload="runTest();">
|
|
||||||
<p id="display">
|
|
||||||
<input id="fileList" type="file"></input>
|
|
||||||
</p>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
var testGenerator = testSteps();
|
var testGenerator = testSteps();
|
||||||
var archiveReaderEnabled = false;
|
|
||||||
|
|
||||||
// The test js is shared between xpcshell (which has no SpecialPowers object)
|
// The test js is shared between xpcshell (which has no SpecialPowers object)
|
||||||
// and content mochitests (where the |Components| object is accessible only as
|
// and content mochitests (where the |Components| object is accessible only as
|
||||||
@ -69,8 +68,6 @@ if (!window.runTest) {
|
|||||||
allowUnlimitedQuota();
|
allowUnlimitedQuota();
|
||||||
}
|
}
|
||||||
|
|
||||||
enableArchiveReader();
|
|
||||||
|
|
||||||
clearAllDatabases(function () { testGenerator.next(); });
|
clearAllDatabases(function () { testGenerator.next(); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -78,7 +75,6 @@ if (!window.runTest) {
|
|||||||
function finishTest()
|
function finishTest()
|
||||||
{
|
{
|
||||||
resetUnlimitedQuota();
|
resetUnlimitedQuota();
|
||||||
resetArchiveReader();
|
|
||||||
|
|
||||||
SimpleTest.executeSoon(function() {
|
SimpleTest.executeSoon(function() {
|
||||||
testGenerator.close();
|
testGenerator.close();
|
||||||
@ -167,12 +163,12 @@ function compareKeys(k1, k2) {
|
|||||||
if (!(k2 instanceof Array) ||
|
if (!(k2 instanceof Array) ||
|
||||||
k1.length != k2.length)
|
k1.length != k2.length)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (let i = 0; i < k1.length; ++i) {
|
for (let i = 0; i < k1.length; ++i) {
|
||||||
if (!compareKeys(k1[i], k2[i]))
|
if (!compareKeys(k1[i], k2[i]))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,17 +211,6 @@ function resetUnlimitedQuota(url)
|
|||||||
removePermission("indexedDB-unlimited", url);
|
removePermission("indexedDB-unlimited", url);
|
||||||
}
|
}
|
||||||
|
|
||||||
function enableArchiveReader()
|
|
||||||
{
|
|
||||||
archiveReaderEnabled = SpecialPowers.getBoolPref("dom.archivereader.enabled");
|
|
||||||
SpecialPowers.setBoolPref("dom.archivereader.enabled", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
function resetArchiveReader()
|
|
||||||
{
|
|
||||||
SpecialPowers.setBoolPref("dom.archivereader.enabled", archiveReaderEnabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
function gc()
|
function gc()
|
||||||
{
|
{
|
||||||
SpecialPowers.forceGC();
|
SpecialPowers.forceGC();
|
||||||
|
@ -207,6 +207,8 @@ var interfaceNamesInGlobalScope =
|
|||||||
"SVGAltGlyphElement",
|
"SVGAltGlyphElement",
|
||||||
"Screen",
|
"Screen",
|
||||||
"FileReader",
|
"FileReader",
|
||||||
|
"ArchiveReader",
|
||||||
|
"ArchiveRequest",
|
||||||
"SVGSwitchElement",
|
"SVGSwitchElement",
|
||||||
"SVGPolylineElement",
|
"SVGPolylineElement",
|
||||||
"SVGPathSegLinetoAbs",
|
"SVGPathSegLinetoAbs",
|
||||||
|
@ -1681,9 +1681,6 @@ pref("editor.positioning.offset", 0);
|
|||||||
pref("dom.max_chrome_script_run_time", 20);
|
pref("dom.max_chrome_script_run_time", 20);
|
||||||
pref("dom.max_script_run_time", 10);
|
pref("dom.max_script_run_time", 10);
|
||||||
|
|
||||||
// If true, ArchiveReader will be enabled
|
|
||||||
pref("dom.archivereader.enabled", false);
|
|
||||||
|
|
||||||
// Hang monitor timeout after which we kill the browser, in seconds
|
// Hang monitor timeout after which we kill the browser, in seconds
|
||||||
// (0 is disabled)
|
// (0 is disabled)
|
||||||
// Disabled on all platforms per bug 705748 until the found issues are
|
// Disabled on all platforms per bug 705748 until the found issues are
|
||||||
|
Loading…
Reference in New Issue
Block a user