Title: [202192] trunk
Revision
202192
Author
[email protected]
Date
2016-06-17 18:06:45 -0700 (Fri, 17 Jun 2016)

Log Message

REGRESSION (r199819): CrashTracer: [GraphicsContext3D::getInternalFramebufferSize
https://bugs.webkit.org/show_bug.cgi?id=158895
<rdar://problem/26423617>

Reviewed by Zalan Bujtas.

Source/WebCore:

In r199819 we started resetting contexts if the page had too
many. Unfortunately there were entry points in the WebGL context
that didn't check for the validity of the object before trying
to access the lower level objects.

Test: webgl/many-contexts-access-after-loss.html

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::drawingBufferWidth): Return 0 if we're lost.
(WebCore::WebGLRenderingContextBase::drawingBufferHeight): Ditto.

LayoutTests:

New test to access the contexts after loss. Also cleaned
up the _javascript_ code in the existing test (and made sure
it ran outside of the test system).

* webgl/many-contexts-access-after-loss-expected.txt: Added.
* webgl/many-contexts-access-after-loss.html: Added.
* webgl/many-contexts.html:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (202191 => 202192)


--- trunk/LayoutTests/ChangeLog	2016-06-18 01:05:53 UTC (rev 202191)
+++ trunk/LayoutTests/ChangeLog	2016-06-18 01:06:45 UTC (rev 202192)
@@ -1,3 +1,19 @@
+2016-06-17  Dean Jackson  <[email protected]>
+
+        REGRESSION (r199819): CrashTracer: [GraphicsContext3D::getInternalFramebufferSize
+        https://bugs.webkit.org/show_bug.cgi?id=158895
+        <rdar://problem/26423617>
+
+        Reviewed by Zalan Bujtas.
+
+        New test to access the contexts after loss. Also cleaned
+        up the _javascript_ code in the existing test (and made sure
+        it ran outside of the test system).
+
+        * webgl/many-contexts-access-after-loss-expected.txt: Added.
+        * webgl/many-contexts-access-after-loss.html: Added.
+        * webgl/many-contexts.html:
+
 2016-06-17  Antoine Quint  <[email protected]>
 
         Web video playback controls should have RTL volume slider

Added: trunk/LayoutTests/webgl/many-contexts-access-after-loss-expected.txt (0 => 202192)


--- trunk/LayoutTests/webgl/many-contexts-access-after-loss-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webgl/many-contexts-access-after-loss-expected.txt	2016-06-18 01:06:45 UTC (rev 202192)
@@ -0,0 +1,185 @@
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 13: There are too many active WebGL contexts on this page, the oldest context will be lost.
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 0
+CONSOLE MESSAGE: line 17: 1
+CONSOLE MESSAGE: line 17: 1
+CONSOLE MESSAGE: line 17: 1
+CONSOLE MESSAGE: line 17: 1
+CONSOLE MESSAGE: line 17: 1
+CONSOLE MESSAGE: line 17: 1
+CONSOLE MESSAGE: line 17: 1
+CONSOLE MESSAGE: line 17: 1
+CONSOLE MESSAGE: line 17: 1
+CONSOLE MESSAGE: line 17: 1
+CONSOLE MESSAGE: line 17: 1
+CONSOLE MESSAGE: line 17: 1
+CONSOLE MESSAGE: line 17: 1
+CONSOLE MESSAGE: line 17: 1
+CONSOLE MESSAGE: line 17: 1
+CONSOLE MESSAGE: line 17: 1
+PASS if this test did not crash.
Property changes on: trunk/LayoutTests/webgl/many-contexts-access-after-loss-expected.txt
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/webgl/many-contexts-access-after-loss.html (0 => 202192)


--- trunk/LayoutTests/webgl/many-contexts-access-after-loss.html	                        (rev 0)
+++ trunk/LayoutTests/webgl/many-contexts-access-after-loss.html	2016-06-18 01:06:45 UTC (rev 202192)
@@ -0,0 +1,21 @@
+<div id="result">PASS if this test did not crash.</div>
+<script>
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+let size = 100;
+let canvii = new Array();
+for (let i = 0; i < size; i++) {
+    canvii[i] = document.createElement("canvas");
+    canvii[i].width = 1;
+    canvii[i].height = 1;
+    canvii[i].getContext("webgl");
+}
+for (let i = 0; i < size; i++) {
+    let context = canvii[i].getContext("webgl");
+    console.log(context.drawingBufferWidth);
+}
+if (window.testRunner)
+    testRunner.notifyDone();
+</script>
Property changes on: trunk/LayoutTests/webgl/many-contexts-access-after-loss.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Modified: trunk/LayoutTests/webgl/many-contexts.html (202191 => 202192)


--- trunk/LayoutTests/webgl/many-contexts.html	2016-06-18 01:05:53 UTC (rev 202191)
+++ trunk/LayoutTests/webgl/many-contexts.html	2016-06-18 01:06:45 UTC (rev 202192)
@@ -3,14 +3,14 @@
 if (window.testRunner) {
     testRunner.waitUntilDone();
     testRunner.dumpAsText();
-    var size = 1000;
-    var canvii = new Array();
-    for (var i = 0; i < size; i++) {
-        canvii[i] = document.createElement("canvas");
-        canvii[i].width = 1;
-        canvii[i].height = 1;
-        var context = canvii[i].getContext("webgl", null);
-    }
+}
+let canvii = new Array();
+for (let i = 0; i < 1000; i++) {
+    canvii[i] = document.createElement("canvas");
+    canvii[i].width = 1;
+    canvii[i].height = 1;
+    canvii[i].getContext("webgl");
+}
+if (window.testRunner)
     testRunner.notifyDone();
-}
 </script>

Modified: trunk/Source/WebCore/ChangeLog (202191 => 202192)


--- trunk/Source/WebCore/ChangeLog	2016-06-18 01:05:53 UTC (rev 202191)
+++ trunk/Source/WebCore/ChangeLog	2016-06-18 01:06:45 UTC (rev 202192)
@@ -1,3 +1,22 @@
+2016-06-17  Dean Jackson  <[email protected]>
+
+        REGRESSION (r199819): CrashTracer: [GraphicsContext3D::getInternalFramebufferSize
+        https://bugs.webkit.org/show_bug.cgi?id=158895
+        <rdar://problem/26423617>
+
+        Reviewed by Zalan Bujtas.
+
+        In r199819 we started resetting contexts if the page had too
+        many. Unfortunately there were entry points in the WebGL context
+        that didn't check for the validity of the object before trying
+        to access the lower level objects.
+
+        Test: webgl/many-contexts-access-after-loss.html
+
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::drawingBufferWidth): Return 0 if we're lost.
+        (WebCore::WebGLRenderingContextBase::drawingBufferHeight): Ditto.
+
 2016-06-17  Daniel Bates  <[email protected]>
 
         Unreviewed, rolling out r202186.

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (202191 => 202192)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2016-06-18 01:05:53 UTC (rev 202191)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2016-06-18 01:06:45 UTC (rev 202192)
@@ -804,6 +804,9 @@
 
 int WebGLRenderingContextBase::drawingBufferWidth() const
 {
+    if (isContextLost())
+        return 0;
+
     if (m_isPendingPolicyResolution && !m_hasRequestedPolicyResolution)
         return 0;
 
@@ -812,6 +815,9 @@
 
 int WebGLRenderingContextBase::drawingBufferHeight() const
 {
+    if (isContextLost())
+        return 0;
+
     if (m_isPendingPolicyResolution && !m_hasRequestedPolicyResolution)
         return 0;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to