| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 AutoLocker locker(this); | 171 AutoLocker locker(this); |
| 172 m_resumeResolvers.push_back(resolver); | 172 m_resumeResolvers.push_back(resolver); |
| 173 } | 173 } |
| 174 | 174 |
| 175 return promise; | 175 return promise; |
| 176 } | 176 } |
| 177 | 177 |
| 178 void AudioContext::getOutputTimestamp(ScriptState* scriptState, | 178 void AudioContext::getOutputTimestamp(ScriptState* scriptState, |
| 179 AudioTimestamp& result) { | 179 AudioTimestamp& result) { |
| 180 DCHECK(isMainThread()); | 180 DCHECK(isMainThread()); |
| 181 LocalDOMWindow* window = scriptState->domWindow(); | 181 LocalDOMWindow* window = LocalDOMWindow::from(scriptState); |
| 182 if (!window) | 182 if (!window) |
| 183 return; | 183 return; |
| 184 | 184 |
| 185 if (!destination()) { | 185 if (!destination()) { |
| 186 result.setContextTime(0.0); | 186 result.setContextTime(0.0); |
| 187 result.setPerformanceTime(0.0); | 187 result.setPerformanceTime(0.0); |
| 188 return; | 188 return; |
| 189 } | 189 } |
| 190 | 190 |
| 191 Performance* performance = DOMWindowPerformance::performance(*window); | 191 Performance* performance = DOMWindowPerformance::performance(*window); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 setContextState(Suspended); | 254 setContextState(Suspended); |
| 255 deferredTaskHandler().clearHandlersToBeDeleted(); | 255 deferredTaskHandler().clearHandlersToBeDeleted(); |
| 256 } | 256 } |
| 257 } | 257 } |
| 258 | 258 |
| 259 double AudioContext::baseLatency() const { | 259 double AudioContext::baseLatency() const { |
| 260 return framesPerBuffer() * 2 / static_cast<double>(sampleRate()); | 260 return framesPerBuffer() * 2 / static_cast<double>(sampleRate()); |
| 261 } | 261 } |
| 262 | 262 |
| 263 } // namespace blink | 263 } // namespace blink |
| OLD | NEW |