| 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 // TODO(mlamouri): record when this is called with a user gesture and could |
| 452 // have started the AudioContext if following Safari iOS rules. |
| 452 | 453 |
| 453 if (playbackState() != UNSCHEDULED_STATE) { | 454 if (playbackState() != UNSCHEDULED_STATE) { |
| 454 exceptionState.throwDOMException( | 455 exceptionState.throwDOMException( |
| 455 InvalidStateError, | 456 InvalidStateError, |
| 456 "cannot call start more than once."); | 457 "cannot call start more than once."); |
| 457 return; | 458 return; |
| 458 } | 459 } |
| 459 | 460 |
| 460 if (when < 0) { | 461 if (when < 0) { |
| 461 exceptionState.throwDOMException( | 462 exceptionState.throwDOMException( |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 { | 716 { |
| 716 audioBufferSourceHandler().start(when, grainOffset, exceptionState); | 717 audioBufferSourceHandler().start(when, grainOffset, exceptionState); |
| 717 } | 718 } |
| 718 | 719 |
| 719 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD
uration, ExceptionState& exceptionState) | 720 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD
uration, ExceptionState& exceptionState) |
| 720 { | 721 { |
| 721 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception
State); | 722 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception
State); |
| 722 } | 723 } |
| 723 | 724 |
| 724 } // namespace blink | 725 } // namespace blink |
| OLD | NEW |