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

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 review + layout tests 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 bfb33051c35606bc57ea36da3a23eabdf796e336..8db6416ef12191170ba89ce413831058f3074470 100644
--- a/Source/modules/webaudio/AudioContext.h
+++ b/Source/modules/webaudio/AudioContext.h
@@ -219,12 +219,12 @@ public:
virtual const AtomicString& interfaceName() const override final;
virtual ExecutionContext* executionContext() const override final;
- DEFINE_ATTRIBUTE_EVENT_LISTENER(complete);
DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange);
void startRendering();
- void fireCompletionEvent();
+ virtual void fireCompletionEvent();
void notifyStateChange();
+ virtual bool shouldSuspendNow();
Raymond Toy 2015/05/28 16:37:35 Isn't this only used by an offline context?
hongchan 2015/06/09 20:49:59 This is used by OfflineAudioDestinatioNode. That's
Raymond Toy 2015/06/09 22:34:59 Then why not make it a private method in OfflineAu
// A context is considered closed if:
// - closeContext() has been called, even if the audio HW has not yet been
@@ -242,7 +242,13 @@ protected:
explicit AudioContext(Document*);
AudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate);
- RefPtrWillBeMember<ScriptPromiseResolver> m_offlineResolver;
+ // Shared with OfflineAudioContext.
+ void setContextState(AudioContextState);
+ bool m_didInitializeContextGraphMutex;
+ bool m_isOfflineContext;
+ Member<AudioBuffer> m_renderTarget;
+ Member<AudioDestinationNode> m_destinationNode;
Raymond Toy 2015/05/28 16:37:35 I think an offline context should use destination(
hongchan 2015/06/09 20:49:59 Seems like a good idea. Will look into it.
+
private:
void initialize();
void uninitialize();
@@ -262,7 +268,6 @@ 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.
@@ -297,17 +302,9 @@ private:
unsigned m_connectionCount;
- // Graph locking.
Raymond Toy 2015/05/28 16:37:35 Preserve these comments with the variable that you
hongchan 2015/06/09 20:49:59 Will do!
- 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;

Powered by Google App Engine
This is Rietveld 408576698