Chromium Code Reviews| 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 460 ExceptionState& exceptionState) { | 460 ExceptionState& exceptionState) { |
| 461 warnIfOutsideRange("setTargetAtTime value", target); | 461 warnIfOutsideRange("setTargetAtTime value", target); |
| 462 handler().timeline().setTargetAtTime(target, time, timeConstant, | 462 handler().timeline().setTargetAtTime(target, time, timeConstant, |
| 463 exceptionState); | 463 exceptionState); |
| 464 | 464 |
| 465 // Don't update the histogram here. It's not clear in normal usage if the | 465 // Don't update the histogram here. It's not clear in normal usage if the |
| 466 // parameter value will actually reach |target|. | 466 // parameter value will actually reach |target|. |
| 467 return this; | 467 return this; |
| 468 } | 468 } |
| 469 | 469 |
| 470 AudioParam* AudioParam::setValueCurveAtTime(DOMFloat32Array* curve, | 470 AudioParam* AudioParam::setValueCurveAtTime( |
| 471 double time, | 471 const MaybeShared<DOMFloat32Array>& maybeShared, |
| 472 double duration, | 472 double time, |
| 473 ExceptionState& exceptionState) { | 473 double duration, |
| 474 ExceptionState& exceptionState) { | |
| 475 if (maybeShared.isShared()) { | |
| 476 exceptionState.throwTypeError( | |
| 477 "The provided curve is backed by a SharedArrayBuffer."); | |
|
Raymond Toy
2017/03/06 20:06:33
DBC: Can we be consistent with the error messages
binji
2017/03/14 21:27:35
Yes, I was trying to be consistent with other erro
| |
| 478 return nullptr; | |
| 479 } | |
| 480 DOMFloat32Array* curve = maybeShared.viewNotShared(); | |
| 481 | |
| 474 float* curveData = curve->data(); | 482 float* curveData = curve->data(); |
| 475 float min = minValue(); | 483 float min = minValue(); |
| 476 float max = maxValue(); | 484 float max = maxValue(); |
| 477 | 485 |
| 478 // First, find any non-finite value in the curve and throw an exception if | 486 // First, find any non-finite value in the curve and throw an exception if |
| 479 // there are any. | 487 // there are any. |
| 480 for (unsigned k = 0; k < curve->length(); ++k) { | 488 for (unsigned k = 0; k < curve->length(); ++k) { |
| 481 float value = curveData[k]; | 489 float value = curveData[k]; |
| 482 | 490 |
| 483 if (!std::isfinite(value)) { | 491 if (!std::isfinite(value)) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 517 return this; | 525 return this; |
| 518 } | 526 } |
| 519 | 527 |
| 520 AudioParam* AudioParam::cancelAndHoldAtTime(double startTime, | 528 AudioParam* AudioParam::cancelAndHoldAtTime(double startTime, |
| 521 ExceptionState& exceptionState) { | 529 ExceptionState& exceptionState) { |
| 522 handler().timeline().cancelAndHoldAtTime(startTime, exceptionState); | 530 handler().timeline().cancelAndHoldAtTime(startTime, exceptionState); |
| 523 return this; | 531 return this; |
| 524 } | 532 } |
| 525 | 533 |
| 526 } // namespace blink | 534 } // namespace blink |
| OLD | NEW |