mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1301123 - Add assertions ensuring that documents and inner windows cannot end up with an expanded principal; r=bholley
This commit is contained in:
parent
e124c53ded
commit
1b15246964
@ -11,6 +11,7 @@
|
||||
#include "nsNodeInfoManager.h"
|
||||
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/dom/NodeInfo.h"
|
||||
#include "mozilla/dom/NodeInfoInlines.h"
|
||||
#include "nsCOMPtr.h"
|
||||
@ -389,6 +390,11 @@ nsNodeInfoManager::SetDocumentPrincipal(nsIPrincipal *aPrincipal)
|
||||
}
|
||||
|
||||
NS_ASSERTION(aPrincipal, "Must have principal by this point!");
|
||||
MOZ_DIAGNOSTIC_ASSERT(!nsContentUtils::IsExpandedPrincipal(aPrincipal),
|
||||
"Documents shouldn't have an expanded principal");
|
||||
if (nsContentUtils::IsExpandedPrincipal(aPrincipal)) {
|
||||
Telemetry::Accumulate(Telemetry::DOCUMENT_WITH_EXPANDED_PRINCIPAL, 1);
|
||||
}
|
||||
|
||||
mPrincipal = aPrincipal;
|
||||
}
|
||||
|
@ -10490,5 +10490,12 @@
|
||||
"kind": "enumerated",
|
||||
"n_values": 4,
|
||||
"description": "Counts the number of asm.js vs WebAssembly modules instanciations, at the time modules are getting instanciated."
|
||||
},
|
||||
"DOCUMENT_WITH_EXPANDED_PRINCIPAL": {
|
||||
"alert_emails": ["dev-platform@lists.mozilla.org"],
|
||||
"bug_numbers": [1301123],
|
||||
"expires_in_version": "58",
|
||||
"kind": "count",
|
||||
"description": "Number of documents encountered using an expanded principal."
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user