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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.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) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 finish(); 125 finish();
126 } 126 }
127 127
128 return; 128 return;
129 } 129 }
130 130
131 void AudioScheduledSourceHandler::start(double when, ExceptionState& exceptionSt ate) 131 void AudioScheduledSourceHandler::start(double when, ExceptionState& exceptionSt ate)
132 { 132 {
133 ASSERT(isMainThread()); 133 ASSERT(isMainThread());
134 134
135 context()->recordUserGesture();
Raymond Toy 2016/06/03 17:57:52 Same comment as for AudioBufferSource.
mlamouri (slow - plz ping) 2016/06/05 14:44:57 See above.
136
135 if (playbackState() != UNSCHEDULED_STATE) { 137 if (playbackState() != UNSCHEDULED_STATE) {
136 exceptionState.throwDOMException( 138 exceptionState.throwDOMException(
137 InvalidStateError, 139 InvalidStateError,
138 "cannot call start more than once."); 140 "cannot call start more than once.");
139 return; 141 return;
140 } 142 }
141 143
142 if (when < 0) { 144 if (when < 0) {
143 exceptionState.throwDOMException( 145 exceptionState.throwDOMException(
144 InvalidAccessError, 146 InvalidAccessError,
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 // playback state if the context is closed. 272 // playback state if the context is closed.
271 if (context()->isContextClosed()) 273 if (context()->isContextClosed())
272 return false; 274 return false;
273 275
274 // If a node is scheduled or playing, do not collect the node prematurely 276 // If a node is scheduled or playing, do not collect the node prematurely
275 // even its reference is out of scope. Then fire onended event if assigned. 277 // even its reference is out of scope. Then fire onended event if assigned.
276 return audioScheduledSourceHandler().isPlayingOrScheduled(); 278 return audioScheduledSourceHandler().isPlayingOrScheduled();
277 } 279 }
278 280
279 } // namespace blink 281 } // namespace blink
280
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698