Backed out changesets 992c504934d3 and 5832c2042614 (bug 1086684) for LSAN leaks.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2015-03-20 17:06:27 -04:00
parent 119b851bd1
commit 9130168404
6 changed files with 6 additions and 157 deletions

View File

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 sw=2 sts=2 et tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -1692,11 +1691,12 @@ HTMLInputElement::GetValueInternal(nsAString& aValue) const
case VALUE_MODE_FILENAME:
if (nsContentUtils::IsCallerChrome()) {
#ifndef MOZ_CHILD_PERMISSIONS
aValue.Assign(mFirstFilePath);
#else
MOZ_ASSERT_UNREACHABLE("This doesn't happen with a sane security model");
#endif
if (!mFiles.IsEmpty()) {
return mFiles[0]->GetMozFullPath(aValue);
}
else {
aValue.Truncate();
}
} else {
// Just return the leaf name
if (mFiles.IsEmpty() || NS_FAILED(mFiles[0]->GetName(aValue))) {
@ -2646,19 +2646,6 @@ HTMLInputElement::AfterSetFiles(bool aSetValueChanged)
formControlFrame->SetFormProperty(nsGkAtoms::value, readableValue);
}
#ifndef MOZ_CHILD_PERMISSIONS
// Grab the full path here for any chrome callers who access our .value via a
// CPOW. This path won't be called from a CPOW meaning the potential sync IPC
// call under GetMozFullPath won't be rejected for not being urgent.
// XXX Protected by the ifndef because the blob code doesn't allow us to send
// this message in b2g.
if (mFiles.IsEmpty()) {
mFirstFilePath.Truncate();
} else {
mFiles[0]->GetMozFullPath(mFirstFilePath);
}
#endif
UpdateFileList();
if (aSetValueChanged) {

View File

@ -1254,7 +1254,6 @@ protected:
*/
nsTextEditorState* mState;
} mInputData;
/**
* The value of the input if it is a file input. This is the list of filenames
* used when uploading a file. It is vital that this is kept separate from
@ -1267,11 +1266,6 @@ protected:
*/
nsTArray<nsRefPtr<File>> mFiles;
/**
* Hack for bug 1086684: Stash the .value when we're a file picker.
*/
nsString mFirstFilePath;
nsRefPtr<FileList> mFileList;
nsRefPtr<DirPickerFileListBuilderTask> mDirPickerFileListBuilderTask;

View File

@ -244,7 +244,4 @@ LOCAL_INCLUDES += [
'/netwerk/base',
]
if CONFIG['MOZ_CHILD_PERMISSIONS']:
DEFINES['MOZ_CHILD_PERMISSIONS'] = True
FINAL_LIBRARY = 'xul'

View File

@ -1,16 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1086684
-->
<head>
<title>Test for Bug 1086684</title>
<meta charset="UTF-8">
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1086684">Mozilla Bug 1086684</a>
<div id="content">
<input type="file" id="f">
</div>
</body>
</html>

View File

@ -1,16 +1,9 @@
[DEFAULT]
support-files =
file_bug1086684.html
[test_blob_sliced_from_child_process.html]
# This test is only supposed to run in the main process.
skip-if = buildapp == 'b2g' || buildapp == 'mulet' || e10s
[test_blob_sliced_from_parent_process.html]
# This test is only supposed to run in the main process.
skip-if = buildapp == 'b2g' || buildapp == 'mulet' || e10s
[test_bug1086684.html]
# This test is only supposed to run in the main process
skip-if = buildapp == 'b2g' || buildapp == 'mulet' || e10s
[test_cpow_cookies.html]
skip-if = buildapp == 'b2g' || buildapp == 'mulet'
[test_NuwaProcessCreation.html]

View File

@ -1,106 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for recursive CPOW-getting-cookie bug</title>
<script type="application/javascript"
src="/tests/SimpleTest/SimpleTest.js">
</script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<script type="application/javascript;version=1.8">
"use strict";
SimpleTest.waitForExplicitFinish();
const childFrameURL =
"http://mochi.test:8888/tests/dom/ipc/tests/file_bug1086684.html";
function childFrameScript() {
"use strict";
let { MockFilePicker } =
Components.utils.import("resource://specialpowers/MockFilePicker.jsm", {});
function parentReady(message) {
MockFilePicker.init(content);
MockFilePicker.returnFiles = [message.data.file];
MockFilePicker.returnValue = MockFilePicker.returnOK;
let input = content.document.getElementById("f");
input.addEventListener("change", () => {
MockFilePicker.cleanup();
message.target.sendAsyncMessage("testBug1086684:childDone", { },
{ elt: input });
});
input.focus();
input.click();
}
addMessageListener("testBug1086684:parentReady", function(message) {
parentReady(message);
});
}
let test;
function* testStructure(mm) {
let lastResult;
function testDone(msg) {
test.next(msg.objects);
}
mm.addMessageListener("testBug1086684:childDone", testDone);
let blob = new Blob([]);
let file = new File([blob], "helloworld.txt", { type: "text/plain" });
mm.sendAsyncMessage("testBug1086684:parentReady", { file });
lastResult = yield;
// Note that the "helloworld.txt" passed in above doesn't affect the
// 'value' getter. Because we're mocking a file using a blob, we ask the
// blob for its path, which is the empty string.
is(SpecialPowers.wrap(lastResult.elt).value, "", "got the right answer and didn't crash");
SimpleTest.finish();
}
function runTests() {
info("Browser prefs set.");
let iframe = document.createElement("iframe");
SpecialPowers.wrap(iframe).mozbrowser = true;
iframe.id = "iframe";
iframe.src = childFrameURL;
iframe.addEventListener("mozbrowserloadend", function() {
info("Got iframe load event.");
let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
mm.loadFrameScript("data:,(" + encodeURI(childFrameScript.toString()) + ")();",
false);
test = testStructure(mm);
test.next();
});
document.body.appendChild(iframe);
}
addEventListener("load", function() {
info("Got load event.");
SpecialPowers.addPermission("browser", true, document);
SpecialPowers.pushPrefEnv({
"set": [
["dom.ipc.browser_frames.oop_by_default", true],
["dom.mozBrowserFramesEnabled", true],
["browser.pagethumbnails.capturing_disabled", true]
]
}, runTests);
});
</script>
</body>
</html>