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

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

Issue 1140723003: Implement suspend() and resume() for OfflineAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Initial Design Created 5 years, 7 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
« no previous file with comments | « no previous file | Source/modules/webaudio/AudioContext.cpp » ('j') | Source/modules/webaudio/AudioContext.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioContext.h
diff --git a/Source/modules/webaudio/AudioContext.h b/Source/modules/webaudio/AudioContext.h
index 5b19a40d2b8248048d972429ba0e5fe3275e7b52..f8753ef417f1587594967940eb5aedc6a6e163d8 100644
--- a/Source/modules/webaudio/AudioContext.h
+++ b/Source/modules/webaudio/AudioContext.h
@@ -220,9 +220,13 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange);
void startRendering();
- void fireCompletionEvent();
void notifyStateChange();
+ // From offline rendering.
+ void fireSuspendEvent();
+ void fireCompletionEvent();
+ virtual bool suspendIfNecessary();
+
// A context is considered closed if:
// - closeContext() has been called, even if the audio HW has not yet been
// stopped. It will be stopped eventually.
@@ -240,6 +244,14 @@ protected:
AudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate);
RefPtrWillBeMember<ScriptPromiseResolver> m_offlineResolver;
+ Member<AudioDestinationNode> m_destinationNode;
+ bool m_didInitializeContextGraphMutex;
+ Member<AudioBuffer> m_renderTarget;
+
+ // The state of the AudioContext.
+ void setContextState(AudioContextState);
+ AudioContextState m_contextState;
+
private:
void initialize();
void uninitialize();
@@ -259,7 +271,7 @@ private:
// haven't finished playing. Make sure to release them here.
void releaseActiveSourceNodes();
- Member<AudioDestinationNode> m_destinationNode;
Raymond Toy 2015/05/13 17:16:08 Try not to move things around. It makes it hard t
hongchan 2015/05/13 17:30:53 Yes, this relocation was not necessary. However, t
+
Member<AudioListener> m_listener;
// Only accessed in the audio thread.
@@ -299,18 +311,10 @@ private:
unsigned m_connectionCount;
- // Graph locking.
- bool m_didInitializeContextGraphMutex;
RefPtr<DeferredTaskHandler> m_deferredTaskHandler;
- Member<AudioBuffer> m_renderTarget;
-
bool m_isOfflineContext;
- // The state of the AudioContext.
- AudioContextState m_contextState;
- void setContextState(AudioContextState);
-
AsyncAudioDecoder m_audioDecoder;
// The Promise that is returned by close();
« no previous file with comments | « no previous file | Source/modules/webaudio/AudioContext.cpp » ('j') | Source/modules/webaudio/AudioContext.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698