| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 if (destination && inputIndex >= destination->numberOfInputs()) { | 614 if (destination && inputIndex >= destination->numberOfInputs()) { |
| 615 exceptionState.throwDOMException( | 615 exceptionState.throwDOMException( |
| 616 IndexSizeError, "input index (" + String::number(inputIndex) + | 616 IndexSizeError, "input index (" + String::number(inputIndex) + |
| 617 ") exceeds number of inputs (" + | 617 ") exceeds number of inputs (" + |
| 618 String::number(destination->numberOfInputs()) + | 618 String::number(destination->numberOfInputs()) + |
| 619 ")."); | 619 ")."); |
| 620 return nullptr; | 620 return nullptr; |
| 621 } | 621 } |
| 622 | 622 |
| 623 if (context() != destination->context()) { | 623 if (context() != destination->context()) { |
| 624 exceptionState.throwDOMException(SyntaxError, | 624 exceptionState.throwDOMException(InvalidAccessError, |
| 625 "cannot connect to a destination " | 625 "cannot connect to a destination " |
| 626 "belonging to a different audio context."); | 626 "belonging to a different audio context."); |
| 627 return nullptr; | 627 return nullptr; |
| 628 } | 628 } |
| 629 | 629 |
| 630 // ScriptProcessorNodes with 0 output channels can't be connected to any | 630 // ScriptProcessorNodes with 0 output channels can't be connected to any |
| 631 // destination. If there are no output channels, what would the destination | 631 // destination. If there are no output channels, what would the destination |
| 632 // receive? Just disallow this. | 632 // receive? Just disallow this. |
| 633 if (handler().getNodeType() == AudioHandler::NodeTypeJavaScript && | 633 if (handler().getNodeType() == AudioHandler::NodeTypeJavaScript && |
| 634 handler().numberOfOutputChannels() == 0) { | 634 handler().numberOfOutputChannels() == 0) { |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 } | 947 } |
| 948 | 948 |
| 949 void AudioNode::didAddOutput(unsigned numberOfOutputs) { | 949 void AudioNode::didAddOutput(unsigned numberOfOutputs) { |
| 950 m_connectedNodes.push_back(nullptr); | 950 m_connectedNodes.push_back(nullptr); |
| 951 DCHECK_EQ(numberOfOutputs, m_connectedNodes.size()); | 951 DCHECK_EQ(numberOfOutputs, m_connectedNodes.size()); |
| 952 m_connectedParams.push_back(nullptr); | 952 m_connectedParams.push_back(nullptr); |
| 953 DCHECK_EQ(numberOfOutputs, m_connectedParams.size()); | 953 DCHECK_EQ(numberOfOutputs, m_connectedParams.size()); |
| 954 } | 954 } |
| 955 | 955 |
| 956 } // namespace blink | 956 } // namespace blink |
| OLD | NEW |