Backed out 2 changesets (bug 1129957) for frequent browser_privatebrowsing_DownloadLastDirWithCPS.js timeouts

Backed out changeset 9ac1d4aadc38 (bug 1129957)
Backed out changeset 109474240d8c (bug 1129957)
This commit is contained in:
Wes Kocher 2015-06-10 14:38:40 -07:00
parent 565dcfae6b
commit 3276349f43
7 changed files with 9 additions and 93 deletions

View File

@ -876,7 +876,7 @@ function _loadURIWithFlags(browser, uri, params) {
let referrerPolicy = ('referrerPolicy' in params ? params.referrerPolicy :
Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT);
let charset = params.charset;
let postData = params.postData;
let postdata = params.postData;
if (!(flags & browser.webNavigation.LOAD_FLAGS_FROM_EXTERNAL)) {
browser.userTypedClear++;
@ -890,18 +890,13 @@ function _loadURIWithFlags(browser, uri, params) {
if (!mustChangeProcess) {
browser.webNavigation.loadURIWithOptions(uri, flags,
referrer, referrerPolicy,
postData, null, null);
postdata, null, null);
} else {
if (postData) {
postData = NetUtil.readInputStreamToString(postData, postData.available());
}
LoadInOtherProcess(browser, {
uri: uri,
flags: flags,
referrer: referrer ? referrer.spec : null,
referrerPolicy: referrerPolicy,
postData: postData,
});
}
} catch (e) {

View File

@ -355,7 +355,6 @@ skip-if = buildapp == 'mulet'
[browser_remoteTroubleshoot.js]
support-files =
test_remoteTroubleshoot.html
[browser_remoteWebNavigation_postdata.js]
[browser_removeTabsToTheEnd.js]
[browser_removeUnsafeProtocolsFromURLBarPaste.js]
[browser_restore_isAppTab.js]

View File

@ -1,50 +0,0 @@
/* 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/. */
Cu.import("resource://gre/modules/BrowserUtils.jsm");
Cu.import("resource://gre/modules/Promise.jsm");
function makeInputStream(aString) {
let stream = Cc["@mozilla.org/io/string-input-stream;1"]
.createInstance(Ci.nsIStringInputStream);
stream.data = aString;
return stream; // XPConnect will QI this to nsIInputStream for us.
}
add_task(function* test_remoteWebNavigation_postdata() {
let obj = {};
Cu.import("resource://testing-common/httpd.js", obj);
Cu.import("resource://services-common/utils.js", obj);
let server = new obj.HttpServer();
server.start(-1);
let loadDeferred = Promise.defer();
server.registerPathHandler("/test", (request, response) => {
let body = obj.CommonUtils.readBytesFromInputStream(request.bodyInputStream);
is(body, "success", "request body is correct");
is(request.method, "POST", "request was a post");
response.write("Received from POST: " + body);
loadDeferred.resolve();
});
let i = server.identity;
let path = i.primaryScheme + "://" + i.primaryHost + ":" + i.primaryPort + "/test";
let postdata =
"Content-Length: 7\r\n" +
"Content-Type: application/x-www-form-urlencoded\r\n" +
"\r\n" +
"success";
openUILinkIn(path, "tab", null, makeInputStream(postdata));
yield loadDeferred.promise;
yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
let serverStoppedDeferred = Promise.defer();
server.stop(function() { serverStoppedDeferred.resolve(); });
yield serverStoppedDeferred.promise;
});

View File

@ -202,11 +202,9 @@ ContentRestoreInternal.prototype = {
let referrerPolicy = ('referrerPolicy' in loadArguments
? loadArguments.referrerPolicy
: Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT);
let postData = loadArguments.postData ?
Utils.makeInputStream(loadArguments.postData) : null;
webNavigation.loadURIWithOptions(loadArguments.uri, loadArguments.flags,
referrer, referrerPolicy, postData,
null, null);
referrer, referrerPolicy, null, null,
null);
} else if (tabData.userTypedValue && tabData.userTypedClear) {
// If the user typed a URL into the URL bar and hit enter right before
// we crashed, we want to start loading that page again. A non-zero

View File

@ -7,8 +7,6 @@
this.EXPORTED_SYMBOLS = ["Utils"];
const Cu = Components.utils;
const Cc = Components.classes;
const Ci = Components.interfaces;
Cu.import("resource://gre/modules/Services.jsm", this);
@ -17,13 +15,6 @@ this.Utils = Object.freeze({
return Services.io.newURI(url, null, null);
},
makeInputStream: function (aString) {
let stream = Cc["@mozilla.org/io/string-input-stream;1"].
createInstance(Ci.nsISupportsCString);
stream.data = aString;
return stream; // XPConnect will QI this to nsIInputStream for us.
},
/**
* Returns true if the |url| passed in is part of the given root |domain|.
* For example, if |url| is "www.mozilla.org", and we pass in |domain| as

View File

@ -21,13 +21,6 @@ if (AppConstants.MOZ_CRASHREPORTER) {
"nsICrashReporter");
}
function makeInputStream(aString) {
let stream = Cc["@mozilla.org/io/string-input-stream;1"].
createInstance(Ci.nsISupportsCString);
stream.data = aString;
return stream; // XPConnect will QI this to nsIInputStream for us.
}
let WebProgressListener = {
init: function() {
this._filter = Cc["@mozilla.org/appshell/component/browser-status-filter;1"]
@ -250,7 +243,6 @@ let WebNavigation = {
case "WebNavigation:LoadURI":
this.loadURI(message.data.uri, message.data.flags,
message.data.referrer, message.data.referrerPolicy,
message.data.postData, message.data.headers,
message.data.baseURI);
break;
case "WebNavigation:Reload":
@ -277,7 +269,7 @@ let WebNavigation = {
this.webNavigation.gotoIndex(index);
},
loadURI: function(uri, flags, referrer, referrerPolicy, postData, headers, baseURI) {
loadURI: function(uri, flags, referrer, referrerPolicy, baseURI) {
if (AppConstants.MOZ_CRASHREPORTER && CrashReporter.enabled) {
let annotation = uri;
try {
@ -291,14 +283,10 @@ let WebNavigation = {
}
if (referrer)
referrer = Services.io.newURI(referrer, null, null);
if (postData)
postData = makeInputStream(postData);
if (headers)
headers = makeInputStream(headers);
if (baseURI)
baseURI = Services.io.newURI(baseURI, null, null);
this.webNavigation.loadURIWithOptions(uri, flags, referrer, referrerPolicy,
postData, headers, baseURI);
null, null, baseURI);
},
reload: function(flags) {

View File

@ -16,12 +16,6 @@ function makeURI(url)
newURI(url, null, null);
}
function readInputStreamToString(aStream)
{
Cu.import("resource://gre/modules/NetUtil.jsm");
return NetUtil.readInputStreamToString(aStream, aStream.available());
}
function RemoteWebNavigation(browser)
{
this.swapBrowser(browser);
@ -79,13 +73,14 @@ RemoteWebNavigation.prototype = {
},
loadURIWithOptions: function(aURI, aLoadFlags, aReferrer, aReferrerPolicy,
aPostData, aHeaders, aBaseURI) {
if (aPostData || aHeaders)
throw Components.Exception("RemoteWebNavigation doesn't accept postdata or headers.", Cr.NS_ERROR_INVALID_ARGS);
this._sendMessage("WebNavigation:LoadURI", {
uri: aURI,
flags: aLoadFlags,
referrer: aReferrer ? aReferrer.spec : null,
referrerPolicy: aReferrerPolicy,
postData: aPostData ? readInputStreamToString(aPostData) : null,
headers: aHeaders ? readInputStreamToString(aHeaders) : null,
baseURI: aBaseURI ? aBaseURI.spec : null,
});
},