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

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: Restructured the resolution of suspend promise Created 5 years, 6 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 092eece9ac5f427e7bf33a1913c3ae1f5dd9c4b4..dba8f3a032c0c70f05d0960d0c2c48f1d85c3f41 100644
--- a/Source/modules/webaudio/AudioContext.h
+++ b/Source/modules/webaudio/AudioContext.h
@@ -219,13 +219,16 @@ 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();
+ // For OfflineAudioContext-specific tasks.
+ virtual bool shouldSuspendNow();
+ virtual void resolvePendingSuspendPromises();
+
// 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.
@@ -238,11 +241,16 @@ public:
// Get the security origin for this audio context.
SecurityOrigin* securityOrigin() const;
+ Member<AudioBuffer> renderTarget() const { return m_renderTarget; }
+ AudioDestinationNode* destination() const { return m_destinationNode; }
+
protected:
explicit AudioContext(Document*);
AudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate);
- RefPtrWillBeMember<ScriptPromiseResolver> m_offlineResolver;
+ // Shared with OfflineAudioContext.
+ void setContextState(AudioContextState);
+
private:
void initialize();
void uninitialize();
@@ -307,7 +315,6 @@ private:
// The state of the AudioContext.
AudioContextState m_contextState;
- void setContextState(AudioContextState);
AsyncAudioDecoder m_audioDecoder;

Powered by Google App Engine
This is Rietveld 408576698