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

Unified Diff: Source/bindings/v8/custom/V8ArrayBufferCustom.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/V8Binding.h ('k') | Source/bindings/v8/custom/V8ArrayBufferViewCustom.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8ArrayBufferCustom.cpp
diff --git a/Source/bindings/v8/custom/V8ArrayBufferCustom.cpp b/Source/bindings/v8/custom/V8ArrayBufferCustom.cpp
index 6d5d711f0dd9e6a0007944df0826d5ac636959d5..cd976a01ec50d9670540e4a3c7b1fa9e41e424b5 100644
--- a/Source/bindings/v8/custom/V8ArrayBufferCustom.cpp
+++ b/Source/bindings/v8/custom/V8ArrayBufferCustom.cpp
@@ -47,7 +47,7 @@ V8ArrayBufferDeallocationObserver* V8ArrayBufferDeallocationObserver::instance()
}
-v8::Handle<v8::Value> V8ArrayBuffer::constructorCustom(const v8::Arguments& args)
+void V8ArrayBuffer::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
{
// If we return a previously constructed ArrayBuffer,
// e.g. from the call to ArrayBufferView.buffer, this code is called
@@ -70,14 +70,16 @@ v8::Handle<v8::Value> V8ArrayBuffer::constructorCustom(const v8::Arguments& args
RefPtr<ArrayBuffer> buffer;
if (length >= 0)
buffer = ArrayBuffer::create(static_cast<unsigned>(length), 1);
- if (!buffer.get())
- return throwError(v8RangeError, "ArrayBuffer size is not a small enough positive integer.", args.GetIsolate());
+ if (!buffer.get()) {
+ throwError(v8RangeError, "ArrayBuffer size is not a small enough positive integer.", args.GetIsolate());
+ return;
+ }
buffer->setDeallocationObserver(V8ArrayBufferDeallocationObserver::instance());
v8::V8::AdjustAmountOfExternalAllocatedMemory(buffer->byteLength());
// Transform the holder into a wrapper object for the array.
v8::Handle<v8::Object> wrapper = args.Holder();
V8DOMWrapper::associateObjectWithWrapper(buffer.release(), &info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
- return wrapper;
+ args.GetReturnValue().Set(wrapper);
}
} // namespace WebCore
« no previous file with comments | « Source/bindings/v8/V8Binding.h ('k') | Source/bindings/v8/custom/V8ArrayBufferViewCustom.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698