mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-28 13:40:17 -10:00
Bug 1404910 - WebSocket should consider the corrent top-level window principal, r=smaug
This commit is contained in:
1 parent
eb2a8564d0
commit
68d2d74bd5
4 files changed
+106
-8
No files matched your search
@@ -1666,18 +1666,17 @@ WebSocketImpl::Init(JSContext* aCx,
|
||||
nsCOMPtr<nsPIDOMWindowInner> innerWindow;
|
||||
|
||||
while (true) {
|
||||
if (principal) {
|
||||
bool isNullPrincipal = true;
|
||||
isNullPrincipal = principal->GetIsNullPrincipal();
|
||||
if (isNullPrincipal || nsContentUtils::IsSystemPrincipal(principal)) {
|
||||
break;
|
||||
}
|
||||
if (principal && !principal->GetIsNullPrincipal()) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!innerWindow) {
|
||||
innerWindow = do_QueryInterface(globalObject);
|
||||
if (NS_WARN_IF(!innerWindow)) {
|
||||
return NS_ERROR_DOM_SECURITY_ERR;
|
||||
if (!innerWindow) {
|
||||
// If we are in a XPConnect sandbox or in a JS component,
|
||||
// innerWindow will be null. There is nothing on top of this to be
|
||||
// considered.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user