mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1229890 - Convert JS callsites to use asyncOpen2 within mobile/ (r=mfinkle,sicking)
This commit is contained in:
parent
187c1a6d8f
commit
1d23d5fdf5
@ -414,16 +414,23 @@ var CastingApps = {
|
||||
_getContentTypeForURI: function(aURI, aElement, aCallback) {
|
||||
let channel;
|
||||
try {
|
||||
channel = Services.io.newChannelFromURI2(aURI,
|
||||
aElement,
|
||||
null, // aLoadingPrincipal
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
} catch(e) {
|
||||
aCallback(null);
|
||||
return;
|
||||
}
|
||||
let secFlags = Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS;
|
||||
if (aElement.crossOrigin) {
|
||||
secFlags = Ci.nsILoadInfo.SEC_REQUIRE_CORS_DATA_INHERITS;
|
||||
if (aElement.crossOrigin === "use-credentials") {
|
||||
secFlags |= Ci.nsILoadInfo.SEC_COOKIES_INCLUDE;
|
||||
}
|
||||
}
|
||||
channel = NetUtil.newChannel({
|
||||
uri: aURI,
|
||||
loadingNode: aElement,
|
||||
securityFlags: secFlags,
|
||||
contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_VIDEO
|
||||
});
|
||||
} catch(e) {
|
||||
aCallback(null);
|
||||
return;
|
||||
}
|
||||
|
||||
let listener = {
|
||||
onStartRequest: function(request, context) {
|
||||
@ -446,7 +453,7 @@ var CastingApps = {
|
||||
};
|
||||
|
||||
if (channel) {
|
||||
channel.asyncOpen(listener, null);
|
||||
channel.asyncOpen2(listener);
|
||||
} else {
|
||||
aCallback(null);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user