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

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

Issue 2404743002: Web Audio: record autoplay status when an AudioContext is destroyed. (Closed)
Patch Set: move recording 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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 startSource(when, grainOffset, grainDuration, true, exceptionState); 492 startSource(when, grainOffset, grainDuration, true, exceptionState);
493 } 493 }
494 494
495 void AudioBufferSourceHandler::startSource(double when, 495 void AudioBufferSourceHandler::startSource(double when,
496 double grainOffset, 496 double grainOffset,
497 double grainDuration, 497 double grainDuration,
498 bool isDurationGiven, 498 bool isDurationGiven,
499 ExceptionState& exceptionState) { 499 ExceptionState& exceptionState) {
500 DCHECK(isMainThread()); 500 DCHECK(isMainThread());
501 501
502 // TODO(mlamouri): record when this is called with a user gesture and could 502 context()->maybeRecordStartAttempt();
503 // have started the AudioContext if following Safari iOS rules.
504 503
505 if (playbackState() != UNSCHEDULED_STATE) { 504 if (playbackState() != UNSCHEDULED_STATE) {
506 exceptionState.throwDOMException(InvalidStateError, 505 exceptionState.throwDOMException(InvalidStateError,
507 "cannot call start more than once."); 506 "cannot call start more than once.");
508 return; 507 return;
509 } 508 }
510 509
511 if (when < 0) { 510 if (when < 0) {
512 exceptionState.throwDOMException( 511 exceptionState.throwDOMException(
513 InvalidStateError, 512 InvalidStateError,
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 754
756 void AudioBufferSourceNode::start(double when, 755 void AudioBufferSourceNode::start(double when,
757 double grainOffset, 756 double grainOffset,
758 double grainDuration, 757 double grainDuration,
759 ExceptionState& exceptionState) { 758 ExceptionState& exceptionState) {
760 audioBufferSourceHandler().start(when, grainOffset, grainDuration, 759 audioBufferSourceHandler().start(when, grainOffset, grainDuration,
761 exceptionState); 760 exceptionState);
762 } 761 }
763 762
764 } // namespace blink 763 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/BUILD.gn ('k') | third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698