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 * 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 441 | 441 |
| 442 void AudioBufferSourceHandler::start(double when, double grainOffset, double gra inDuration, ExceptionState& exceptionState) | 442 void AudioBufferSourceHandler::start(double when, double grainOffset, double gra inDuration, ExceptionState& exceptionState) |
| 443 { | 443 { |
| 444 startSource(when, grainOffset, grainDuration, true, exceptionState); | 444 startSource(when, grainOffset, grainDuration, true, exceptionState); |
| 445 } | 445 } |
| 446 | 446 |
| 447 void AudioBufferSourceHandler::startSource(double when, double grainOffset, doub le grainDuration, bool isDurationGiven, ExceptionState& exceptionState) | 447 void AudioBufferSourceHandler::startSource(double when, double grainOffset, doub le grainDuration, bool isDurationGiven, ExceptionState& exceptionState) |
| 448 { | 448 { |
| 449 DCHECK(isMainThread()); | 449 DCHECK(isMainThread()); |
| 450 | 450 |
| 451 context()->recordUserGestureState(); | 451 context()->startRenderingIfNeeded(); |
|
Raymond Toy
2016/09/07 16:13:19
I don't think this is right. When the context is
mlamouri (slow - plz ping)
2016/09/08 13:12:42
When the AudioContext is created, it might not be
| |
| 452 | 452 |
| 453 if (playbackState() != UNSCHEDULED_STATE) { | 453 if (playbackState() != UNSCHEDULED_STATE) { |
| 454 exceptionState.throwDOMException( | 454 exceptionState.throwDOMException( |
| 455 InvalidStateError, | 455 InvalidStateError, |
| 456 "cannot call start more than once."); | 456 "cannot call start more than once."); |
| 457 return; | 457 return; |
| 458 } | 458 } |
| 459 | 459 |
| 460 if (when < 0) { | 460 if (when < 0) { |
| 461 exceptionState.throwDOMException( | 461 exceptionState.throwDOMException( |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 690 { | 690 { |
| 691 audioBufferSourceHandler().start(when, grainOffset, exceptionState); | 691 audioBufferSourceHandler().start(when, grainOffset, exceptionState); |
| 692 } | 692 } |
| 693 | 693 |
| 694 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD uration, ExceptionState& exceptionState) | 694 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD uration, ExceptionState& exceptionState) |
| 695 { | 695 { |
| 696 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception State); | 696 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception State); |
| 697 } | 697 } |
| 698 | 698 |
| 699 } // namespace blink | 699 } // namespace blink |
| OLD | NEW |