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

Unified Diff: Source/bindings/v8/custom/V8AudioContextCustom.cpp

Issue 15877002: move constructors to new style callbacks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 7 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
« no previous file with comments | « Source/bindings/v8/custom/V8ArrayBufferViewCustom.h ('k') | Source/bindings/v8/custom/V8BlobCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8AudioContextCustom.cpp
diff --git a/Source/bindings/v8/custom/V8AudioContextCustom.cpp b/Source/bindings/v8/custom/V8AudioContextCustom.cpp
index 7f7e099d11e203d5ee6461d5f4271edcec95f6b0..4a77ad9bf82220a4c3da5a6bd4802ca8e4af0189 100644
--- a/Source/bindings/v8/custom/V8AudioContextCustom.cpp
+++ b/Source/bindings/v8/custom/V8AudioContextCustom.cpp
@@ -41,7 +41,7 @@
namespace WebCore {
-v8::Handle<v8::Value> V8AudioContext::constructorCustom(const v8::Arguments& args)
+void V8AudioContext::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
{
Document* document = currentDocument();
@@ -50,25 +50,29 @@ v8::Handle<v8::Value> V8AudioContext::constructorCustom(const v8::Arguments& arg
if (!args.Length()) {
// Constructor for default AudioContext which talks to audio hardware.
audioContext = AudioContext::create(document);
- if (!audioContext.get())
- return throwError(v8SyntaxError, "audio resources unavailable for AudioContext construction", args.GetIsolate());
+ if (!audioContext.get()) {
+ throwError(v8SyntaxError, "audio resources unavailable for AudioContext construction", args.GetIsolate());
+ return;
+ }
} else {
// Constructor for offline (render-target) AudioContext which renders into an AudioBuffer.
// new AudioContext(in unsigned long numberOfChannels, in unsigned long numberOfFrames, in float sampleRate);
document->addConsoleMessage(JSMessageSource, WarningMessageLevel,
"Deprecated AudioContext constructor: use OfflineAudioContext instead");
- return V8OfflineAudioContext::constructorCallback(args);
+ V8OfflineAudioContext::constructorCallback(args);
+ return;
}
- if (!audioContext.get())
- return throwError(v8SyntaxError, "Error creating AudioContext", args.GetIsolate());
+ if (!audioContext.get()) {
+ throwError(v8SyntaxError, "Error creating AudioContext", args.GetIsolate());
+ return;
+ }
// Transform the holder into a wrapper object for the audio context.
v8::Handle<v8::Object> wrapper = args.Holder();
V8DOMWrapper::associateObjectWithWrapper(audioContext.release(), &info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
-
- return wrapper;
+ args.GetReturnValue().Set(wrapper);
}
} // namespace WebCore
« no previous file with comments | « Source/bindings/v8/custom/V8ArrayBufferViewCustom.h ('k') | Source/bindings/v8/custom/V8BlobCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698