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

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

Issue 2314903002: Web Audio: when media playback requires a user gesture, apply rule to cross origin iframes. (Closed)
Patch Set: Created 4 years, 3 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/08 20:03:33 If we don't have the gesture, we don't want to sta
mlamouri (slow - plz ping) 2016/09/12 17:26:29 This is the intended behaviour, it matches https:/
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Deprecation.cpp ('k') | third_party/WebKit/Source/modules/webaudio/AudioContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698