Bug 968374 - Add pref for enabling privileged extensions for non-chrome code. r=bjacob

This commit is contained in:
Jeff Gilbert 2014-02-11 17:37:05 -05:00
parent 9220dfd2f3
commit abc729d755
2 changed files with 10 additions and 1 deletions

View File

@ -53,10 +53,18 @@ WebGLContext::IsExtensionEnabled(WebGLExtensionID ext) const {
bool WebGLContext::IsExtensionSupported(JSContext *cx, WebGLExtensionID ext) const
{
bool allowPrivilegedExts = false;
// Chrome contexts need access to debug information even when
// webgl.disable-extensions is set. This is used in the graphics
// section of about:support.
if (xpc::AccessCheck::isChrome(js::GetContextCompartment(cx))) {
if (xpc::AccessCheck::isChrome(js::GetContextCompartment(cx)))
allowPrivilegedExts = true;
if (Preferences::GetBool("webgl.enable-privileged-extensions", false))
allowPrivilegedExts = true;
if (allowPrivilegedExts) {
switch (ext) {
case WEBGL_debug_renderer_info:
return true;

View File

@ -3858,6 +3858,7 @@ pref("webgl.lose-context-on-heap-minimize", false);
pref("webgl.can-lose-context-in-foreground", true);
pref("webgl.max-warnings-per-context", 32);
pref("webgl.enable-draft-extensions", false);
pref("webgl.enable-privileged-extensions", false);
#ifdef MOZ_WIDGET_GONK
pref("gfx.gralloc.fence-with-readpixels", false);
#endif