Backed out changeset 3566ba4296f7 because of wrong bug number.

--HG--
extra : rebase_source : c5d189308a555c7235d6cd405aa44d36c9b7db9a
This commit is contained in:
Mounir Lamouri 2012-11-08 15:56:48 +00:00
parent 36fae3dc88
commit aac35871dd
8 changed files with 14 additions and 67 deletions

View File

@ -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;
}

View File

@ -16,8 +16,6 @@
#include "nsIURI.h"
#include "nsNetUtil.h"
#include "mozilla/Preferences.h"
USING_FILE_NAMESPACE
ArchiveReader::ArchiveReader()
@ -35,12 +33,6 @@ ArchiveReader::~ArchiveReader()
nsLayoutStatics::Release();
}
bool
ArchiveReader::PrefEnabled()
{
return Preferences::GetBool("dom.archivereader.enabled", true);
}
NS_IMETHODIMP
ArchiveReader::Initialize(nsISupports* aOwner,
JSContext* aCx,
@ -50,10 +42,6 @@ ArchiveReader::Initialize(nsISupports* aOwner,
{
NS_ENSURE_TRUE(aArgc == 1 || aArgc == 2, NS_ERROR_INVALID_ARG);
if (!PrefEnabled()) {
return NS_ERROR_UNEXPECTED;
}
// We expect to get a Blob object
if (!aArgv[0].isObject()) {
return NS_ERROR_INVALID_ARG; // We're not interested

View File

@ -48,8 +48,6 @@ public:
nsresult GetInputStream(nsIInputStream** aInputStream);
nsresult GetSize(uint64_t* aSize);
static bool PrefEnabled();
public: // for the ArchiveRequest:
nsresult RegisterRequest(ArchiveRequest* aRequest);

View File

@ -13,14 +13,11 @@ var fileStorages = [
var utils = SpecialPowers.getDOMWindowUtils(window);
var archiveReaderEnabled = false;
var testGenerator = testSteps();
function runTest()
{
allowUnlimitedQuota();
enableArchiveReader();
SimpleTest.waitForExplicitFinish();
testGenerator.next();
@ -29,7 +26,6 @@ function runTest()
function finishTest()
{
resetUnlimitedQuota();
resetArchiveReader();
SimpleTest.executeSoon(function() {
testGenerator.close();
@ -102,17 +98,6 @@ function resetUnlimitedQuota(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)
{
var requestService = SpecialPowers.getDOMRequestService();

View File

@ -8,8 +8,14 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<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) {
var Cc = SpecialPowers.Cc;
var Ci = SpecialPowers.Ci;
@ -52,7 +58,7 @@
function markTestDone() {
++handleFinished;
if (isFinished()) {
finishTest();
SimpleTest.finish();
}
}
function isFinished() {
@ -245,17 +251,11 @@
ok(false, "ArchiveReader.getFiles() should not return an 'error'");
markTestDone();
}
yield;
}
SimpleTest.waitForExplicitFinish();
testSteps();
</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>
</html>

View File

@ -4,7 +4,6 @@
*/
var testGenerator = testSteps();
var archiveReaderEnabled = false;
// The test js is shared between xpcshell (which has no SpecialPowers object)
// and content mochitests (where the |Components| object is accessible only as
@ -69,8 +68,6 @@ if (!window.runTest) {
allowUnlimitedQuota();
}
enableArchiveReader();
clearAllDatabases(function () { testGenerator.next(); });
}
}
@ -78,7 +75,6 @@ if (!window.runTest) {
function finishTest()
{
resetUnlimitedQuota();
resetArchiveReader();
SimpleTest.executeSoon(function() {
testGenerator.close();
@ -167,12 +163,12 @@ function compareKeys(k1, k2) {
if (!(k2 instanceof Array) ||
k1.length != k2.length)
return false;
for (let i = 0; i < k1.length; ++i) {
if (!compareKeys(k1[i], k2[i]))
return false;
}
return true;
}
@ -215,17 +211,6 @@ function resetUnlimitedQuota(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()
{
SpecialPowers.forceGC();

View File

@ -207,6 +207,8 @@ var interfaceNamesInGlobalScope =
"SVGAltGlyphElement",
"Screen",
"FileReader",
"ArchiveReader",
"ArchiveRequest",
"SVGSwitchElement",
"SVGPolylineElement",
"SVGPathSegLinetoAbs",

View File

@ -1681,9 +1681,6 @@ pref("editor.positioning.offset", 0);
pref("dom.max_chrome_script_run_time", 20);
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
// (0 is disabled)
// Disabled on all platforms per bug 705748 until the found issues are