Title: [98104] trunk/Source
Revision
98104
Author
z...@google.com
Date
2011-10-21 09:42:19 -0700 (Fri, 21 Oct 2011)

Log Message

Implement mechanism to enable privileged webgl extensions
https://bugs.webkit.org/show_bug.cgi?id=70538

Reviewed by Darin Fisher.

Source/WebCore: 

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::allowPrivilegedExtensions): check page/Settings flag.
* page/Settings.cpp: Add the flag.
(WebCore::Settings::Settings):
(WebCore::Settings::setPrivilegedWebGLExtensionsEnabled):
* page/Settings.h: Ditto.
(WebCore::Settings::privilegedWebGLExtensionsEnabled):

Source/WebKit/chromium: 

* public/WebSettings.h: Add the flag.
* src/WebSettingsImpl.cpp: Ditto.
(WebKit::WebSettingsImpl::setPrivilegedWebGLExtensionsEnabled):
* src/WebSettingsImpl.h: Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (98103 => 98104)


--- trunk/Source/WebCore/ChangeLog	2011-10-21 15:56:25 UTC (rev 98103)
+++ trunk/Source/WebCore/ChangeLog	2011-10-21 16:42:19 UTC (rev 98104)
@@ -1,3 +1,18 @@
+2011-10-20  Zhenyao Mo  <z...@google.com>
+
+        Implement mechanism to enable privileged webgl extensions
+        https://bugs.webkit.org/show_bug.cgi?id=70538
+
+        Reviewed by Darin Fisher.
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::allowPrivilegedExtensions): check page/Settings flag.
+        * page/Settings.cpp: Add the flag.
+        (WebCore::Settings::Settings):
+        (WebCore::Settings::setPrivilegedWebGLExtensionsEnabled):
+        * page/Settings.h: Ditto.
+        (WebCore::Settings::privilegedWebGLExtensionsEnabled):
+
 2011-10-20  Pavel Podivilov  <podivi...@chromium.org>
 
         Web Inspector: first line in file is not highlighted.

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (98103 => 98104)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2011-10-21 15:56:25 UTC (rev 98103)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2011-10-21 16:42:19 UTC (rev 98104)
@@ -477,7 +477,9 @@
 
 bool WebGLRenderingContext::allowPrivilegedExtensions() const
 {
-    // FIXME: implement this function.
+    Page* p = canvas()->document()->page();
+    if (p && p->settings())
+        return p->settings()->privilegedWebGLExtensionsEnabled();
     return false;
 }
 

Modified: trunk/Source/WebCore/page/Settings.cpp (98103 => 98104)


--- trunk/Source/WebCore/page/Settings.cpp	2011-10-21 15:56:25 UTC (rev 98103)
+++ trunk/Source/WebCore/page/Settings.cpp	2011-10-21 16:42:19 UTC (rev 98104)
@@ -185,6 +185,7 @@
     , m_experimentalNotificationsEnabled(false)
     , m_webGLEnabled(false)
     , m_openGLMultisamplingEnabled(true)
+    , m_privilegedWebGLExtensionsEnabled(false)
     , m_webAudioEnabled(false)
     , m_acceleratedCanvas2dEnabled(false)
     , m_legacyAcceleratedCanvas2dEnabled(false)
@@ -790,6 +791,11 @@
     m_openGLMultisamplingEnabled = enabled;
 }
 
