Bug 1646899 - P4: Handle object & embed via DocumentChannel. r=mattwoodrow,jya
Pass internal content policy type to DLL and switch behavior depending on type being loaded. This implementation immediately redirects channel back to the content process for further handling. Differential Revision: https://phabricator.services.mozilla.com/D80407
This commit is contained in:
@@ -9253,9 +9253,26 @@ nsIPrincipal* nsDocShell::GetInheritedPrincipal(
|
||||
if (nsCOMPtr<nsITimedChannel> timedChannel = do_QueryInterface(channel)) {
|
||||
timedChannel->SetTimingEnabled(true);
|
||||
|
||||
auto& embedderElementType = aBrowsingContext->GetEmbedderElementType();
|
||||
if (embedderElementType) {
|
||||
timedChannel->SetInitiatorType(*embedderElementType);
|
||||
nsString initiatorType;
|
||||
switch (aLoadInfo->InternalContentPolicyType()) {
|
||||
case nsIContentPolicy::TYPE_INTERNAL_EMBED:
|
||||
initiatorType = u"embed"_ns;
|
||||
break;
|
||||
case nsIContentPolicy::TYPE_INTERNAL_OBJECT:
|
||||
initiatorType = u"object"_ns;
|
||||
break;
|
||||
default: {
|
||||
const auto& embedderElementType =
|
||||
aBrowsingContext->GetEmbedderElementType();
|
||||
if (embedderElementType) {
|
||||
initiatorType = *embedderElementType;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!initiatorType.IsEmpty()) {
|
||||
timedChannel->SetInitiatorType(initiatorType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9574,9 +9591,9 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState,
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
if (DocumentChannel::CanUseDocumentChannel(aLoadState->URI(),
|
||||
aLoadState->LoadFlags())) {
|
||||
channel = DocumentChannel::CreateDocumentChannel(aLoadState, loadInfo,
|
||||
loadFlags, this, cacheKey,
|
||||
uriModified, isXFOError);
|
||||
channel = DocumentChannel::CreateForDocument(aLoadState, loadInfo,
|
||||
loadFlags, this, cacheKey,
|
||||
uriModified, isXFOError);
|
||||
MOZ_ASSERT(channel);
|
||||
|
||||
// Disable keyword fixup when using DocumentChannel, since
|
||||
|
||||
Reference in New Issue
Block a user