OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/webaudio/AudioContext.h" | 5 #include "modules/webaudio/AudioContext.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionMessages.h" | 7 #include "bindings/core/v8/ExceptionMessages.h" |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
10 #include "core/dom/DOMException.h" | 10 #include "core/dom/DOMException.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 if (destination()) { | 142 if (destination()) { |
143 maybeUnlockUserGesture(); | 143 maybeUnlockUserGesture(); |
144 if (isAllowedToStart()) | 144 if (isAllowedToStart()) |
145 startRendering(); | 145 startRendering(); |
146 } | 146 } |
147 | 147 |
148 // Save the resolver which will get resolved when the destination node starts | 148 // Save the resolver which will get resolved when the destination node starts |
149 // pulling on the graph again. | 149 // pulling on the graph again. |
150 { | 150 { |
151 AutoLocker locker(this); | 151 AutoLocker locker(this); |
152 m_resumeResolvers.append(resolver); | 152 m_resumeResolvers.push_back(resolver); |
153 } | 153 } |
154 | 154 |
155 return promise; | 155 return promise; |
156 } | 156 } |
157 | 157 |
158 void AudioContext::getOutputTimestamp(ScriptState* scriptState, | 158 void AudioContext::getOutputTimestamp(ScriptState* scriptState, |
159 AudioTimestamp& result) { | 159 AudioTimestamp& result) { |
160 DCHECK(isMainThread()); | 160 DCHECK(isMainThread()); |
161 LocalDOMWindow* window = scriptState->domWindow(); | 161 LocalDOMWindow* window = scriptState->domWindow(); |
162 if (!window) | 162 if (!window) |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 DCHECK(destination()); | 230 DCHECK(destination()); |
231 | 231 |
232 if (contextState() == Running) { | 232 if (contextState() == Running) { |
233 destination()->audioDestinationHandler().stopRendering(); | 233 destination()->audioDestinationHandler().stopRendering(); |
234 setContextState(Suspended); | 234 setContextState(Suspended); |
235 deferredTaskHandler().clearHandlersToBeDeleted(); | 235 deferredTaskHandler().clearHandlersToBeDeleted(); |
236 } | 236 } |
237 } | 237 } |
238 | 238 |
239 } // namespace blink | 239 } // namespace blink |
OLD | NEW |