+void Settings::setPrivilegedWebGLExtensionsEnabled(bool enabled)
+{
+    m_privilegedWebGLExtensionsEnabled = enabled;
+}
+
 void Settings::setAccelerated2dCanvasEnabled(bool enabled)
 {
     m_acceleratedCanvas2dEnabled = enabled;

Modified: trunk/Source/WebCore/page/Settings.h (98103 => 98104)


--- trunk/Source/WebCore/page/Settings.h	2011-10-21 15:56:25 UTC (rev 98103)
+++ trunk/Source/WebCore/page/Settings.h	2011-10-21 16:42:19 UTC (rev 98104)
@@ -342,6 +342,9 @@
         void setOpenGLMultisamplingEnabled(bool);
         bool openGLMultisamplingEnabled() const { return m_openGLMultisamplingEnabled; }
 
+        void setPrivilegedWebGLExtensionsEnabled(bool);
+        bool privilegedWebGLExtensionsEnabled() const { return m_privilegedWebGLExtensionsEnabled; }
+
         void setAccelerated2dCanvasEnabled(bool);
         bool accelerated2dCanvasEnabled() const { return m_acceleratedCanvas2dEnabled; }
 
@@ -565,6 +568,7 @@
         bool m_experimentalNotificationsEnabled : 1;
         bool m_webGLEnabled : 1;
         bool m_openGLMultisamplingEnabled : 1;
+        bool m_privilegedWebGLExtensionsEnabled : 1;
         bool m_webAudioEnabled : 1;
         bool m_acceleratedCanvas2dEnabled : 1;
         bool m_legacyAcceleratedCanvas2dEnabled : 1;

Modified: trunk/Source/WebKit/chromium/ChangeLog (98103 => 98104)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-10-21 15:56:25 UTC (rev 98103)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-10-21 16:42:19 UTC (rev 98104)
@@ -1,3 +1,15 @@
+2011-10-20  Zhenyao Mo  <z...@google.com>
+
+        Implement mechanism to enable privileged webgl extensions
+        https://bugs.webkit.org/show_bug.cgi?id=70538
+
+        Reviewed by Darin Fisher.
+
+        * public/WebSettings.h: Add the flag.
+        * src/WebSettingsImpl.cpp: Ditto.
+        (WebKit::WebSettingsImpl::setPrivilegedWebGLExtensionsEnabled):
+        * src/WebSettingsImpl.h: Ditto.
+
 2011-10-21  Yury Semikhatsky  <yu...@chromium.org>
 
         [Chromium] Web Inspector: remove debugger support for out-of-process dedicated workers

Modified: trunk/Source/WebKit/chromium/public/WebSettings.h (98103 => 98104)


--- trunk/Source/WebKit/chromium/public/WebSettings.h	2011-10-21 15:56:25 UTC (rev 98103)
+++ trunk/Source/WebKit/chromium/public/WebSettings.h	2011-10-21 16:42:19 UTC (rev 98104)
@@ -95,6 +95,7 @@
     virtual void setWebAudioEnabled(bool) = 0;
     virtual void setExperimentalWebGLEnabled(bool) = 0;
     virtual void setOpenGLMultisamplingEnabled(bool) = 0;
+    virtual void setPrivilegedWebGLExtensionsEnabled(bool) = 0;
     virtual void setShowDebugBorders(bool) = 0;
     virtual void setShowFPSCounter(bool) = 0;
     virtual bool showFPSCounter() const = 0;

Modified: trunk/Source/WebKit/chromium/src/WebSettingsImpl.cpp (98103 => 98104)


--- trunk/Source/WebKit/chromium/src/WebSettingsImpl.cpp	2011-10-21 15:56:25 UTC (rev 98103)
+++ trunk/Source/WebKit/chromium/src/WebSettingsImpl.cpp	2011-10-21 16:42:19 UTC (rev 98104)
@@ -284,6 +284,11 @@
     m_settings->setOpenGLMultisamplingEnabled(enabled);
 }
 
+void WebSettingsImpl::setPrivilegedWebGLExtensionsEnabled(bool enabled)
+{
+    m_settings->setPrivilegedWebGLExtensionsEnabled(enabled);
+}
+
 void WebSettingsImpl::setShowDebugBorders(bool show)
 {
     m_settings->setShowDebugBorders(show);

Modified: trunk/Source/WebKit/chromium/src/WebSettingsImpl.h (98103 => 98104)


--- trunk/Source/WebKit/chromium/src/WebSettingsImpl.h	2011-10-21 15:56:25 UTC (rev 98103)
+++ trunk/Source/WebKit/chromium/src/WebSettingsImpl.h	2011-10-21 16:42:19 UTC (rev 98104)
@@ -87,6 +87,7 @@
     virtual void setWebAudioEnabled(bool);
     virtual void setExperimentalWebGLEnabled(bool);
     virtual void setOpenGLMultisamplingEnabled(bool);
+    virtual void setPrivilegedWebGLExtensionsEnabled(bool);
     virtual void setShowDebugBorders(bool);
     virtual void setShowFPSCounter(bool);
     virtual bool showFPSCounter() const { return m_showFPSCounter; }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to