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

Unified Diff: Source/modules/webaudio/AbstractAudioContext.h

Issue 1140723003: Implement suspend() and resume() for OfflineAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adapting CL to AbstractAudioContext Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/webaudio/AbstractAudioContext.h
diff --git a/Source/modules/webaudio/AbstractAudioContext.h b/Source/modules/webaudio/AbstractAudioContext.h
index 5994c223ef747ca2a9a8fd28584233c983c62d91..83c69e56acea96a8f568d0b62dd471cb52efdc3d 100644
--- a/Source/modules/webaudio/AbstractAudioContext.h
+++ b/Source/modules/webaudio/AbstractAudioContext.h
@@ -160,8 +160,12 @@ public:
// Close
virtual ScriptPromise closeContext(ScriptState*) = 0;
- // Suspend/Resume
+ // We have 2 suspend methods for online and offline audio context with
+ // different method signature.
Raymond Toy 2015/07/15 20:59:13 Maybe comment that the first can only be used for
hongchan 2015/07/15 23:24:22 Done.
virtual ScriptPromise suspendContext(ScriptState*) = 0;
+ virtual ScriptPromise suspendContext(ScriptState*, double) = 0;
+
+ // Resume
virtual ScriptPromise resumeContext(ScriptState*) = 0;
// When a source node has started processing and needs to be protected,
@@ -220,13 +224,14 @@ public:
const AtomicString& interfaceName() const final;
ExecutionContext* executionContext() const final;
- DEFINE_ATTRIBUTE_EVENT_LISTENER(complete);
DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange);
void startRendering();
- void fireCompletionEvent();
void notifyStateChange();
+ // TODO(hongchan): move this to OfflineAudioContext.
+ AudioBuffer* renderTarget() const { return m_renderTarget.get(); }
+
// A context is considered closed if:
// - closeContext() has been called.
// - it has been stopped by its execution context.
@@ -243,7 +248,7 @@ protected:
virtual void didClose() {}
void uninitialize();
- RefPtrWillBeMember<ScriptPromiseResolver> m_offlineResolver;
+ // RefPtrWillBeMember<ScriptPromiseResolver> m_offlineResolver;
// FIXME(dominicc): Move m_resumeResolvers to AudioContext, because only
// it creates these Promises.
@@ -300,6 +305,8 @@ private:
bool m_didInitializeContextGraphMutex;
RefPtr<DeferredTaskHandler> m_deferredTaskHandler;
+ // For offline audio context.
+ // TODO(hongchan): move this to OfflineAudioContext class.
Member<AudioBuffer> m_renderTarget;
// The state of the AbstractAudioContext.

Powered by Google App Engine
This is Rietveld 408576698