import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 1143922 - Add AsyncOpen2 to nsIChannel and perform security checs when opening a channel - securitymanager (r=sicking,tanvi) (4b78431d8)
- Bug 1143922 - Add AsyncOpen2 to nsIChannel and perform security checks when opening a channel - channel changes (r=mcmanus,sicking) (139445975)
- Bug 1143922 - Add AsyncOpen2 to nsIChannel and perform security checks when opening a channel - scriptSecurityManager changes (r=sicking,bholley) (03d83542d)
- Bug 1143922 - Add AsyncOpen2 to nsIChannel and perform security checks when opening a channel - media element changes (r=sicking,tanvi) (e0d73c36e)
- Bug 1182540 - Use channel->ascynOpen2 in dom/html/HTMLTrackElement.cpp (r=sicking) (c5eb0950d)
- Bug 1182537 - Use channel->ascynOpen2 in dom/base/Navigator.cpp (r=sicking,bz) (8721fd908)
- Bug 1182539 - Use channel->ascynOpen2 in dom/base/nsDocument.cpp (r=sicking) (6dcc65084)
- Bug 1182543 - Use channel->ascynOpen2 in dom/plugins/base/nsPluginHost.cpp (r=sicking) (341de1b91)
- Bug 1188637 - Use channel->ascynOpen2 in dom/base/EventSource.cpp (r=sicking) (e41da5e03)
- Bug 1167356 - Handle return value of DataSourceSurface::Map wherever possible. r=Bas (78286f883)
- missing uuid of 1089255 (c3790f3b5)
- Bug 1174307 - Add some internal content policy types for the purpose of reflecting them on RequestContext; r=sicking (93722c3e6)
- missing bit of Bug 1124951 (72545d143)
This commit is contained in:
2021-09-07 12:16:52 +08:00
parent fbdc4b210e
commit d9c067aad2
47 changed files with 958 additions and 430 deletions
+2 -22
View File
@@ -203,26 +203,6 @@ HTMLTrackElement::LoadResource()
mChannel = nullptr;
}
rv = nsContentUtils::GetSecurityManager()->
CheckLoadURIWithPrincipal(NodePrincipal(), uri,
nsIScriptSecurityManager::STANDARD);
NS_ENSURE_TRUE_VOID(NS_SUCCEEDED(rv));
int16_t shouldLoad = nsIContentPolicy::ACCEPT;
rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_INTERNAL_TRACK,
uri,
NodePrincipal(),
static_cast<Element*>(this),
NS_LITERAL_CSTRING("text/vtt"), // mime type
nullptr, // extra
&shouldLoad,
nsContentUtils::GetContentPolicy(),
nsContentUtils::GetSecurityManager());
NS_ENSURE_TRUE_VOID(NS_SUCCEEDED(rv));
if (NS_CP_REJECTED(shouldLoad)) {
return;
}
// We may already have a TextTrack at this point if GetTrack() has already
// been called. This happens, for instance, if script tries to get the
// TextTrack before its mTrackElement has been bound to the DOM tree.
@@ -235,7 +215,7 @@ HTMLTrackElement::LoadResource()
rv = NS_NewChannel(getter_AddRefs(channel),
uri,
static_cast<Element*>(this),
nsILoadInfo::SEC_NORMAL,
nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS,
nsIContentPolicy::TYPE_INTERNAL_TRACK,
loadGroup);
@@ -247,7 +227,7 @@ HTMLTrackElement::LoadResource()
channel->SetNotificationCallbacks(mListener);
LOG(LogLevel::Debug, ("opening webvtt channel"));
rv = channel->AsyncOpen(mListener, nullptr);
rv = channel->AsyncOpen2(mListener);
NS_ENSURE_TRUE_VOID(NS_SUCCEEDED(rv));
mChannel = channel;