Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp

Issue 2046933003: WebAudio: record whether user gesture was available and provided. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 434
435 void AudioBufferSourceHandler::start(double when, double grainOffset, double gra inDuration, ExceptionState& exceptionState) 435 void AudioBufferSourceHandler::start(double when, double grainOffset, double gra inDuration, ExceptionState& exceptionState)
436 { 436 {
437 startSource(when, grainOffset, grainDuration, true, exceptionState); 437 startSource(when, grainOffset, grainDuration, true, exceptionState);
438 } 438 }
439 439
440 void AudioBufferSourceHandler::startSource(double when, double grainOffset, doub le grainDuration, bool isDurationGiven, ExceptionState& exceptionState) 440 void AudioBufferSourceHandler::startSource(double when, double grainOffset, doub le grainDuration, bool isDurationGiven, ExceptionState& exceptionState)
441 { 441 {
442 ASSERT(isMainThread()); 442 ASSERT(isMainThread());
443 443
444 context()->recordUserGestureState();
445
444 if (playbackState() != UNSCHEDULED_STATE) { 446 if (playbackState() != UNSCHEDULED_STATE) {
445 exceptionState.throwDOMException( 447 exceptionState.throwDOMException(
446 InvalidStateError, 448 InvalidStateError,
447 "cannot call start more than once."); 449 "cannot call start more than once.");
448 return; 450 return;
449 } 451 }
450 452
451 if (when < 0) { 453 if (when < 0) {
452 exceptionState.throwDOMException( 454 exceptionState.throwDOMException(
453 InvalidStateError, 455 InvalidStateError,
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 { 672 {
671 audioBufferSourceHandler().start(when, grainOffset, exceptionState); 673 audioBufferSourceHandler().start(when, grainOffset, exceptionState);
672 } 674 }
673 675
674 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD uration, ExceptionState& exceptionState) 676 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD uration, ExceptionState& exceptionState)
675 { 677 {
676 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception State); 678 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception State);
677 } 679 }
678 680
679 } // namespace blink 681 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698