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

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: move click simulation to top frame Created 4 years, 2 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 // 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
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
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