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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 { | 437 { |
438 ASSERT(isMainThread()); | 438 ASSERT(isMainThread()); |
439 | 439 |
440 if (m_playbackState != UNSCHEDULED_STATE) { | 440 if (m_playbackState != UNSCHEDULED_STATE) { |
441 exceptionState.throwDOMException( | 441 exceptionState.throwDOMException( |
442 InvalidStateError, | 442 InvalidStateError, |
443 "cannot call start more than once."); | 443 "cannot call start more than once."); |
444 return; | 444 return; |
445 } | 445 } |
446 | 446 |
447 if (!std::isfinite(when) || (when < 0)) { | 447 if (when < 0) { |
448 exceptionState.throwDOMException( | 448 exceptionState.throwDOMException( |
449 InvalidStateError, | 449 InvalidStateError, |
450 "Start time must be a finite non-negative number: " + String::number
(when)); | 450 "Start time must be a non-negative number: " + String::number(when))
; |
451 return; | 451 return; |
452 } | 452 } |
453 | 453 |
454 if (!std::isfinite(grainOffset) || (grainOffset < 0)) { | 454 if (grainOffset < 0) { |
455 exceptionState.throwDOMException( | 455 exceptionState.throwDOMException( |
456 InvalidStateError, | 456 InvalidStateError, |
457 "Offset must be a finite non-negative number: " + String::number(gra
inOffset)); | 457 "Offset must be a non-negative number: " + String::number(grainOffse
t)); |
458 return; | 458 return; |
459 } | 459 } |
460 | 460 |
461 if (!std::isfinite(grainDuration) || (grainDuration < 0)) { | 461 if (grainDuration < 0) { |
462 exceptionState.throwDOMException( | 462 exceptionState.throwDOMException( |
463 InvalidStateError, | 463 InvalidStateError, |
464 "Duration must be a finite non-negative number: " + String::number(g
rainDuration)); | 464 "Duration must be a non-negative number: " + String::number(grainDur
ation)); |
465 return; | 465 return; |
466 } | 466 } |
467 | 467 |
468 m_isGrain = true; | 468 m_isGrain = true; |
469 m_grainOffset = grainOffset; | 469 m_grainOffset = grainOffset; |
470 m_grainDuration = grainDuration; | 470 m_grainDuration = grainDuration; |
471 | 471 |
472 m_startTime = when; | 472 m_startTime = when; |
473 | 473 |
474 if (buffer()) | 474 if (buffer()) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 { | 558 { |
559 visitor->trace(m_buffer); | 559 visitor->trace(m_buffer); |
560 visitor->trace(m_playbackRate); | 560 visitor->trace(m_playbackRate); |
561 visitor->trace(m_pannerNode); | 561 visitor->trace(m_pannerNode); |
562 AudioScheduledSourceNode::trace(visitor); | 562 AudioScheduledSourceNode::trace(visitor); |
563 } | 563 } |
564 | 564 |
565 } // namespace blink | 565 } // namespace blink |
566 | 566 |
567 #endif // ENABLE(WEB_AUDIO) | 567 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |