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

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

Issue 1405413004: Implement suspend() and resume() for OfflineAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 // 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 "config.h" 5 #include "config.h"
6 #include "modules/webaudio/AudioContext.h" 6 #include "modules/webaudio/AudioContext.h"
7 7
8 #include "bindings/core/v8/ExceptionMessages.h" 8 #include "bindings/core/v8/ExceptionMessages.h"
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "bindings/core/v8/ScriptPromiseResolver.h" 10 #include "bindings/core/v8/ScriptPromiseResolver.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // Save the resolver which will get resolved when the destination node start s pulling on the 123 // Save the resolver which will get resolved when the destination node start s pulling on the
124 // graph again. 124 // graph again.
125 { 125 {
126 AutoLocker locker(this); 126 AutoLocker locker(this);
127 m_resumeResolvers.append(resolver); 127 m_resumeResolvers.append(resolver);
128 } 128 }
129 129
130 return promise; 130 return promise;
131 } 131 }
132 132
133 ScriptPromise AudioContext::suspendContext(ScriptState* scriptState, double susp endTime)
134 {
135 // This CANNOT be called on AudioContext; it is to implement the pure
136 // virtual interface from AbstractAudioContext.
137 RELEASE_ASSERT_NOT_REACHED();
138
139 return ScriptPromise();
Raymond Toy 2015/10/16 23:32:36 Although not reachable, maybe return a rejected pr
hongchan 2015/10/19 20:08:12 Done.
140 }
141
133 ScriptPromise AudioContext::closeContext(ScriptState* scriptState) 142 ScriptPromise AudioContext::closeContext(ScriptState* scriptState)
134 { 143 {
135 if (isContextClosed()) { 144 if (isContextClosed()) {
136 // We've already closed the context previously, but it hasn't yet been r esolved, so just 145 // We've already closed the context previously, but it hasn't yet been r esolved, so just
137 // create a new promise and reject it. 146 // create a new promise and reject it.
138 return ScriptPromise::rejectWithDOMException( 147 return ScriptPromise::rejectWithDOMException(
139 scriptState, 148 scriptState,
140 DOMException::create(InvalidStateError, 149 DOMException::create(InvalidStateError,
141 "Cannot close a context that is being closed or has already been closed.")); 150 "Cannot close a context that is being closed or has already been closed."));
142 } 151 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 if (contextState() == Running) { 188 if (contextState() == Running) {
180 destination()->audioDestinationHandler().stopRendering(); 189 destination()->audioDestinationHandler().stopRendering();
181 setContextState(Suspended); 190 setContextState(Suspended);
182 deferredTaskHandler().clearHandlersToBeDeleted(); 191 deferredTaskHandler().clearHandlersToBeDeleted();
183 } 192 }
184 } 193 }
185 194
186 } // namespace blink 195 } // namespace blink
187 196
188 #endif // ENABLE(WEB_AUDIO) 197 #endif // ENABLE(WEB_AUDIO)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698