Bug 1396449: Part 2 - Use atoms to test WebExtension permissions. r=krizsa

The extension policy services uses atoms internally for permission names, so
using them directly rather than strings is considerably cheaper.

MozReview-Commit-ID: Io8EuOXHKVy
This commit is contained in:
Kris Maglione
2017-09-03 18:51:02 -07:00
parent 23f86a0885
commit fd54e6524a
13 changed files with 24 additions and 18 deletions

View File

@@ -7570,9 +7570,8 @@ HTMLMediaElement::MarkAsTainted()
bool
HasDebuggerOrTabsPrivilege(JSContext* aCx, JSObject* aObj)
{
return nsContentUtils::CallerHasPermission(aCx,
NS_LITERAL_STRING("debugger")) ||
nsContentUtils::CallerHasPermission(aCx, NS_LITERAL_STRING("tabs"));
return nsContentUtils::CallerHasPermission(aCx, nsGkAtoms::debugger) ||
nsContentUtils::CallerHasPermission(aCx, nsGkAtoms::tabs);
}
void