Bug 1538028 - Part 4: Pass TriggeringRemoteType through the frontend, r=Gijs,emilio

Propagate the ability to pass triggeringRemoteType through the desktop frontend
in various places, such that it is set when using the context menu or content
click handler.

Differential Revision: https://phabricator.services.mozilla.com/D161834
This commit is contained in:
Nika Layzell
2022-11-29 20:41:46 +00:00
parent d715baa761
commit c401277cf6
8 changed files with 51 additions and 0 deletions

View File

@@ -435,6 +435,17 @@ nsresult nsDocShellLoadState::CreateFromLoadURIOptions(
nsDocShell::MaybeNotifyKeywordSearchLoading(searchProvider, keyword);
}
if (aLoadURIOptions.mTriggeringRemoteType.WasPassed()) {
if (XRE_IsParentProcess()) {
loadState->SetTriggeringRemoteType(
aLoadURIOptions.mTriggeringRemoteType.Value());
} else if (ContentChild::GetSingleton()->GetRemoteType() !=
aLoadURIOptions.mTriggeringRemoteType.Value()) {
NS_WARNING("Invalid TriggeringRemoteType from LoadURIOptions in content");
return NS_ERROR_INVALID_ARG;
}
}
if (aLoadURIOptions.mRemoteTypeOverride.WasPassed()) {
loadState->SetRemoteTypeOverride(
aLoadURIOptions.mRemoteTypeOverride.Value());