Bug 1911747 - Return IPC_FAIL when failed to convert loadinfo, r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D218814
This commit is contained in:
Kershaw Chang 2024-09-02 12:34:40 +00:00
Родитель 6b53027cbc
Коммит 1997853937
1 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -100,9 +100,18 @@ mozilla::ipc::IPCResult DataChannelParent::RecvNotifyListeners(
return IPC_OK();
}
nsAutoCString remoteType;
nsresult rv = GetRemoteType(remoteType);
if (NS_FAILED(rv)) {
return IPC_FAIL(this, "Failed to get remote type");
}
nsCOMPtr<nsILoadInfo> loadInfo;
MOZ_ALWAYS_SUCCEEDS(mozilla::ipc::LoadInfoArgsToLoadInfo(
aDataChannelInfo.loadInfo(), NOT_REMOTE_TYPE, getter_AddRefs(loadInfo)));
rv = mozilla::ipc::LoadInfoArgsToLoadInfo(
aDataChannelInfo.loadInfo(), remoteType, getter_AddRefs(loadInfo));
if (NS_FAILED(rv)) {
return IPC_FAIL(this, "Failed to deserialize LoadInfo");
}
// Re-create a data channel in the parent process to notify
// data-channel-opened observers.