Title: [94127] trunk
Revision
94127
Author
[email protected]
Date
2011-08-30 16:45:53 -0700 (Tue, 30 Aug 2011)

Log Message

Don't allow nodes of one context to be connected to nodes of another context
https://bugs.webkit.org/show_bug.cgi?id=67245

Source/WebCore:

Reviewed by Dimitri Glazkov.

Tests: updated webaudio/audionode.html

* webaudio/AudioNode.cpp:
(WebCore::AudioNode::connect):

LayoutTests:

Reviewed by Dimitri Glazkov.

* webaudio/audionode-expected.txt:
* webaudio/audionode.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (94126 => 94127)


--- trunk/LayoutTests/ChangeLog	2011-08-30 23:42:08 UTC (rev 94126)
+++ trunk/LayoutTests/ChangeLog	2011-08-30 23:45:53 UTC (rev 94127)
@@ -1,3 +1,13 @@
+2011-08-30  Chris Rogers  <[email protected]>
+
+        Don't allow nodes of one context to be connected to nodes of another context
+        https://bugs.webkit.org/show_bug.cgi?id=67245
+
+        Reviewed by Dimitri Glazkov.
+
+        * webaudio/audionode-expected.txt:
+        * webaudio/audionode.html:
+
 2011-08-30  Aaron Colwell  <[email protected]>
 
         Add MediaSource API to HTMLMediaElement

Modified: trunk/LayoutTests/webaudio/audionode-expected.txt (94126 => 94127)


--- trunk/LayoutTests/webaudio/audionode-expected.txt	2011-08-30 23:42:08 UTC (rev 94126)
+++ trunk/LayoutTests/webaudio/audionode-expected.txt	2011-08-30 23:45:53 UTC (rev 94127)
@@ -11,6 +11,7 @@
 PASS connect() exception thrown for illegal output index.
 PASS connect() exception thrown for illegal input index.
 PASS audioNode.connect(context.destination) succeeded.
+PASS exception thrown when connecting to other context's node.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/webaudio/audionode.html (94126 => 94127)


--- trunk/LayoutTests/webaudio/audionode.html	2011-08-30 23:42:08 UTC (rev 94126)
+++ trunk/LayoutTests/webaudio/audionode.html	2011-08-30 23:45:53 UTC (rev 94127)
@@ -15,6 +15,7 @@
 description("Basic tests for AudioNode API.");
 
 var context = 0;
+var context2 = 0;
 
 function runTest() {
     if (window.layoutTestController) {
@@ -72,6 +73,15 @@
     } catch(e) {
         testFailed("audioNode.connect(context.destination) failed.");
     }
+    
+    // Create a new context and try to connect the other context's node to this one.
+    try {
+        context2 = new webkitAudioContext();
+        window.audioNode.connect(context2.destination);
+        testFailed("exception should be thrown when connecting to other context's node.");
+    } catch(e) {
+        testPassed("exception thrown when connecting to other context's node.");
+    }
 
     finishJSTest();
 }

Modified: trunk/Source/WebCore/ChangeLog (94126 => 94127)


--- trunk/Source/WebCore/ChangeLog	2011-08-30 23:42:08 UTC (rev 94126)
+++ trunk/Source/WebCore/ChangeLog	2011-08-30 23:45:53 UTC (rev 94127)
@@ -1,3 +1,15 @@
+2011-08-30  Chris Rogers  <[email protected]>
+
+        Don't allow nodes of one context to be connected to nodes of another context
+        https://bugs.webkit.org/show_bug.cgi?id=67245
+
+        Reviewed by Dimitri Glazkov.
+        
+        Tests: updated webaudio/audionode.html
+
+        * webaudio/AudioNode.cpp:
+        (WebCore::AudioNode::connect):
+        
 2011-08-30  Dan Bernstein  <[email protected]>
 
         WebCore part of <rdar://problem/9281695> Add text search API for getting the DOM range of a text match

Modified: trunk/Source/WebCore/webaudio/AudioNode.cpp (94126 => 94127)


--- trunk/Source/WebCore/webaudio/AudioNode.cpp	2011-08-30 23:42:08 UTC (rev 94126)
+++ trunk/Source/WebCore/webaudio/AudioNode.cpp	2011-08-30 23:45:53 UTC (rev 94127)
@@ -126,6 +126,9 @@
         output->disconnectAllInputs();
         return true;
     }
+    
+    if (context() != destination->context())
+        return false;
 
     AudioNodeInput* input = destination->input(inputIndex);
     input->connect(output);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to