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

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

Issue 1405413004: Implement suspend() and resume() for OfflineAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updating UseCounter.h after L-G-T-M Created 5 years, 1 month 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: third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
diff --git a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
index 10c587fc0621f0e3013ba084c314bd4288190cb7..79cc3122d3a6db0275580e9f2d34b5e9ec9a03e8 100644
--- a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
+++ b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h
@@ -167,8 +167,10 @@ public:
// Close
virtual ScriptPromise closeContext(ScriptState*) = 0;
- // Suspend/Resume
+ // Suspend
virtual ScriptPromise suspendContext(ScriptState*) = 0;
+
+ // Resume
virtual ScriptPromise resumeContext(ScriptState*) = 0;
// When a source node has started processing and needs to be protected,
@@ -227,11 +229,9 @@ 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();
// A context is considered closed if:
@@ -246,20 +246,27 @@ protected:
explicit AbstractAudioContext(Document*);
AbstractAudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate);
+ void initialize();
+ void uninitialize();
+
void setContextState(AudioContextState);
+
virtual void didClose() {}
- void uninitialize();
- Member<ScriptPromiseResolver> m_offlineResolver;
+ // Tries to handle AudioBufferSourceNodes that were started but became disconnected or was never
+ // connected. Because these never get pulled anymore, they will stay around forever. So if we
+ // can, try to stop them so they can be collected.
+ void handleStoppableSourceNodes();
+
+ Member<AudioDestinationNode> m_destinationNode;
// FIXME(dominicc): Move m_resumeResolvers to AudioContext, because only
// it creates these Promises.
// Vector of promises created by resume(). It takes time to handle them, so we collect all of
// the promises here until they can be resolved or rejected.
HeapVector<Member<ScriptPromiseResolver>> m_resumeResolvers;
-private:
- void initialize();
+private:
bool m_isCleared;
void clear();
@@ -269,7 +276,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.
@@ -304,18 +310,11 @@ private:
bool m_didInitializeContextGraphMutex;
RefPtr<DeferredTaskHandler> m_deferredTaskHandler;
- Member<AudioBuffer> m_renderTarget;
-
// The state of the AbstractAudioContext.
AudioContextState m_contextState;
AsyncAudioDecoder m_audioDecoder;
- // Tries to handle AudioBufferSourceNodes that were started but became disconnected or was never
- // connected. Because these never get pulled anymore, they will stay around forever. So if we
- // can, try to stop them so they can be collected.
- void handleStoppableSourceNodes();
-
// This is considering 32 is large enough for multiple channels audio.
// It is somewhat arbitrary and could be increased if necessary.
enum { MaxNumberOfChannels = 32 };
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698