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

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

Issue 2031393003: WebAudio: record whether user gesture was available and provided. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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()->recordUserGesture();
Raymond Toy 2016/06/03 17:57:52 Not sure if this is the right place. Say you've c
mlamouri (slow - plz ping) 2016/06/05 14:44:57 As above, I'm following WebKit's behaviour here. T
Raymond Toy 2016/06/06 15:10:07 Acknowledged.
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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 { 683 {
682 audioBufferSourceHandler().start(when, grainOffset, exceptionState); 684 audioBufferSourceHandler().start(when, grainOffset, exceptionState);
683 } 685 }
684 686
685 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD uration, ExceptionState& exceptionState) 687 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD uration, ExceptionState& exceptionState)
686 { 688 {
687 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception State); 689 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception State);
688 } 690 }
689 691
690 } // namespace blink 692 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698