Bug 1459562 - Transmit the permissions of the owning principal together with the blobURL when broadcasted to content processes, r=nika

This commit is contained in:
Andrea Marchesini 2018-05-17 13:36:50 +02:00
Родитель fbe8c3a8fd
Коммит 187183debd
1 изменённых файлов: 11 добавлений и 1 удалений

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

@ -2467,6 +2467,11 @@ ContentParent::InitInternal(ProcessPriority aInitialPriority)
nsTArray<BlobURLRegistrationData> registrations;
if (nsHostObjectProtocolHandler::GetAllBlobURLEntries(registrations,
this)) {
for (const BlobURLRegistrationData& registration : registrations) {
rv = TransmitPermissionsForPrincipal(registration.principal());
Unused << NS_WARN_IF(NS_FAILED(rv));
}
Unused << SendInitBlobURLs(registrations);
}
}
@ -5147,8 +5152,13 @@ ContentParent::BroadcastBlobURLRegistration(const nsACString& aURI,
for (auto* cp : AllProcesses(eLive)) {
if (cp != aIgnoreThisCP) {
nsresult rv = cp->TransmitPermissionsForPrincipal(principal);
if (NS_WARN_IF(NS_FAILED(rv))) {
break;
}
IPCBlob ipcBlob;
nsresult rv = IPCBlobUtils::Serialize(aBlobImpl, cp, ipcBlob);
rv = IPCBlobUtils::Serialize(aBlobImpl, cp, ipcBlob);
if (NS_WARN_IF(NS_FAILED(rv))) {
break;
}