зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1093947: Make JS callers of ios.newChannel call ios.newChannel2 in uriloader/ (r=smaug,bz)
This commit is contained in:
Родитель
71aff521dd
Коммит
918fda3c99
|
@ -2,14 +2,16 @@
|
|||
* 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/. */
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//// Constants
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
const Cr = Components.results;
|
||||
const Cc = Components.classes;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//// nsWebHandler class
|
||||
|
@ -80,7 +82,12 @@ nsWebHandlerApp.prototype = {
|
|||
if (aWindowContext) {
|
||||
|
||||
// create a channel from this URI
|
||||
var channel = ioService.newChannelFromURI(uriToSend);
|
||||
var channel = ioService.newChannelFromURI2(uriToSend,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
channel.loadFlags = Ci.nsIChannel.LOAD_DOCUMENT_URI;
|
||||
|
||||
// load the channel
|
||||
|
|
|
@ -148,9 +148,14 @@ function runChildTestSet(set)
|
|||
{
|
||||
DownloadListener.onFinished = testFinisher(set[2]);
|
||||
sendCommand('\
|
||||
let uri = ioservice.newURI("http://localhost:4444' + set[0] + '", null, null);\
|
||||
let channel = ioservice.newChannelFromURI(uri); \
|
||||
uriloader.openURI(channel, Ci.nsIURILoader.IS_CONTENT_PREFERRED, new WindowContext()); \
|
||||
let uri = ioservice.newURI("http://localhost:4444' + set[0] + '", null, null); \
|
||||
let channel = ioservice.newChannelFromURI2(uri, \
|
||||
null, /* aLoadingNode */ \
|
||||
Services.scriptSecurityManager.getSystemPrincipal(), \
|
||||
null, /* aTriggeringPrincipal */ \
|
||||
Ci.nsILoadInfo.SEC_NORMAL, \
|
||||
Ci.nsIContentPolicy.TYPE_OTHER); \
|
||||
uriloader.openURI(channel, Ci.nsIURILoader.IS_CONTENT_PREFERRED, new WindowContext()); \
|
||||
');
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче