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

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

Issue 2790313004: Move ScriptState::domWindow() (Closed)
Patch Set: Rebase again Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/Sensor.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/Sensor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698