mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1158319 Cache should throw SecurityError if the principal is incorrect. r=ehsan
This commit is contained in:
parent
7fe6a58a20
commit
cbb5adc74f
8
dom/cache/CacheStorage.cpp
vendored
8
dom/cache/CacheStorage.cpp
vendored
@ -79,7 +79,7 @@ CacheStorage::CreateOnMainThread(Namespace aNamespace, nsIGlobalObject* aGlobal,
|
|||||||
|
|
||||||
if (nullPrincipal) {
|
if (nullPrincipal) {
|
||||||
NS_WARNING("CacheStorage not supported on null principal.");
|
NS_WARNING("CacheStorage not supported on null principal.");
|
||||||
aRv.Throw(NS_ERROR_FAILURE);
|
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ CacheStorage::CreateOnMainThread(Namespace aNamespace, nsIGlobalObject* aGlobal,
|
|||||||
aPrincipal->GetUnknownAppId(&unknownAppId);
|
aPrincipal->GetUnknownAppId(&unknownAppId);
|
||||||
if (unknownAppId) {
|
if (unknownAppId) {
|
||||||
NS_WARNING("CacheStorage not supported on principal with unknown appId.");
|
NS_WARNING("CacheStorage not supported on principal with unknown appId.");
|
||||||
aRv.Throw(NS_ERROR_FAILURE);
|
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ CacheStorage::CreateOnWorker(Namespace aNamespace, nsIGlobalObject* aGlobal,
|
|||||||
const PrincipalInfo& principalInfo = aWorkerPrivate->GetPrincipalInfo();
|
const PrincipalInfo& principalInfo = aWorkerPrivate->GetPrincipalInfo();
|
||||||
if (principalInfo.type() == PrincipalInfo::TNullPrincipalInfo) {
|
if (principalInfo.type() == PrincipalInfo::TNullPrincipalInfo) {
|
||||||
NS_WARNING("CacheStorage not supported on null principal.");
|
NS_WARNING("CacheStorage not supported on null principal.");
|
||||||
aRv.Throw(NS_ERROR_FAILURE);
|
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ CacheStorage::CreateOnWorker(Namespace aNamespace, nsIGlobalObject* aGlobal,
|
|||||||
principalInfo.get_ContentPrincipalInfo().appId() ==
|
principalInfo.get_ContentPrincipalInfo().appId() ==
|
||||||
nsIScriptSecurityManager::UNKNOWN_APP_ID) {
|
nsIScriptSecurityManager::UNKNOWN_APP_ID) {
|
||||||
NS_WARNING("CacheStorage not supported on principal with unknown appId.");
|
NS_WARNING("CacheStorage not supported on principal with unknown appId.");
|
||||||
aRv.Throw(NS_ERROR_FAILURE);
|
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user