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

Unified Diff: third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp

Issue 1952793002: Move the exception logic to the AudioNode creator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move more things to Node::create() Created 4 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: third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp b/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp
index 207bbf525e9b0f3dab5b8f0f63e134a353021113..f959e5b48f6ae8084581a669db58bc7d02ab20fe 100644
--- a/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp
@@ -165,15 +165,22 @@ double ConvolverHandler::latencyTime() const
// ----------------------------------------------------------------
-ConvolverNode::ConvolverNode(AbstractAudioContext& context, float sampleRate)
+ConvolverNode::ConvolverNode(AbstractAudioContext& context)
: AudioNode(context)
{
- setHandler(ConvolverHandler::create(*this, sampleRate));
+ setHandler(ConvolverHandler::create(*this, context.sampleRate()));
}
-ConvolverNode* ConvolverNode::create(AbstractAudioContext& context, float sampleRate)
+ConvolverNode* ConvolverNode::create(AbstractAudioContext& context, ExceptionState& exceptionState)
{
- return new ConvolverNode(context, sampleRate);
+ ASSERT(isMainThread());
hongchan 2016/05/13 01:20:11 DCHECK?
Raymond Toy 2016/05/20 23:12:00 Done.
+
+ if (context.isContextClosed()) {
hongchan 2016/05/13 01:20:11 Perhaps we can make this to a method? This check-a
Raymond Toy 2016/05/13 16:36:01 I thought about that. But we'd still have to do s
Raymond Toy 2016/05/13 18:41:47 After some further discussions, we decided it woul
+ context.throwExceptionForClosedState(exceptionState);
+ return nullptr;
+ }
+
+ return new ConvolverNode(context);
}
ConvolverHandler& ConvolverNode::convolverHandler() const

Powered by Google App Engine
This is Rietveld 408576698