Index: third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp |
diff --git a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp |
index cf61288c02652c5ddea7bdd8b5ab02914b70e4f7..5659421d04b15f02ba97b0545a013562c5b1f5ea 100644 |
--- a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp |
+++ b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp |
@@ -82,8 +82,8 @@ AbstractAudioContext* AbstractAudioContext::create(Document& document, Exception |
// Constructor for rendering to the audio hardware. |
AbstractAudioContext::AbstractAudioContext(Document* document) |
: ActiveDOMObject(document) |
- , m_isCleared(false) |
, m_destinationNode(nullptr) |
+ , m_isCleared(false) |
, m_isResolvingResumePromises(false) |
, m_connectionCount(0) |
, m_didInitializeContextGraphMutex(false) |
@@ -99,8 +99,8 @@ AbstractAudioContext::AbstractAudioContext(Document* document) |
// Constructor for offline (non-realtime) rendering. |
AbstractAudioContext::AbstractAudioContext(Document* document, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate) |
: ActiveDOMObject(document) |
- , m_isCleared(false) |
, m_destinationNode(nullptr) |
+ , m_isCleared(false) |
, m_isResolvingResumePromises(false) |
, m_connectionCount(0) |
, m_didInitializeContextGraphMutex(false) |
@@ -108,12 +108,6 @@ AbstractAudioContext::AbstractAudioContext(Document* document, unsigned numberOf |
, m_contextState(Suspended) |
{ |
m_didInitializeContextGraphMutex = true; |
Raymond Toy
2015/10/16 23:32:36
Why is this initialized to true here and false in
hongchan
2015/10/19 20:08:12
It has been like this from the beginning. Honestly
|
- // Create a new destination for offline rendering. |
- m_renderTarget = AudioBuffer::create(numberOfChannels, numberOfFrames, sampleRate); |
- if (m_renderTarget.get()) |
- m_destinationNode = OfflineAudioDestinationNode::create(this, m_renderTarget.get()); |
- |
- initialize(); |
} |
AbstractAudioContext::~AbstractAudioContext() |
@@ -804,34 +798,8 @@ void AbstractAudioContext::startRendering() |
} |
} |
-void AbstractAudioContext::fireCompletionEvent() |
-{ |
- ASSERT(isMainThread()); |
- if (!isMainThread()) |
- return; |
- |
- AudioBuffer* renderedBuffer = m_renderTarget.get(); |
- |
- // For an offline context, we set the state to closed here so that the oncomplete handler sees |
- // that the context has been closed. |
- setContextState(Closed); |
- |
- ASSERT(renderedBuffer); |
- if (!renderedBuffer) |
- return; |
- |
- // Avoid firing the event if the document has already gone away. |
- if (executionContext()) { |
- // Call the offline rendering completion event listener and resolve the promise too. |
- dispatchEvent(OfflineAudioCompletionEvent::create(renderedBuffer)); |
- m_offlineResolver->resolve(renderedBuffer); |
- } |
-} |
- |
DEFINE_TRACE(AbstractAudioContext) |
{ |
- visitor->trace(m_offlineResolver); |
- visitor->trace(m_renderTarget); |
visitor->trace(m_destinationNode); |
visitor->trace(m_listener); |
// trace() can be called in AbstractAudioContext constructor, and |