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

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: Promise Resolution 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
Index: Source/modules/webaudio/AudioContext.h
diff --git a/Source/modules/webaudio/AudioContext.h b/Source/modules/webaudio/AudioContext.h
index 9ea7dd20da78526b65d5dd0672f0bbab69918f50..c77474660cde191c8eba85b1e0b6de45d744c966 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;
+
Member<AudioListener> m_listener;
// Only accessed in the audio thread.
@@ -294,18 +306,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();

Powered by Google App Engine
This is Rietveld 408576698