summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/Source
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/WebKit/Source')
-rw-r--r--third_party/WebKit/Source/bindings/bindings.gypi11
-rw-r--r--third_party/WebKit/Source/bindings/scripts/deprecated_code_generator_v8.pm38
-rw-r--r--third_party/WebKit/Source/bindings/tests/results/V8Float64Array.cpp14
-rw-r--r--third_party/WebKit/Source/bindings/tests/results/V8TestObject.cpp4
-rw-r--r--third_party/WebKit/Source/bindings/tests/results/V8TestOverloadedConstructors.cpp4
-rw-r--r--third_party/WebKit/Source/bindings/v8/Dictionary.cpp3
-rw-r--r--third_party/WebKit/Source/bindings/v8/ScriptProfiler.cpp4
-rw-r--r--third_party/WebKit/Source/bindings/v8/SerializedScriptValue.cpp22
-rw-r--r--third_party/WebKit/Source/bindings/v8/V8Binding.cpp7
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8ArrayBufferViewCustom.cpp73
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8ArrayBufferViewCustom.h274
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8BlobCustom.cpp2
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8CryptoCustom.cpp3
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8DataViewCustom.cpp38
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8DataViewCustom.h113
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8Float32ArrayCustom.h113
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8Float64ArrayCustom.h113
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8ImageDataCustom.cpp2
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp18
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8Int16ArrayCustom.h113
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8Int32ArrayCustom.h113
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8Int8ArrayCustom.h113
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8TypedArrayCustom.h189
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8Uint16ArrayCustom.h113
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8Uint32ArrayCustom.h113
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8Uint8ArrayCustom.h113
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8Uint8ClampedArrayCustom.h113
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp16
-rw-r--r--third_party/WebKit/Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp2
-rw-r--r--third_party/WebKit/Source/core/core.gypi12
-rw-r--r--third_party/WebKit/Source/core/html/canvas/Float32Array.idl42
-rw-r--r--third_party/WebKit/Source/core/html/canvas/Float64Array.idl42
-rw-r--r--third_party/WebKit/Source/core/html/canvas/Int16Array.idl41
-rw-r--r--third_party/WebKit/Source/core/html/canvas/Int32Array.idl42
-rw-r--r--third_party/WebKit/Source/core/html/canvas/Int8Array.idl42
-rw-r--r--third_party/WebKit/Source/core/html/canvas/Uint16Array.idl41
-rw-r--r--third_party/WebKit/Source/core/html/canvas/Uint32Array.idl41
-rw-r--r--third_party/WebKit/Source/core/html/canvas/Uint8Array.idl41
-rw-r--r--third_party/WebKit/Source/core/html/canvas/Uint8ClampedArray.idl42
-rw-r--r--third_party/WebKit/Source/web/WebArrayBufferView.cpp4
-rw-r--r--third_party/WebKit/Source/web/WebBindings.cpp2
-rw-r--r--third_party/WebKit/Source/web/WebKit.cpp4
42 files changed, 1480 insertions, 770 deletions
diff --git a/third_party/WebKit/Source/bindings/bindings.gypi b/third_party/WebKit/Source/bindings/bindings.gypi
index d178f48..13a3dd7 100644
--- a/third_party/WebKit/Source/bindings/bindings.gypi
+++ b/third_party/WebKit/Source/bindings/bindings.gypi
@@ -163,6 +163,7 @@
'v8/custom/V8CustomXPathNSResolver.cpp',
'v8/custom/V8CustomXPathNSResolver.h',
'v8/custom/V8DataViewCustom.cpp',
+ 'v8/custom/V8DataViewCustom.h',
'v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp',
'v8/custom/V8DeviceMotionEventCustom.cpp',
'v8/custom/V8DeviceOrientationEventCustom.cpp',
@@ -175,6 +176,8 @@
'v8/custom/V8EventTargetCustom.cpp',
'v8/custom/V8ErrorEventCustom.cpp',
'v8/custom/V8FileReaderCustom.cpp',
+ 'v8/custom/V8Float32ArrayCustom.h',
+ 'v8/custom/V8Float64ArrayCustom.h',
'v8/custom/V8FormDataCustom.cpp',
'v8/custom/V8GeolocationCustom.cpp',
'v8/custom/V8HTMLAllCollectionCustom.cpp',
@@ -198,6 +201,9 @@
'v8/custom/V8InjectedScriptHostCustom.cpp',
'v8/custom/V8InjectedScriptManager.cpp',
'v8/custom/V8InspectorFrontendHostCustom.cpp',
+ 'v8/custom/V8Int8ArrayCustom.h',
+ 'v8/custom/V8Int16ArrayCustom.h',
+ 'v8/custom/V8Int32ArrayCustom.h',
'v8/custom/V8JavaScriptCallFrameCustom.cpp',
'v8/custom/V8LocationCustom.cpp',
'v8/custom/V8MessageChannelCustom.cpp',
@@ -224,6 +230,11 @@
'v8/custom/V8TextCustom.cpp',
'v8/custom/V8TrackEventCustom.cpp',
'v8/custom/V8TreeWalkerCustom.cpp',
+ 'v8/custom/V8TypedArrayCustom.h',
+ 'v8/custom/V8Uint8ArrayCustom.h',
+ 'v8/custom/V8Uint8ClampedArrayCustom.h',
+ 'v8/custom/V8Uint16ArrayCustom.h',
+ 'v8/custom/V8Uint32ArrayCustom.h',
'v8/custom/V8WebGLRenderingContextCustom.cpp',
'v8/custom/V8WebKitPointCustom.cpp',
'v8/custom/V8WindowCustom.cpp',
diff --git a/third_party/WebKit/Source/bindings/scripts/deprecated_code_generator_v8.pm b/third_party/WebKit/Source/bindings/scripts/deprecated_code_generator_v8.pm
index 1ecc85d..0a668971 100644
--- a/third_party/WebKit/Source/bindings/scripts/deprecated_code_generator_v8.pm
+++ b/third_party/WebKit/Source/bindings/scripts/deprecated_code_generator_v8.pm
@@ -426,8 +426,8 @@ sub AddIncludesForType
AddToImplIncludes("bindings/v8/SerializedScriptValue.h");
} elsif ($type eq "any" || IsCallbackFunctionType($type)) {
AddToImplIncludes("bindings/v8/ScriptValue.h");
- } elsif ($type eq "ArrayBuffer") {
- AddToImplIncludes("bindings/v8/custom/V8ArrayBufferCustom.h");
+ } elsif (IsTypedArrayType($type)) {
+ AddToImplIncludes("bindings/v8/custom/V8${type}Custom.h");
} else {
AddToImplIncludes("V8${type}.h");
}
@@ -439,7 +439,7 @@ sub HeaderFilesForInterface
my $implClassName = shift;
my @includes = ();
- if (IsTypedArrayType($interfaceName) or $interfaceName eq "ArrayBuffer") {
+ if (IsTypedArrayType($interfaceName)) {
push(@includes, "wtf/${interfaceName}.h");
} elsif (!SkipIncludeHeader($interfaceName)) {
my $idlFilename = IDLFileForInterface($interfaceName) or die("Could NOT find IDL file for interface \"$interfaceName\" $!\n");
@@ -2727,24 +2727,6 @@ END
$implementation{nameSpaceWebCore}->add($code);
}
-sub GenerateTypedArrayConstructor
-{
- my $interface = shift;
- my $implClassName = GetImplName($interface);
- my $v8ClassName = GetV8ClassName($interface);
-
- my ($nativeType, $arrayType) = GetNativeTypeOfTypedArray($interface);
- AddToImplIncludes("bindings/v8/custom/V8ArrayBufferViewCustom.h");
-
- $implementation{nameSpaceInternal}->add(<<END);
-static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args)
-{
- return constructWebGLArray<$implClassName, ${v8ClassName}, $nativeType>(args, &${v8ClassName}::info, $arrayType);
-}
-
-END
-}
-
sub GenerateNamedConstructor
{
my $function = shift;
@@ -4149,8 +4131,6 @@ END
GenerateConstructor($interface);
} elsif (IsConstructorTemplate($interface, "Event")) {
GenerateEventConstructor($interface);
- } elsif (IsConstructorTemplate($interface, "TypedArray")) {
- GenerateTypedArrayConstructor($interface);
}
}
if (IsConstructable($interface)) {
@@ -5033,8 +5013,8 @@ sub GetNativeType
die "UnionType is not supported" if IsUnionType($type);
- if ($type eq "ArrayBuffer") {
- return $isParameter ? "ArrayBuffer*" : "RefPtr<ArrayBuffer>";
+ if (IsTypedArrayType($type)) {
+ return $isParameter ? "${type}*" : "RefPtr<${type}>";
}
# We need to check [ImplementedAs] extended attribute for wrapper types.
@@ -5162,9 +5142,9 @@ sub JSValueToNative
return "V8DOMWrapper::isDOMWrapper($value) ? toWrapperTypeInfo(v8::Handle<v8::Object>::Cast($value))->toEventTarget(v8::Handle<v8::Object>::Cast($value)) : 0";
}
- if ($type eq "ArrayBuffer") {
+ if (IsTypedArrayType($type)) {
AddIncludesForType($type);
- return "$value->IsArrayBuffer() ? V8ArrayBuffer::toNative(v8::Handle<v8::ArrayBuffer>::Cast($value)) : 0"
+ return "$value->Is${type}() ? V8${type}::toNative(v8::Handle<v8::${type}>::Cast($value)) : 0"
}
if ($type eq "XPathNSResolver") {
@@ -5198,7 +5178,7 @@ sub CreateCustomSignature
foreach my $parameter (@{$function->parameters}) {
if ($first) { $first = 0; }
else { $code .= ", "; }
- if (IsWrapperType($parameter->type) && $parameter->type ne "ArrayBuffer") {
+ if (IsWrapperType($parameter->type) && not IsTypedArrayType($parameter->type)) {
if ($parameter->type eq "XPathNSResolver") {
# Special case for XPathNSResolver. All other browsers accepts a callable,
# so, even though it's against IDL, accept objects here.
@@ -5287,7 +5267,7 @@ sub IsCallbackInterface
{
my $type = shift;
return 0 unless IsWrapperType($type);
- return 0 if $type eq "ArrayBuffer";
+ return 0 if IsTypedArrayType($type);
my $idlFile = IDLFileForInterface($type)
or die("Could NOT find IDL file for interface \"$type\"!\n");
diff --git a/third_party/WebKit/Source/bindings/tests/results/V8Float64Array.cpp b/third_party/WebKit/Source/bindings/tests/results/V8Float64Array.cpp
index 2fece9b..b107b10 100644
--- a/third_party/WebKit/Source/bindings/tests/results/V8Float64Array.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/V8Float64Array.cpp
@@ -23,8 +23,6 @@
#include "RuntimeEnabledFeatures.h"
#include "V8ArrayBufferView.h"
-#include "V8Float32Array.h"
-#include "V8Int32Array.h"
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/ScriptController.h"
#include "bindings/v8/V8Binding.h"
@@ -33,6 +31,9 @@
#include "bindings/v8/V8ObjectConstructor.h"
#include "bindings/v8/custom/V8ArrayBufferCustom.h"
#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
+#include "bindings/v8/custom/V8Float32ArrayCustom.h"
+#include "bindings/v8/custom/V8Float64ArrayCustom.h"
+#include "bindings/v8/custom/V8Int32ArrayCustom.h"
#include "core/dom/ContextFeatures.h"
#include "core/dom/Document.h"
#include "core/page/Frame.h"
@@ -76,7 +77,7 @@ static void fooMethod(const v8::FunctionCallbackInfo<v8::Value>& args)
return;
}
Float64Array* imp = V8Float64Array::toNative(args.Holder());
- V8TRYCATCH_VOID(Float32Array*, array, V8Float32Array::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Float32Array::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
+ V8TRYCATCH_VOID(Float32Array*, array, args[0]->IsFloat32Array() ? V8Float32Array::toNative(v8::Handle<v8::Float32Array>::Cast(args[0])) : 0);
v8SetReturnValue(args, toV8(imp->foo(array), args.Holder(), args.GetIsolate()));
return;
}
@@ -100,11 +101,6 @@ static void setMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args)
TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
}
-static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args)
-{
- return constructWebGLArray<Float64Array, V8Float64Array, double>(args, &V8Float64Array::info, v8::kExternalDoubleArray);
-}
-
static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
@@ -169,7 +165,7 @@ static v8::Handle<v8::FunctionTemplate> ConfigureV8Float64ArrayTemplate(v8::Hand
// Custom Signature 'foo'
const int fooArgc = 1;
- v8::Handle<v8::FunctionTemplate> fooArgv[fooArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Float32Array::info, currentWorldType) };
+ v8::Handle<v8::FunctionTemplate> fooArgv[fooArgc] = { v8::Handle<v8::FunctionTemplate>() };
v8::Handle<v8::Signature> fooSignature = v8::Signature::New(desc, fooArgc, fooArgv);
proto->Set(v8::String::NewSymbol("foo"), v8::FunctionTemplate::New(Float64ArrayV8Internal::fooMethodCallback, v8Undefined(), fooSignature, 1));
diff --git a/third_party/WebKit/Source/bindings/tests/results/V8TestObject.cpp b/third_party/WebKit/Source/bindings/tests/results/V8TestObject.cpp
index 7551278..2386c59 100644
--- a/third_party/WebKit/Source/bindings/tests/results/V8TestObject.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/V8TestObject.cpp
@@ -25,7 +25,6 @@
#include "RuntimeEnabledFeatures.h"
#include "V8DOMStringList.h"
#include "V8Document.h"
-#include "V8Float32Array.h"
#include "V8MessagePort.h"
#include "V8Node.h"
#include "V8SVGDocument.h"
@@ -50,6 +49,7 @@
#include "bindings/v8/V8EventListenerList.h"
#include "bindings/v8/V8HiddenPropertyName.h"
#include "bindings/v8/V8ObjectConstructor.h"
+#include "bindings/v8/custom/V8Float32ArrayCustom.h"
#include "core/dom/ContextFeatures.h"
#include "core/dom/CustomElementCallbackDispatcher.h"
#include "core/dom/Document.h"
@@ -845,7 +845,7 @@ static void typedArrayAttrAttrGetterCallback(v8::Local<v8::String> name, const v
static void typedArrayAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
{
TestObj* imp = V8TestObject::toNative(info.Holder());
- V8TRYCATCH_VOID(Float32Array*, v, V8Float32Array::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8Float32Array::toNative(v8::Handle<v8::Object>::Cast(value)) : 0);
+ V8TRYCATCH_VOID(Float32Array*, v, value->IsFloat32Array() ? V8Float32Array::toNative(v8::Handle<v8::Float32Array>::Cast(value)) : 0);
imp->setTypedArrayAttr(WTF::getPtr(v));
return;
}
diff --git a/third_party/WebKit/Source/bindings/tests/results/V8TestOverloadedConstructors.cpp b/third_party/WebKit/Source/bindings/tests/results/V8TestOverloadedConstructors.cpp
index 70493c0..aa56c3c 100644
--- a/third_party/WebKit/Source/bindings/tests/results/V8TestOverloadedConstructors.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/V8TestOverloadedConstructors.cpp
@@ -22,7 +22,6 @@
#include "V8TestOverloadedConstructors.h"
#include "RuntimeEnabledFeatures.h"
-#include "V8ArrayBufferView.h"
#include "V8Blob.h"
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/ScriptController.h"
@@ -31,6 +30,7 @@
#include "bindings/v8/V8DOMWrapper.h"
#include "bindings/v8/V8ObjectConstructor.h"
#include "bindings/v8/custom/V8ArrayBufferCustom.h"
+#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
#include "core/dom/ContextFeatures.h"
#include "core/dom/Document.h"
#include "core/page/Frame.h"
@@ -78,7 +78,7 @@ static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& args)
static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& args)
{
- V8TRYCATCH_VOID(ArrayBufferView*, arrayBufferView, V8ArrayBufferView::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8ArrayBufferView::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
+ V8TRYCATCH_VOID(ArrayBufferView*, arrayBufferView, args[0]->IsArrayBufferView() ? V8ArrayBufferView::toNative(v8::Handle<v8::ArrayBufferView>::Cast(args[0])) : 0);
RefPtr<TestOverloadedConstructors> impl = TestOverloadedConstructors::create(arrayBufferView);
v8::Handle<v8::Object> wrapper = args.Holder();
diff --git a/third_party/WebKit/Source/bindings/v8/Dictionary.cpp b/third_party/WebKit/Source/bindings/v8/Dictionary.cpp
index a25d7fa..199197b 100644
--- a/third_party/WebKit/Source/bindings/v8/Dictionary.cpp
+++ b/third_party/WebKit/Source/bindings/v8/Dictionary.cpp
@@ -36,12 +36,13 @@
#include "V8SpeechRecognitionResult.h"
#include "V8SpeechRecognitionResultList.h"
#include "V8Storage.h"
-#include "V8Uint8Array.h"
#include "V8VoidCallback.h"
#include "V8Window.h"
#include "bindings/v8/ArrayValue.h"
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8Utilities.h"
+#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
+#include "bindings/v8/custom/V8Uint8ArrayCustom.h"
#include "core/dom/DOMStringList.h"
#include "modules/indexeddb/IDBKeyRange.h"
#include "modules/speech/SpeechRecognitionError.h"
diff --git a/third_party/WebKit/Source/bindings/v8/ScriptProfiler.cpp b/third_party/WebKit/Source/bindings/v8/ScriptProfiler.cpp
index 1e34ad8..e7c30bb 100644
--- a/third_party/WebKit/Source/bindings/v8/ScriptProfiler.cpp
+++ b/third_party/WebKit/Source/bindings/v8/ScriptProfiler.cpp
@@ -31,7 +31,6 @@
#include "config.h"
#include "bindings/v8/ScriptProfiler.h"
-#include "V8ArrayBufferView.h"
#include "V8Node.h"
#include "V8Window.h"
#include "bindings/v8/RetainedDOMInfo.h"
@@ -39,6 +38,7 @@
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8DOMWrapper.h"
#include "bindings/v8/WrapperTypeInfo.h"
+#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
#include "core/dom/Document.h"
#include "core/inspector/BindingVisitors.h"
@@ -320,7 +320,7 @@ void ScriptProfiler::visitExternalArrays(ExternalArrayVisitor* visitor)
// GCd during visiting.
ASSERT((*reinterpret_cast<v8::Handle<v8::Value>*>(value))->IsObject());
v8::Handle<v8::Object>* wrapper = reinterpret_cast<v8::Handle<v8::Object>*>(value);
- if (!toWrapperTypeInfo(*wrapper)->isSubclass(&V8ArrayBufferView::info))
+ if (!(*wrapper)->IsArrayBufferView())
return;
m_visitor->visitJSExternalArray(V8ArrayBufferView::toNative(*wrapper));
}
diff --git a/third_party/WebKit/Source/bindings/v8/SerializedScriptValue.cpp b/third_party/WebKit/Source/bindings/v8/SerializedScriptValue.cpp
index 6de4de2..7bd247f 100644
--- a/third_party/WebKit/Source/bindings/v8/SerializedScriptValue.cpp
+++ b/third_party/WebKit/Source/bindings/v8/SerializedScriptValue.cpp
@@ -31,26 +31,26 @@
#include "config.h"
#include "bindings/v8/SerializedScriptValue.h"
-#include "V8ArrayBufferView.h"
#include "V8Blob.h"
#include "V8DOMFileSystem.h"
-#include "V8DataView.h"
#include "V8File.h"
#include "V8FileList.h"
-#include "V8Float32Array.h"
#include "V8ImageData.h"
-#include "V8Int16Array.h"
-#include "V8Int32Array.h"
-#include "V8Int8Array.h"
#include "V8MessagePort.h"
-#include "V8Uint16Array.h"
-#include "V8Uint32Array.h"
-#include "V8Uint8Array.h"
-#include "V8Uint8ClampedArray.h"
-#include "bindings/tests/results/V8Float64Array.h"
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8Utilities.h"
#include "bindings/v8/custom/V8ArrayBufferCustom.h"
+#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
+#include "bindings/v8/custom/V8DataViewCustom.h"
+#include "bindings/v8/custom/V8Float32ArrayCustom.h"
+#include "bindings/v8/custom/V8Float64ArrayCustom.h"
+#include "bindings/v8/custom/V8Int16ArrayCustom.h"
+#include "bindings/v8/custom/V8Int32ArrayCustom.h"
+#include "bindings/v8/custom/V8Int8ArrayCustom.h"
+#include "bindings/v8/custom/V8Uint16ArrayCustom.h"
+#include "bindings/v8/custom/V8Uint32ArrayCustom.h"
+#include "bindings/v8/custom/V8Uint8ArrayCustom.h"
+#include "bindings/v8/custom/V8Uint8ClampedArrayCustom.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/MessagePort.h"
#include "core/fileapi/Blob.h"
diff --git a/third_party/WebKit/Source/bindings/v8/V8Binding.cpp b/third_party/WebKit/Source/bindings/v8/V8Binding.cpp
index 137a7a4..8e01e2d 100644
--- a/third_party/WebKit/Source/bindings/v8/V8Binding.cpp
+++ b/third_party/WebKit/Source/bindings/v8/V8Binding.cpp
@@ -110,6 +110,13 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
return data;
}
+ virtual void* AllocateUninitialized(size_t size) OVERRIDE
+ {
+ void* data;
+ WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents::DontInitialize, data);
+ return data;
+ }
+
virtual void Free(void* data)
{
WTF::ArrayBufferContents::freeMemory(data);
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8ArrayBufferViewCustom.cpp b/third_party/WebKit/Source/bindings/v8/custom/V8ArrayBufferViewCustom.cpp
index 367a723..1d83f4d 100644
--- a/third_party/WebKit/Source/bindings/v8/custom/V8ArrayBufferViewCustom.cpp
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8ArrayBufferViewCustom.cpp
@@ -25,32 +25,63 @@
#include "config.h"
#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
-#include "V8ArrayBufferViewCustomScript.h"
-#include "bindings/v8/V8HiddenPropertyName.h"
-#include "bindings/v8/V8ScriptRunner.h"
+#include "bindings/v8/custom/V8DataViewCustom.h"
+#include "bindings/v8/custom/V8Float32ArrayCustom.h"
+#include "bindings/v8/custom/V8Float64ArrayCustom.h"
+#include "bindings/v8/custom/V8Int16ArrayCustom.h"
+#include "bindings/v8/custom/V8Int32ArrayCustom.h"
+#include "bindings/v8/custom/V8Int8ArrayCustom.h"
+#include "bindings/v8/custom/V8Uint16ArrayCustom.h"
+#include "bindings/v8/custom/V8Uint32ArrayCustom.h"
+#include "bindings/v8/custom/V8Uint8ArrayCustom.h"
+#include "bindings/v8/custom/V8Uint8ClampedArrayCustom.h"
#include <v8.h>
namespace WebCore {
-bool copyElements(v8::Handle<v8::Object> destArray, v8::Handle<v8::Object> srcArray, uint32_t length, uint32_t offset, v8::Isolate* isolate)
+using namespace WTF;
+
+ArrayBufferView* V8ArrayBufferView::toNative(v8::Handle<v8::Object> object)
{
- v8::Handle<v8::Value> prototype_value = destArray->GetPrototype();
- if (prototype_value.IsEmpty() || !prototype_value->IsObject())
- return false;
- v8::Handle<v8::Object> prototype = prototype_value.As<v8::Object>();
- v8::Handle<v8::Value> value = prototype->GetHiddenValue(V8HiddenPropertyName::typedArrayHiddenCopyMethod());
- if (value.IsEmpty()) {
- String source(reinterpret_cast<const char*>(V8ArrayBufferViewCustomScript_js), sizeof(V8ArrayBufferViewCustomScript_js));
- value = V8ScriptRunner::compileAndRunInternalScript(v8String(source, isolate), isolate);
- prototype->SetHiddenValue(V8HiddenPropertyName::typedArrayHiddenCopyMethod(), value);
- }
- if (value.IsEmpty() || !value->IsFunction())
- return false;
- v8::Handle<v8::Function> copy_method = value.As<v8::Function>();
- v8::Handle<v8::Value> arguments[3] = { srcArray, v8::Uint32::New(length), v8::Uint32::New(offset) };
- V8ScriptRunner::callInternalFunction(copy_method, destArray, WTF_ARRAY_LENGTH(arguments), arguments, isolate);
- return true;
-}
+ ASSERT(object->IsArrayBufferView());
+ void* viewPtr = object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex);
+ if (viewPtr)
+ return reinterpret_cast<ArrayBufferView*>(viewPtr);
+ if (object->IsUint8Array()) {
+ return V8Uint8Array::toNative(object);
+ }
+ if (object->IsInt8Array()) {
+ return V8Int8Array::toNative(object);
+ }
+ if (object->IsUint16Array()) {
+ return V8Uint16Array::toNative(object);
+ }
+ if (object->IsInt16Array()) {
+ return V8Int16Array::toNative(object);
+ }
+ if (object->IsUint32Array()) {
+ return V8Uint32Array::toNative(object);
+ }
+ if (object->IsInt32Array()) {
+ return V8Int32Array::toNative(object);
+ }
+ if (object->IsFloat32Array()) {
+ return V8Float32Array::toNative(object);
+ }
+ if (object->IsFloat64Array()) {
+ return V8Float64Array::toNative(object);
+ }
+ if (object->IsUint8ClampedArray()) {
+ return V8Uint8ClampedArray::toNative(object);
+ }
+ if (object->IsDataView()) {
+ return V8DataView::toNative(object);
+ }
+ ASSERT_NOT_REACHED();
+ return 0;
}
+
+
+} // namespace WebCore
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8ArrayBufferViewCustom.h b/third_party/WebKit/Source/bindings/v8/custom/V8ArrayBufferViewCustom.h
index 98de7f5..d39a9d2 100644
--- a/third_party/WebKit/Source/bindings/v8/custom/V8ArrayBufferViewCustom.h
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8ArrayBufferViewCustom.h
@@ -37,273 +37,29 @@
#include "core/dom/ExceptionCode.h"
#include "wtf/ArrayBuffer.h"
+#include "wtf/ArrayBufferView.h"
namespace WebCore {
-const char tooLargeSize[] = "Size is too large (or is negative).";
-const char outOfRangeLengthAndOffset[] = "Index is out of range.";
-// Copy the elements from the source array to the typed destination array.
-// Returns true if it succeeded, otherwise returns false.
-bool copyElements(v8::Handle<v8::Object> destArray, v8::Handle<v8::Object> srcArray, uint32_t length, uint32_t offset, v8::Isolate*);
-
-template<class JavaScriptWrapperArrayType, class ArrayClass>
-void wrapArrayBufferView(const v8::FunctionCallbackInfo<v8::Value>& args, WrapperTypeInfo* type, ArrayClass array, v8::ExternalArrayType arrayType, bool hasIndexer)
-{
- // Transform the holder into a wrapper object for the array.
- ASSERT(!hasIndexer || static_cast<int32_t>(array.get()->length()) >= 0);
- if (hasIndexer)
- args.Holder()->SetIndexedPropertiesToExternalArrayData(array.get()->baseAddress(), arrayType, array.get()->length());
- v8::Handle<v8::Object> wrapper = args.Holder();
- V8DOMWrapper::associateObjectWithWrapper<JavaScriptWrapperArrayType>(array.release(), type, wrapper, args.GetIsolate(), WrapperConfiguration::Independent);
- args.GetReturnValue().Set(wrapper);
-}
-
-// Template function used by the ArrayBufferView*Constructor callbacks.
-template<class ArrayClass, class ElementType, class JavaScriptWrapperArrayType>
-void constructWebGLArrayWithArrayBufferArgument(const v8::FunctionCallbackInfo<v8::Value>& args, WrapperTypeInfo* type, v8::ExternalArrayType arrayType, bool hasIndexer)
-{
- ArrayBuffer* buf = V8ArrayBuffer::toNative(args[0]->ToObject());
- if (!buf) {
- throwTypeError("Could not convert argument 0 to a ArrayBuffer", args.GetIsolate());
- return;
- }
- bool ok;
- uint32_t offset = 0;
- int argLen = args.Length();
- if (argLen > 1) {
- offset = toUInt32(args[1], ok);
- if (!ok) {
- throwTypeError("Could not convert argument 1 to a number", args.GetIsolate());
- return;
- }
- }
- uint32_t length = 0;
- if (argLen > 2) {
- length = toUInt32(args[2], ok);
- if (!ok) {
- throwTypeError("Could not convert argument 2 to a number", args.GetIsolate());
- return;
- }
- } else {
- if ((buf->byteLength() - offset) % sizeof(ElementType)) {
- throwError(v8RangeError, "ArrayBuffer length minus the byteOffset is not a multiple of the element size.", args.GetIsolate());
- return;
- }
- length = (buf->byteLength() - offset) / sizeof(ElementType);
- }
-
- if (static_cast<int32_t>(length) < 0) {
- throwError(v8RangeError, tooLargeSize, args.GetIsolate());
- return;
- }
-
- RefPtr<ArrayClass> array = ArrayClass::create(buf, offset, length);
- if (!array) {
- throwError(v8RangeError, tooLargeSize, args.GetIsolate());
- return;
- }
-
- wrapArrayBufferView<JavaScriptWrapperArrayType>(args, type, array, arrayType, hasIndexer);
-}
-
-// Template function used by the ArrayBufferView*Constructor callbacks.
-template<class ArrayClass, class JavaScriptWrapperArrayType, class ElementType>
-void constructWebGLArray(const v8::FunctionCallbackInfo<v8::Value>& args, WrapperTypeInfo* type, v8::ExternalArrayType arrayType)
-{
- if (!args.IsConstructCall()) {
- throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
- return;
- }
-
- if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
- args.GetReturnValue().Set(args.Holder());
- return;
- }
-
- int argLen = args.Length();
- if (!argLen) {
- // This happens when we return a previously constructed
- // ArrayBufferView, e.g. from the call to <Type>Array.subset().
- // The V8DOMWrapper will set the internal pointer in the
- // created object. Unfortunately it doesn't look like it's
- // possible to distinguish between this case and that where
- // the user calls "new <Type>Array()" from JavaScript. We must
- // construct an empty view to avoid crashes when fetching the
- // length.
- RefPtr<ArrayClass> array = ArrayClass::create(0);
- // Do not call SetIndexedPropertiesToExternalArrayData on this
- // object. Not only is there no point from a performance
- // perspective, but doing so causes errors in the subset() case.
- wrapArrayBufferView<JavaScriptWrapperArrayType>(args, type, array, arrayType, false);
- return;
- }
-
- // Supported constructors:
- // WebGL<T>Array(n) where n is an integer:
- // -- create an empty array of n elements
- // WebGL<T>Array(arr) where arr is an array:
- // -- create a WebGL<T>Array containing the contents of "arr"
- // WebGL<T>Array(buf, offset, length)
- // -- create a WebGL<T>Array pointing to the ArrayBuffer
- // "buf", starting at the specified offset, for the given
- // length
-
- if (args[0]->IsNull()) {
- // Invalid first argument
- throwTypeError(args.GetIsolate());
- return;
- }
-
- // See whether the first argument is a ArrayBuffer.
- if (V8ArrayBuffer::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate()))) {
- constructWebGLArrayWithArrayBufferArgument<ArrayClass, ElementType, JavaScriptWrapperArrayType>(args, type, arrayType, true);
- return;
- }
-
- // See whether the first argument is the same type as impl. In that case,
- // we can simply memcpy data from source to impl.
- if (JavaScriptWrapperArrayType::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate()))) {
- ArrayClass* source = JavaScriptWrapperArrayType::toNative(args[0]->ToObject());
- uint32_t length = source->length();
-
- if (static_cast<int32_t>(length) < 0) {
- throwError(v8RangeError, tooLargeSize, args.GetIsolate());
- return;
- }
-
- RefPtr<ArrayClass> array = ArrayClass::createUninitialized(length);
- if (!array.get()) {
- throwError(v8RangeError, tooLargeSize, args.GetIsolate());
- return;
- }
-
- array->buffer()->setDeallocationObserver(V8ArrayBufferDeallocationObserver::instance());
- v8::V8::AdjustAmountOfExternalAllocatedMemory(array->byteLength());
-
- memcpy(array->baseAddress(), source->baseAddress(), length * sizeof(ElementType));
-
- wrapArrayBufferView<JavaScriptWrapperArrayType>(args, type, array, arrayType, true);
- return;
- }
-
- uint32_t len = 0;
- v8::Handle<v8::Object> srcArray;
- bool doInstantiation = false;
-
- if (args[0]->IsObject()) {
- srcArray = args[0]->ToObject();
- if (srcArray.IsEmpty()) {
- throwTypeError("Could not convert argument 0 to an array", args.GetIsolate());
- return;
- }
- v8::Local<v8::Value> val = srcArray->Get(v8::String::NewSymbol("length"));
- if (val.IsEmpty()) {
- // Exception thrown during fetch of length property.
- return;
- }
- len = toUInt32(val);
- doInstantiation = true;
- } else {
- bool ok = false;
- int32_t tempLength = toInt32(args[0], ok); // NaN/+inf/-inf returns 0, this is intended by WebIDL
- if (ok && tempLength >= 0) {
- len = static_cast<uint32_t>(tempLength);
- doInstantiation = true;
- }
- }
-
- if (static_cast<int32_t>(len) < 0) {
- throwError(v8RangeError, tooLargeSize, args.GetIsolate());
- return;
- }
-
- RefPtr<ArrayClass> array;
- if (doInstantiation) {
- if (srcArray.IsEmpty())
- array = ArrayClass::create(len);
- else
- array = ArrayClass::createUninitialized(len);
- }
-
- if (!array.get()) {
- throwError(v8RangeError, tooLargeSize, args.GetIsolate());
- return;
+class V8ArrayBufferView {
+public:
+ static bool HasInstance(v8::Handle<v8::Value> value, v8::Isolate*, WrapperWorldType)
+ {
+ return value->IsArrayBufferView();
}
-
- if (doInstantiation) {
- array->buffer()->setDeallocationObserver(V8ArrayBufferDeallocationObserver::instance());
- v8::V8::AdjustAmountOfExternalAllocatedMemory(array->byteLength());
- }
-
-
- // Transform the holder into a wrapper object for the array.
- args.Holder()->SetIndexedPropertiesToExternalArrayData(array.get()->baseAddress(), arrayType, array.get()->length());
-
- if (!srcArray.IsEmpty()) {
- bool copied = copyElements(args.Holder(), srcArray, len, 0, args.GetIsolate());
- if (!copied) {
- for (unsigned i = 0; i < len; i++) {
- v8::Local<v8::Value> val = srcArray->Get(i);
- if (val.IsEmpty()) {
- // Exception thrown during fetch.
- return;
- }
- array->set(i, val->NumberValue());
- }
- }
- }
-
- v8::Handle<v8::Object> wrapper = args.Holder();
- V8DOMWrapper::associateObjectWithWrapper<JavaScriptWrapperArrayType>(array.release(), type, wrapper, args.GetIsolate(), WrapperConfiguration::Independent);
- args.GetReturnValue().Set(wrapper);
-}
-
-template <class CPlusPlusArrayType, class JavaScriptWrapperArrayType>
-void setWebGLArrayHelper(const v8::FunctionCallbackInfo<v8::Value>& args)
-{
- if (args.Length() < 1) {
- throwNotEnoughArgumentsError(args.GetIsolate());
- return;
- }
-
- CPlusPlusArrayType* impl = JavaScriptWrapperArrayType::toNative(args.Holder());
-
- if (JavaScriptWrapperArrayType::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate()))) {
- // void set(in WebGL<T>Array array, [Optional] in unsigned long offset);
- CPlusPlusArrayType* src = JavaScriptWrapperArrayType::toNative(args[0]->ToObject());
- uint32_t offset = 0;
- if (args.Length() == 2)
- offset = toUInt32(args[1]);
- if (!impl->set(src, offset)) {
- throwError(v8RangeError, outOfRangeLengthAndOffset, args.GetIsolate());
- return;
- }
- return;
+ static bool HasInstanceInAnyWorld(v8::Handle<v8::Value> value, v8::Isolate*)
+ {
+ return value->IsArrayBufferView();
}
+ static ArrayBufferView* toNative(v8::Handle<v8::Object>);
- if (args[0]->IsObject()) {
- // void set(in sequence<long> array, [Optional] in unsigned long offset);
- v8::Local<v8::Object> array = args[0]->ToObject();
- uint32_t offset = 0;
- if (args.Length() == 2)
- offset = toUInt32(args[1]);
- uint32_t length = toUInt32(array->Get(v8::String::NewSymbol("length")));
- if (!impl->checkInboundData(offset, length)) {
- throwError(v8RangeError, outOfRangeLengthAndOffset, args.GetIsolate());
- return;
- }
- bool copied = copyElements(args.Holder(), array, length, offset, args.GetIsolate());
- if (!copied) {
- for (uint32_t i = 0; i < length; i++)
- impl->set(offset + i, array->Get(i)->NumberValue());
- }
- return;
+ static inline void* toInternalPointer(ArrayBufferView* impl)
+ {
+ return impl;
}
+};
- throwTypeError("Invalid argument", args.GetIsolate());
-}
-
-}
+} // namespace WebCore
#endif // V8ArrayBufferViewCustom_h
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8BlobCustom.cpp b/third_party/WebKit/Source/bindings/v8/custom/V8BlobCustom.cpp
index b13f701..32e35c3 100644
--- a/third_party/WebKit/Source/bindings/v8/custom/V8BlobCustom.cpp
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8BlobCustom.cpp
@@ -31,13 +31,13 @@
#include "config.h"
#include "core/fileapi/Blob.h"
-#include "V8ArrayBufferView.h"
#include "V8Blob.h"
#include "V8File.h"
#include "bindings/v8/Dictionary.h"
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8Utilities.h"
#include "bindings/v8/custom/V8ArrayBufferCustom.h"
+#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
#include "core/fileapi/BlobBuilder.h"
#include "wtf/RefPtr.h"
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8CryptoCustom.cpp b/third_party/WebKit/Source/bindings/v8/custom/V8CryptoCustom.cpp
index 569e9c3..6c6e2fc 100644
--- a/third_party/WebKit/Source/bindings/v8/custom/V8CryptoCustom.cpp
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8CryptoCustom.cpp
@@ -25,10 +25,11 @@
#include "config.h"
#include "V8Crypto.h"
-#include "V8ArrayBufferView.h"
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8Utilities.h"
+#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
+#include "core/dom/ExceptionCode.h"
#include "modules/crypto/Crypto.h"
#include "wtf/ArrayBufferView.h"
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8DataViewCustom.cpp b/third_party/WebKit/Source/bindings/v8/custom/V8DataViewCustom.cpp
index 72b7af1..e07dfa5 100644
--- a/third_party/WebKit/Source/bindings/v8/custom/V8DataViewCustom.cpp
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8DataViewCustom.cpp
@@ -24,37 +24,29 @@
*/
#include "config.h"
-#include "core/html/canvas/DataView.h"
+#include "bindings/v8/custom/V8DataViewCustom.h"
-#include "V8DataView.h"
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
+#include "core/html/canvas/DataView.h"
namespace WebCore {
-void V8DataView::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
+static void initializeScriptWrappableForInterface(DataView* object)
{
- if (!args.Length()) {
- // see constructWebGLArray -- we don't seem to be able to distingish between
- // 'new DataView()' and the call used to construct the cached DataView object.
- RefPtr<DataView> dataView = DataView::create(0);
- v8::Handle<v8::Object> wrapper = args.Holder();
- V8DOMWrapper::associateObjectWithWrapper<V8DataView>(dataView.release(), &info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
- args.GetReturnValue().Set(wrapper);
- return;
- }
- if (args[0]->IsNull() || !V8ArrayBuffer::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate()))) {
- throwTypeError(args.GetIsolate());
- return;
- }
- constructWebGLArrayWithArrayBufferArgument<DataView, char, V8DataView>(args, &info, v8::kExternalByteArray, false);
+ if (ScriptWrappable::wrapperCanBeStoredInObject(object))
+ ScriptWrappable::setTypeInfoInObject(object, &V8DataView::info);
+ else
+ ASSERT_NOT_REACHED();
}
-// FIXME: Don't need this override.
-v8::Handle<v8::Object> wrap(DataView* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+} // namespace WebCore
+
+// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
+// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
+// in the global namespace.
+// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
+void webCoreInitializeScriptWrappableForInterface(WebCore::DataView* object)
{
- ASSERT(impl);
- return V8DataView::createWrapper(impl, creationContext, isolate);
+ WebCore::initializeScriptWrappableForInterface(object);
}
-
-} // namespace WebCore
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8DataViewCustom.h b/third_party/WebKit/Source/bindings/v8/custom/V8DataViewCustom.h
new file mode 100644
index 0000000..67f9781
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8DataViewCustom.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef V8DataViewCustom_h
+#define V8DataViewCustom_h
+
+#include "bindings/v8/custom/V8TypedArrayCustom.h"
+#include "core/html/canvas/DataView.h"
+
+namespace WebCore {
+
+template<>
+class TypedArrayTraits<DataView> {
+public:
+ typedef v8::DataView V8Type;
+
+ static bool IsInstance(v8::Handle<v8::Value> value)
+ {
+ return value->IsDataView();
+ }
+
+ static size_t length(v8::Handle<v8::DataView> value)
+ {
+ return value->ByteLength();
+ }
+
+ static size_t length(DataView* array)
+ {
+ return array->byteLength();
+ }
+};
+
+typedef V8TypedArray<DataView> V8DataView;
+
+template<>
+class WrapperTypeTraits<DataView> : public TypedArrayWrapperTraits<DataView> { };
+
+
+inline v8::Handle<v8::Object> wrap(DataView* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<DataView>::wrap(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8(DataView* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<DataView>::toV8(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8ForMainWorld(DataView* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<DataView>::toV8ForMainWorld(impl, creationContext, isolate);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(DataView* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<DataView>::toV8Fast(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(DataView* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<DataView>::toV8FastForMainWorld(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< DataView > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8FastForMainWorld(impl.get(), container, wrappable);
+}
+
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< DataView > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8Fast(impl.get(), container, wrappable);
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr< DataView > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return toV8(impl.get(), creationContext, isolate);
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8Float32ArrayCustom.h b/third_party/WebKit/Source/bindings/v8/custom/V8Float32ArrayCustom.h
new file mode 100644
index 0000000..f980ea0
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8Float32ArrayCustom.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef V8Float32ArrayCustom_h
+#define V8Float32ArrayCustom_h
+
+#include "bindings/v8/custom/V8TypedArrayCustom.h"
+#include "wtf/Float32Array.h"
+
+namespace WebCore {
+
+template<>
+class TypedArrayTraits<Float32Array> {
+public:
+ typedef v8::Float32Array V8Type;
+
+ static bool IsInstance(v8::Handle<v8::Value> value)
+ {
+ return value->IsFloat32Array();
+ }
+
+ static size_t length(v8::Handle<v8::Float32Array> value)
+ {
+ return value->Length();
+ }
+
+ static size_t length(Float32Array* array)
+ {
+ return array->length();
+ }
+};
+
+typedef V8TypedArray<Float32Array> V8Float32Array;
+
+template<>
+class WrapperTypeTraits<Float32Array> : public TypedArrayWrapperTraits<Float32Array> { };
+
+
+inline v8::Handle<v8::Object> wrap(Float32Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Float32Array>::wrap(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8(Float32Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Float32Array>::toV8(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8ForMainWorld(Float32Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Float32Array>::toV8ForMainWorld(impl, creationContext, isolate);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(Float32Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Float32Array>::toV8Fast(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(Float32Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Float32Array>::toV8FastForMainWorld(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< Float32Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8FastForMainWorld(impl.get(), container, wrappable);
+}
+
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< Float32Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8Fast(impl.get(), container, wrappable);
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr< Float32Array > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return toV8(impl.get(), creationContext, isolate);
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8Float64ArrayCustom.h b/third_party/WebKit/Source/bindings/v8/custom/V8Float64ArrayCustom.h
new file mode 100644
index 0000000..1cabb08
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8Float64ArrayCustom.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef V8Float64ArrayCustom_h
+#define V8Float64ArrayCustom_h
+
+#include "bindings/v8/custom/V8TypedArrayCustom.h"
+#include "wtf/Float64Array.h"
+
+namespace WebCore {
+
+template<>
+class TypedArrayTraits<Float64Array> {
+public:
+ typedef v8::Float64Array V8Type;
+
+ static bool IsInstance(v8::Handle<v8::Value> value)
+ {
+ return value->IsFloat64Array();
+ }
+
+ static size_t length(v8::Handle<v8::Float64Array> value)
+ {
+ return value->Length();
+ }
+
+ static size_t length(Float64Array* array)
+ {
+ return array->length();
+ }
+};
+
+typedef V8TypedArray<Float64Array> V8Float64Array;
+
+template<>
+class WrapperTypeTraits<Float64Array> : public TypedArrayWrapperTraits<Float64Array> { };
+
+
+inline v8::Handle<v8::Object> wrap(Float64Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Float64Array>::wrap(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8(Float64Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Float64Array>::toV8(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8ForMainWorld(Float64Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Float64Array>::toV8ForMainWorld(impl, creationContext, isolate);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(Float64Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Float64Array>::toV8Fast(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(Float64Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Float64Array>::toV8FastForMainWorld(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< Float64Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8FastForMainWorld(impl.get(), container, wrappable);
+}
+
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< Float64Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8Fast(impl.get(), container, wrappable);
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr< Float64Array > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return toV8(impl.get(), creationContext, isolate);
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8ImageDataCustom.cpp b/third_party/WebKit/Source/bindings/v8/custom/V8ImageDataCustom.cpp
index cb35401..3e2e670 100644
--- a/third_party/WebKit/Source/bindings/v8/custom/V8ImageDataCustom.cpp
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8ImageDataCustom.cpp
@@ -31,7 +31,7 @@
#include "config.h"
#include "V8ImageData.h"
-#include "V8Uint8ClampedArray.h"
+#include "bindings/v8/custom/V8Uint8ClampedArrayCustom.h"
namespace WebCore {
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
index 1ac446e..73b8d63 100644
--- a/third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
@@ -32,20 +32,11 @@
#include "V8InjectedScriptHost.h"
#include "V8Database.h"
-#include "V8Float32Array.h"
#include "V8HTMLAllCollection.h"
#include "V8HTMLCollection.h"
-#include "V8Int16Array.h"
-#include "V8Int32Array.h"
-#include "V8Int8Array.h"
#include "V8Node.h"
#include "V8NodeList.h"
#include "V8Storage.h"
-#include "V8Uint16Array.h"
-#include "V8Uint32Array.h"
-#include "V8Uint8Array.h"
-#include "V8Uint8ClampedArray.h"
-#include "bindings/tests/results/V8Float64Array.h"
#include "bindings/v8/BindingSecurity.h"
#include "bindings/v8/ScriptDebugServer.h"
#include "bindings/v8/ScriptValue.h"
@@ -53,6 +44,15 @@
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8HiddenPropertyName.h"
#include "bindings/v8/V8ScriptRunner.h"
+#include "bindings/v8/custom/V8Float32ArrayCustom.h"
+#include "bindings/v8/custom/V8Float64ArrayCustom.h"
+#include "bindings/v8/custom/V8Int16ArrayCustom.h"
+#include "bindings/v8/custom/V8Int32ArrayCustom.h"
+#include "bindings/v8/custom/V8Int8ArrayCustom.h"
+#include "bindings/v8/custom/V8Uint16ArrayCustom.h"
+#include "bindings/v8/custom/V8Uint32ArrayCustom.h"
+#include "bindings/v8/custom/V8Uint8ArrayCustom.h"
+#include "bindings/v8/custom/V8Uint8ClampedArrayCustom.h"
#include "core/inspector/InjectedScript.h"
#include "core/inspector/InjectedScriptHost.h"
#include "core/inspector/InspectorDOMAgent.h"
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8Int16ArrayCustom.h b/third_party/WebKit/Source/bindings/v8/custom/V8Int16ArrayCustom.h
new file mode 100644
index 0000000..f5a7c83
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8Int16ArrayCustom.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef V8Int16ArrayCustom_h
+#define V8Int16ArrayCustom_h
+
+#include "bindings/v8/custom/V8TypedArrayCustom.h"
+#include "wtf/Int16Array.h"
+
+namespace WebCore {
+
+template<>
+class TypedArrayTraits<Int16Array> {
+public:
+ typedef v8::Int16Array V8Type;
+
+ static bool IsInstance(v8::Handle<v8::Value> value)
+ {
+ return value->IsInt16Array();
+ }
+
+ static size_t length(v8::Handle<v8::Int16Array> value)
+ {
+ return value->Length();
+ }
+
+ static size_t length(Int16Array* array)
+ {
+ return array->length();
+ }
+};
+
+typedef V8TypedArray<Int16Array> V8Int16Array;
+
+template<>
+class WrapperTypeTraits<Int16Array> : public TypedArrayWrapperTraits<Int16Array> { };
+
+
+inline v8::Handle<v8::Object> wrap(Int16Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Int16Array>::wrap(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8(Int16Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Int16Array>::toV8(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8ForMainWorld(Int16Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Int16Array>::toV8ForMainWorld(impl, creationContext, isolate);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(Int16Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Int16Array>::toV8Fast(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(Int16Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Int16Array>::toV8FastForMainWorld(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< Int16Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8FastForMainWorld(impl.get(), container, wrappable);
+}
+
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< Int16Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8Fast(impl.get(), container, wrappable);
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr< Int16Array > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return toV8(impl.get(), creationContext, isolate);
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8Int32ArrayCustom.h b/third_party/WebKit/Source/bindings/v8/custom/V8Int32ArrayCustom.h
new file mode 100644
index 0000000..29a927b
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8Int32ArrayCustom.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef V8Int32ArrayCustom_h
+#define V8Int32ArrayCustom_h
+
+#include "bindings/v8/custom/V8TypedArrayCustom.h"
+#include "wtf/Int32Array.h"
+
+namespace WebCore {
+
+template<>
+class TypedArrayTraits<Int32Array> {
+public:
+ typedef v8::Int32Array V8Type;
+
+ static bool IsInstance(v8::Handle<v8::Value> value)
+ {
+ return value->IsInt32Array();
+ }
+
+ static size_t length(v8::Handle<v8::Int32Array> value)
+ {
+ return value->Length();
+ }
+
+ static size_t length(Int32Array* array)
+ {
+ return array->length();
+ }
+};
+
+typedef V8TypedArray<Int32Array> V8Int32Array;
+
+template<>
+class WrapperTypeTraits<Int32Array> : public TypedArrayWrapperTraits<Int32Array> { };
+
+
+inline v8::Handle<v8::Object> wrap(Int32Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Int32Array>::wrap(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8(Int32Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Int32Array>::toV8(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8ForMainWorld(Int32Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Int32Array>::toV8ForMainWorld(impl, creationContext, isolate);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(Int32Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Int32Array>::toV8Fast(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(Int32Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Int32Array>::toV8FastForMainWorld(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< Int32Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8FastForMainWorld(impl.get(), container, wrappable);
+}
+
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< Int32Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8Fast(impl.get(), container, wrappable);
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr< Int32Array > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return toV8(impl.get(), creationContext, isolate);
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8Int8ArrayCustom.h b/third_party/WebKit/Source/bindings/v8/custom/V8Int8ArrayCustom.h
new file mode 100644
index 0000000..f325aba
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8Int8ArrayCustom.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef V8Int8ArrayCustom_h
+#define V8Int8ArrayCustom_h
+
+#include "bindings/v8/custom/V8TypedArrayCustom.h"
+#include "wtf/Int8Array.h"
+
+namespace WebCore {
+
+template<>
+class TypedArrayTraits<Int8Array> {
+public:
+ typedef v8::Int8Array V8Type;
+
+ static bool IsInstance(v8::Handle<v8::Value> value)
+ {
+ return value->IsInt8Array();
+ }
+
+ static size_t length(v8::Handle<v8::Int8Array> value)
+ {
+ return value->Length();
+ }
+
+ static size_t length(Int8Array* array)
+ {
+ return array->length();
+ }
+};
+
+typedef V8TypedArray<Int8Array> V8Int8Array;
+
+template<>
+class WrapperTypeTraits<Int8Array> : public TypedArrayWrapperTraits<Int8Array> { };
+
+
+inline v8::Handle<v8::Object> wrap(Int8Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Int8Array>::wrap(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8(Int8Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Int8Array>::toV8(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8ForMainWorld(Int8Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Int8Array>::toV8ForMainWorld(impl, creationContext, isolate);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(Int8Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Int8Array>::toV8Fast(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(Int8Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Int8Array>::toV8FastForMainWorld(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< Int8Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8FastForMainWorld(impl.get(), container, wrappable);
+}
+
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< Int8Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8Fast(impl.get(), container, wrappable);
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr< Int8Array > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return toV8(impl.get(), creationContext, isolate);
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8TypedArrayCustom.h b/third_party/WebKit/Source/bindings/v8/custom/V8TypedArrayCustom.h
new file mode 100644
index 0000000..44997bf
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8TypedArrayCustom.h
@@ -0,0 +1,189 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef V8TypedArrayCustom_h
+#define V8TypedArrayCustom_h
+
+#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/V8DOMWrapper.h"
+#include "bindings/v8/WrapperTypeInfo.h"
+#include "bindings/v8/custom/V8ArrayBufferCustom.h"
+
+#include "wtf/ArrayBuffer.h"
+
+#include <v8.h>
+
+namespace WebCore {
+
+template<typename T>
+class TypedArrayTraits
+{ };
+
+template<typename TypedArray>
+class V8TypedArray {
+public:
+ static bool HasInstance(v8::Handle<v8::Value> value, v8::Isolate*, WrapperWorldType)
+ {
+ return TypedArrayTraits<TypedArray>::IsInstance(value);
+ }
+
+ static bool HasInstanceInAnyWorld(v8::Handle<v8::Value> value, v8::Isolate*)
+ {
+ return TypedArrayTraits<TypedArray>::IsInstance(value);
+ }
+
+ static TypedArray* toNative(v8::Handle<v8::Object>);
+ static void derefObject(void*);
+ static WrapperTypeInfo info;
+ static const int internalFieldCount = v8DefaultWrapperInternalFieldCount;
+
+ static v8::Handle<v8::Object> wrap(TypedArray* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+ {
+ ASSERT(impl);
+ ASSERT((DOMDataStore::template getWrapper<Binding>(impl, isolate).IsEmpty()));
+ return V8TypedArray<TypedArray>::createWrapper(impl, creationContext, isolate);
+ }
+
+ static v8::Handle<v8::Value> toV8(TypedArray* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+ {
+ if (UNLIKELY(!impl))
+ return v8NullWithCheck(isolate);
+ v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<Binding>(impl, isolate);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return wrap(impl, creationContext, isolate);
+ }
+
+ static v8::Handle<v8::Value> toV8ForMainWorld(TypedArray* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+ {
+ ASSERT(worldType(isolate) == MainWorld);
+ if (UNLIKELY(!impl))
+ return v8NullWithCheck(isolate);
+ v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapperForMainWorld<Binding>(impl);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return wrap(impl, creationContext, isolate);
+ }
+
+ template<class HolderContainer, class Wrappable>
+ static v8::Handle<v8::Value> toV8Fast(TypedArray* impl, const HolderContainer& container, Wrappable* wrappable)
+ {
+ if (UNLIKELY(!impl))
+ return v8::Null(container.GetIsolate());
+ v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperFast<Binding>(impl, container, wrappable);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return wrap(impl, container.Holder(), container.GetIsolate());
+ }
+
+ template<class HolderContainer, class Wrappable>
+ static v8::Handle<v8::Value> toV8FastForMainWorld(TypedArray* impl, const HolderContainer& container, Wrappable* wrappable)
+ {
+ ASSERT(worldType(container.GetIsolate()) == MainWorld);
+ if (UNLIKELY(!impl))
+ return v8::Null(container.GetIsolate());
+ v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapperForMainWorld<Binding>(impl);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return wrap(impl, container.Holder(), container.GetIsolate());
+ }
+
+ static inline void* toInternalPointer(TypedArray* impl)
+ {
+ return impl;
+ }
+private:
+ typedef TypedArrayTraits<TypedArray> Traits;
+ typedef typename Traits::V8Type V8Type;
+ typedef V8TypedArray<TypedArray> Binding;
+
+ static v8::Handle<v8::Object> createWrapper(PassRefPtr<TypedArray>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+};
+
+template<typename TypedArray>
+class TypedArrayWrapperTraits {
+public:
+ static WrapperTypeInfo* info() { return &V8TypedArray<TypedArray>::info; }
+};
+
+
+template <typename TypedArray>
+v8::Handle<v8::Object> V8TypedArray<TypedArray>::createWrapper(PassRefPtr<TypedArray> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ ASSERT(impl.get());
+ ASSERT(DOMDataStore::getWrapper<Binding>(impl.get(), isolate).IsEmpty());
+
+ RefPtr<ArrayBuffer> buffer = impl->buffer();
+ v8::Local<v8::Value> v8Buffer = v8::Local<v8::Value>::New(WebCore::toV8(buffer.get(), creationContext, isolate));
+
+ ASSERT(v8Buffer->IsArrayBuffer());
+
+ v8::Local<v8::Object> wrapper = V8Type::New(v8Buffer.As<v8::ArrayBuffer>(), impl->byteOffset(), Traits::length(impl.get()));
+
+ V8DOMWrapper::associateObjectWithWrapper<Binding>(impl, &info, wrapper, isolate, WrapperConfiguration::Independent);
+ return wrapper;
+}
+
+template <typename TypedArray>
+TypedArray* V8TypedArray<TypedArray>::toNative(v8::Handle<v8::Object> object)
+{
+ ASSERT(Traits::IsInstance(object));
+ void* typedarrayPtr = object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex);
+ if (typedarrayPtr)
+ return reinterpret_cast<TypedArray*>(typedarrayPtr);
+
+ v8::Handle<V8Type> view = object.As<V8Type>();
+ RefPtr<ArrayBuffer> arrayBuffer = V8ArrayBuffer::toNative(view->Buffer());
+ RefPtr<TypedArray> typedArray = TypedArray::create(arrayBuffer, view->ByteOffset(), Traits::length(view));
+ ASSERT(typedArray.get());
+ V8DOMWrapper::associateObjectWithWrapper<Binding>(typedArray.release(), &info, object, v8::Isolate::GetCurrent(), WrapperConfiguration::Independent);
+
+ typedarrayPtr = object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex);
+ ASSERT(typedarrayPtr);
+ return reinterpret_cast<TypedArray*>(typedarrayPtr);
+}
+
+
+template <typename TypedArray>
+WrapperTypeInfo V8TypedArray<TypedArray>::info = {
+ 0, V8TypedArray<TypedArray>::derefObject,
+ 0, 0, 0, 0, 0, WrapperTypeObjectPrototype
+};
+
+template <typename TypedArray>
+void V8TypedArray<TypedArray>::derefObject(void* object)
+{
+ static_cast<TypedArray*>(object)->deref();
+}
+
+
+} // namespace WebCode
+
+#endif // V8TypedArrayCustom_h
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8Uint16ArrayCustom.h b/third_party/WebKit/Source/bindings/v8/custom/V8Uint16ArrayCustom.h
new file mode 100644
index 0000000..30a7403
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8Uint16ArrayCustom.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef V8Uint16ArrayCustom_h
+#define V8Uint16ArrayCustom_h
+
+#include "bindings/v8/custom/V8TypedArrayCustom.h"
+#include "wtf/Uint16Array.h"
+
+namespace WebCore {
+
+template<>
+class TypedArrayTraits<Uint16Array> {
+public:
+ typedef v8::Uint16Array V8Type;
+
+ static bool IsInstance(v8::Handle<v8::Value> value)
+ {
+ return value->IsUint16Array();
+ }
+
+ static size_t length(v8::Handle<v8::Uint16Array> value)
+ {
+ return value->Length();
+ }
+
+ static size_t length(Uint16Array* array)
+ {
+ return array->length();
+ }
+};
+
+typedef V8TypedArray<Uint16Array> V8Uint16Array;
+
+template<>
+class WrapperTypeTraits<Uint16Array> : public TypedArrayWrapperTraits<Uint16Array> { };
+
+
+inline v8::Handle<v8::Object> wrap(Uint16Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Uint16Array>::wrap(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8(Uint16Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Uint16Array>::toV8(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8ForMainWorld(Uint16Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Uint16Array>::toV8ForMainWorld(impl, creationContext, isolate);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(Uint16Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Uint16Array>::toV8Fast(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(Uint16Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Uint16Array>::toV8FastForMainWorld(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< Uint16Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8FastForMainWorld(impl.get(), container, wrappable);
+}
+
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< Uint16Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8Fast(impl.get(), container, wrappable);
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr< Uint16Array > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return toV8(impl.get(), creationContext, isolate);
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8Uint32ArrayCustom.h b/third_party/WebKit/Source/bindings/v8/custom/V8Uint32ArrayCustom.h
new file mode 100644
index 0000000..0f86baa
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8Uint32ArrayCustom.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef V8Uint32ArrayCustom_h
+#define V8Uint32ArrayCustom_h
+
+#include "bindings/v8/custom/V8TypedArrayCustom.h"
+#include "wtf/Uint32Array.h"
+
+namespace WebCore {
+
+template<>
+class TypedArrayTraits<Uint32Array> {
+public:
+ typedef v8::Uint32Array V8Type;
+
+ static bool IsInstance(v8::Handle<v8::Value> value)
+ {
+ return value->IsUint32Array();
+ }
+
+ static size_t length(v8::Handle<v8::Uint32Array> value)
+ {
+ return value->Length();
+ }
+
+ static size_t length(Uint32Array* array)
+ {
+ return array->length();
+ }
+};
+
+typedef V8TypedArray<Uint32Array> V8Uint32Array;
+
+template<>
+class WrapperTypeTraits<Uint32Array> : public TypedArrayWrapperTraits<Uint32Array> { };
+
+
+inline v8::Handle<v8::Object> wrap(Uint32Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Uint32Array>::wrap(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8(Uint32Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Uint32Array>::toV8(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8ForMainWorld(Uint32Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Uint32Array>::toV8ForMainWorld(impl, creationContext, isolate);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(Uint32Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Uint32Array>::toV8Fast(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(Uint32Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Uint32Array>::toV8FastForMainWorld(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< Uint32Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8FastForMainWorld(impl.get(), container, wrappable);
+}
+
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< Uint32Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8Fast(impl.get(), container, wrappable);
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr< Uint32Array > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return toV8(impl.get(), creationContext, isolate);
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8Uint8ArrayCustom.h b/third_party/WebKit/Source/bindings/v8/custom/V8Uint8ArrayCustom.h
new file mode 100644
index 0000000..fffaecd
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8Uint8ArrayCustom.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef V8Uint8ArrayCustom_h
+#define V8Uint8ArrayCustom_h
+
+#include "bindings/v8/custom/V8TypedArrayCustom.h"
+#include "wtf/Uint8Array.h"
+
+namespace WebCore {
+
+template<>
+class TypedArrayTraits<Uint8Array> {
+public:
+ typedef v8::Uint8Array V8Type;
+
+ static bool IsInstance(v8::Handle<v8::Value> value)
+ {
+ return value->IsUint8Array();
+ }
+
+ static size_t length(v8::Handle<v8::Uint8Array> value)
+ {
+ return value->Length();
+ }
+
+ static size_t length(Uint8Array* array)
+ {
+ return array->length();
+ }
+};
+
+typedef V8TypedArray<Uint8Array> V8Uint8Array;
+
+template<>
+class WrapperTypeTraits<Uint8Array> : public TypedArrayWrapperTraits<Uint8Array> { };
+
+
+inline v8::Handle<v8::Object> wrap(Uint8Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Uint8Array>::wrap(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8(Uint8Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Uint8Array>::toV8(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8ForMainWorld(Uint8Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Uint8Array>::toV8ForMainWorld(impl, creationContext, isolate);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(Uint8Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Uint8Array>::toV8Fast(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(Uint8Array* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Uint8Array>::toV8FastForMainWorld(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< Uint8Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8FastForMainWorld(impl.get(), container, wrappable);
+}
+
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< Uint8Array > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8Fast(impl.get(), container, wrappable);
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr< Uint8Array > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return toV8(impl.get(), creationContext, isolate);
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8Uint8ClampedArrayCustom.h b/third_party/WebKit/Source/bindings/v8/custom/V8Uint8ClampedArrayCustom.h
new file mode 100644
index 0000000..2edd476
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8Uint8ClampedArrayCustom.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef V8Uint8ClampedArrayCustom_h
+#define V8Uint8ClampedArrayCustom_h
+
+#include "bindings/v8/custom/V8TypedArrayCustom.h"
+#include "wtf/Uint8ClampedArray.h"
+
+namespace WebCore {
+
+template<>
+class TypedArrayTraits<Uint8ClampedArray> {
+public:
+ typedef v8::Uint8ClampedArray V8Type;
+
+ static bool IsInstance(v8::Handle<v8::Value> value)
+ {
+ return value->IsUint8ClampedArray();
+ }
+
+ static size_t length(v8::Handle<v8::Uint8ClampedArray> value)
+ {
+ return value->Length();
+ }
+
+ static size_t length(Uint8ClampedArray* array)
+ {
+ return array->length();
+ }
+};
+
+typedef V8TypedArray<Uint8ClampedArray> V8Uint8ClampedArray;
+
+template<>
+class WrapperTypeTraits<Uint8ClampedArray> : public TypedArrayWrapperTraits<Uint8ClampedArray> { };
+
+
+inline v8::Handle<v8::Object> wrap(Uint8ClampedArray* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Uint8ClampedArray>::wrap(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8(Uint8ClampedArray* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Uint8ClampedArray>::toV8(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8ForMainWorld(Uint8ClampedArray* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return V8TypedArray<Uint8ClampedArray>::toV8ForMainWorld(impl, creationContext, isolate);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(Uint8ClampedArray* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Uint8ClampedArray>::toV8Fast(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(Uint8ClampedArray* impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return V8TypedArray<Uint8ClampedArray>::toV8FastForMainWorld(impl, container, wrappable);
+}
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8FastForMainWorld(PassRefPtr< Uint8ClampedArray > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8FastForMainWorld(impl.get(), container, wrappable);
+}
+
+
+template<class HolderContainer, class Wrappable>
+inline v8::Handle<v8::Value> toV8Fast(PassRefPtr< Uint8ClampedArray > impl, const HolderContainer& container, Wrappable* wrappable)
+{
+ return toV8Fast(impl.get(), container, wrappable);
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr< Uint8ClampedArray > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ return toV8(impl.get(), creationContext, isolate);
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp b/third_party/WebKit/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
index 18ec9ce..3d2c55a 100644
--- a/third_party/WebKit/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
@@ -32,17 +32,12 @@
#include "V8WebGLRenderingContext.h"
#include "V8ANGLEInstancedArrays.h"
-#include "V8ArrayBufferView.h"
#include "V8EXTFragDepth.h"
#include "V8EXTTextureFilterAnisotropic.h"
-#include "V8Float32Array.h"
#include "V8HTMLCanvasElement.h"
#include "V8HTMLImageElement.h"
#include "V8HTMLVideoElement.h"
#include "V8ImageData.h"
-#include "V8Int16Array.h"
-#include "V8Int32Array.h"
-#include "V8Int8Array.h"
#include "V8OESElementIndexUint.h"
#include "V8OESStandardDerivatives.h"
#include "V8OESTextureFloat.h"
@@ -50,9 +45,6 @@
#include "V8OESTextureHalfFloat.h"
#include "V8OESTextureHalfFloatLinear.h"
#include "V8OESVertexArrayObject.h"
-#include "V8Uint16Array.h"
-#include "V8Uint32Array.h"
-#include "V8Uint8Array.h"
#include "V8WebGLBuffer.h"
#include "V8WebGLCompressedTextureATC.h"
#include "V8WebGLCompressedTexturePVRTC.h"
@@ -72,6 +64,14 @@
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8HiddenPropertyName.h"
+#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
+#include "bindings/v8/custom/V8Float32ArrayCustom.h"
+#include "bindings/v8/custom/V8Int16ArrayCustom.h"
+#include "bindings/v8/custom/V8Int32ArrayCustom.h"
+#include "bindings/v8/custom/V8Int8ArrayCustom.h"
+#include "bindings/v8/custom/V8Uint16ArrayCustom.h"
+#include "bindings/v8/custom/V8Uint32ArrayCustom.h"
+#include "bindings/v8/custom/V8Uint8ArrayCustom.h"
#include "core/dom/ExceptionCode.h"
#include "core/html/canvas/WebGLRenderingContext.h"
#include "core/platform/NotImplemented.h"
diff --git a/third_party/WebKit/Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp b/third_party/WebKit/Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
index 4302221..e9eabc2 100644
--- a/third_party/WebKit/Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
+++ b/third_party/WebKit/Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
@@ -31,7 +31,6 @@
#include "config.h"
#include "V8XMLHttpRequest.h"
-#include "V8ArrayBufferView.h"
#include "V8Blob.h"
#include "V8Document.h"
#include "V8FormData.h"
@@ -40,6 +39,7 @@
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8Utilities.h"
#include "bindings/v8/custom/V8ArrayBufferCustom.h"
+#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
#include "core/dom/Document.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/page/Frame.h"
diff --git a/third_party/WebKit/Source/core/core.gypi b/third_party/WebKit/Source/core/core.gypi
index de6e219..221ea62 100644
--- a/third_party/WebKit/Source/core/core.gypi
+++ b/third_party/WebKit/Source/core/core.gypi
@@ -198,26 +198,16 @@
'html/URL.idl',
'html/ValidityState.idl',
'html/canvas/ANGLEInstancedArrays.idl',
- 'html/canvas/ArrayBufferView.idl',
'html/canvas/CanvasGradient.idl',
'html/canvas/CanvasRenderingContext.idl',
'html/canvas/CanvasRenderingContext2D.idl',
'html/canvas/Canvas2DContextAttributes.idl',
- 'html/canvas/DataView.idl',
+ 'html/canvas/EXTFragDepth.idl',
'html/canvas/EXTTextureFilterAnisotropic.idl',
- 'html/canvas/Float32Array.idl',
- 'html/canvas/Float64Array.idl',
- 'html/canvas/Int16Array.idl',
- 'html/canvas/Int32Array.idl',
- 'html/canvas/Int8Array.idl',
'html/canvas/OESStandardDerivatives.idl',
'html/canvas/OESTextureHalfFloat.idl',
'html/canvas/OESVertexArrayObject.idl',
'html/canvas/Path.idl',
- 'html/canvas/Uint16Array.idl',
- 'html/canvas/Uint32Array.idl',
- 'html/canvas/Uint8Array.idl',
- 'html/canvas/Uint8ClampedArray.idl',
'html/canvas/WebGLActiveInfo.idl',
'html/canvas/WebGLCompressedTextureATC.idl',
'html/canvas/WebGLCompressedTexturePVRTC.idl',
diff --git a/third_party/WebKit/Source/core/html/canvas/Float32Array.idl b/third_party/WebKit/Source/core/html/canvas/Float32Array.idl
deleted file mode 100644
index 09e368b..0000000
--- a/third_party/WebKit/Source/core/html/canvas/Float32Array.idl
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2006, 2010 Apple Computer, Inc. All rights reserved.
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- GlobalContext=Window&WorkerGlobalScope,
- ConstructorTemplate=TypedArray,
- CustomToV8,
- DoNotCheckConstants
-] interface Float32Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 4;
-
- readonly attribute unsigned long length;
- Float32Array subarray([Default=Undefined] optional long start,
- optional long end);
-
- // void set(Float32Array array, optional in unsigned long offset);
- // void set(sequence<long> array, optional in unsigned long offset);
- void set();
-};
diff --git a/third_party/WebKit/Source/core/html/canvas/Float64Array.idl b/third_party/WebKit/Source/core/html/canvas/Float64Array.idl
deleted file mode 100644
index f9335ff..0000000
--- a/third_party/WebKit/Source/core/html/canvas/Float64Array.idl
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- GlobalContext=Window&WorkerGlobalScope,
- ConstructorTemplate=TypedArray,
- CustomToV8,
- DoNotCheckConstants
-] interface Float64Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 8;
-
- readonly attribute unsigned long length;
- Float64Array subarray([Default=Undefined] optional long start,
- optional long end);
-
- // void set(Float64Array array, optional in unsigned long offset);
- // void set(sequence<long> array, optional in unsigned long offset);
- void set();
-};
diff --git a/third_party/WebKit/Source/core/html/canvas/Int16Array.idl b/third_party/WebKit/Source/core/html/canvas/Int16Array.idl
deleted file mode 100644
index 350bcbb..0000000
--- a/third_party/WebKit/Source/core/html/canvas/Int16Array.idl
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2006, 2010 Apple Computer, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- GlobalContext=Window&WorkerGlobalScope,
- ConstructorTemplate=TypedArray,
- CustomToV8,
- DoNotCheckConstants
-] interface Int16Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 2;
-
- readonly attribute unsigned long length;
- Int16Array subarray([Default=Undefined] optional long start,
- optional long end);
-
- // void set(Int16Array array, optional in unsigned long offset);
- // void set(sequence<long> array, optional in unsigned long offset);
- void set();
-};
diff --git a/third_party/WebKit/Source/core/html/canvas/Int32Array.idl b/third_party/WebKit/Source/core/html/canvas/Int32Array.idl
deleted file mode 100644
index 7b28526..0000000
--- a/third_party/WebKit/Source/core/html/canvas/Int32Array.idl
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- GlobalContext=Window&WorkerGlobalScope,
- ConstructorTemplate=TypedArray,
- CustomToV8,
- DoNotCheckConstants
-] interface Int32Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 4;
-
- readonly attribute unsigned long length;
- Int32Array subarray([Default=Undefined] optional long start,
- optional long end);
-
- // void set(Int32Array array, optional in unsigned long offset);
- // void set(sequence<long> array, optional in unsigned long offset);
- void set();
-};
diff --git a/third_party/WebKit/Source/core/html/canvas/Int8Array.idl b/third_party/WebKit/Source/core/html/canvas/Int8Array.idl
deleted file mode 100644
index 0cd83d5..0000000
--- a/third_party/WebKit/Source/core/html/canvas/Int8Array.idl
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- GlobalContext=Window&WorkerGlobalScope,
- ConstructorTemplate=TypedArray,
- CustomToV8,
- DoNotCheckConstants
-] interface Int8Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 1;
-
- readonly attribute unsigned long length;
- Int8Array subarray([Default=Undefined] optional long start,
- optional long end);
-
- // void set(Int8Array array, optional in unsigned long offset);
- // void set(sequence<long> array, optional in unsigned long offset);
- void set();
-};
diff --git a/third_party/WebKit/Source/core/html/canvas/Uint16Array.idl b/third_party/WebKit/Source/core/html/canvas/Uint16Array.idl
deleted file mode 100644
index dd62b02..0000000
--- a/third_party/WebKit/Source/core/html/canvas/Uint16Array.idl
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- GlobalContext=Window&WorkerGlobalScope,
- ConstructorTemplate=TypedArray,
- CustomToV8,
- DoNotCheckConstants
-] interface Uint16Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 2;
-
- readonly attribute unsigned long length;
- Uint16Array subarray([Default=Undefined] optional long start, optional long end);
-
- // void set(Uint16Array array, optional in unsigned long offset);
- // void set(sequence<long> array, optional in unsigned long offset);
- void set();
-};
diff --git a/third_party/WebKit/Source/core/html/canvas/Uint32Array.idl b/third_party/WebKit/Source/core/html/canvas/Uint32Array.idl
deleted file mode 100644
index d47c7ca..0000000
--- a/third_party/WebKit/Source/core/html/canvas/Uint32Array.idl
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- GlobalContext=Window&WorkerGlobalScope,
- ConstructorTemplate=TypedArray,
- CustomToV8,
- DoNotCheckConstants
-] interface Uint32Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 4;
-
- readonly attribute unsigned long length;
- Uint32Array subarray([Default=Undefined] optional long start, optional long end);
-
- // void set(Uint32Array array, optional in unsigned long offset);
- // void set(sequence<long> array, optional in unsigned long offset);
- void set();
-};
diff --git a/third_party/WebKit/Source/core/html/canvas/Uint8Array.idl b/third_party/WebKit/Source/core/html/canvas/Uint8Array.idl
deleted file mode 100644
index 6058506..0000000
--- a/third_party/WebKit/Source/core/html/canvas/Uint8Array.idl
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- GlobalContext=Window&WorkerGlobalScope,
- ConstructorTemplate=TypedArray,
- CustomToV8,
- DoNotCheckConstants
-] interface Uint8Array : ArrayBufferView {
- const unsigned long BYTES_PER_ELEMENT = 1;
-
- readonly attribute unsigned long length;
- Uint8Array subarray([Default=Undefined] optional long start, optional long end);
-
- // void set(Uint8Array array, optional in unsigned long offset);
- // void set(sequence<long> array, optional in unsigned long offset);
- void set();
-};
diff --git a/third_party/WebKit/Source/core/html/canvas/Uint8ClampedArray.idl b/third_party/WebKit/Source/core/html/canvas/Uint8ClampedArray.idl
deleted file mode 100644
index 66c9289..0000000
--- a/third_party/WebKit/Source/core/html/canvas/Uint8ClampedArray.idl
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- GlobalContext=Window&WorkerGlobalScope,
- ConstructorTemplate=TypedArray,
- CustomToV8,
- DoNotCheckConstants
-] interface Uint8ClampedArray : Uint8Array {
- const unsigned long BYTES_PER_ELEMENT = 1;
-
- readonly attribute unsigned long length;
- Uint8ClampedArray subarray([Default=Undefined] optional long start, optional long end);
-
- // FIXME: Missing other setters!
- // void set(Uint8ClampedArray array, optional in unsigned long offset);
- // void set(sequence<long> array, optional in unsigned long offset);
- void set();
-};
diff --git a/third_party/WebKit/Source/web/WebArrayBufferView.cpp b/third_party/WebKit/Source/web/WebArrayBufferView.cpp
index ae05b7c..044ace4 100644
--- a/third_party/WebKit/Source/web/WebArrayBufferView.cpp
+++ b/third_party/WebKit/Source/web/WebArrayBufferView.cpp
@@ -29,7 +29,7 @@
#include "config.h"
#include "WebArrayBufferView.h"
-#include "V8ArrayBufferView.h"
+#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
#include "wtf/ArrayBufferView.h"
using namespace WTF;
@@ -63,7 +63,7 @@ unsigned WebArrayBufferView::byteLength() const
WebArrayBufferView* WebArrayBufferView::createFromV8Value(v8::Handle<v8::Value> value)
{
- if (!WebCore::V8ArrayBufferView::HasInstanceInAnyWorld(value, v8::Isolate::GetCurrent()))
+ if (!value->IsArrayBufferView())
return 0;
ArrayBufferView* view = WebCore::V8ArrayBufferView::toNative(value->ToObject());
return new WebArrayBufferView(view);
diff --git a/third_party/WebKit/Source/web/WebBindings.cpp b/third_party/WebKit/Source/web/WebBindings.cpp
index dacdc25..664b8d7 100644
--- a/third_party/WebKit/Source/web/WebBindings.cpp
+++ b/third_party/WebKit/Source/web/WebBindings.cpp
@@ -31,7 +31,6 @@
#include "config.h"
#include "WebBindings.h"
-#include "V8ArrayBufferView.h"
#include "V8Element.h"
#include "V8Range.h"
#include "WebArrayBufferView.h"
@@ -42,6 +41,7 @@
#include "bindings/v8/V8DOMWrapper.h"
#include "bindings/v8/V8NPUtils.h"
#include "bindings/v8/custom/V8ArrayBufferCustom.h"
+#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
#include "bindings/v8/npruntime_impl.h"
#include "bindings/v8/npruntime_priv.h"
#include "core/dom/Range.h"
diff --git a/third_party/WebKit/Source/web/WebKit.cpp b/third_party/WebKit/Source/web/WebKit.cpp
index 3e16662..918034d 100644
--- a/third_party/WebKit/Source/web/WebKit.cpp
+++ b/third_party/WebKit/Source/web/WebKit.cpp
@@ -103,8 +103,8 @@ void initialize(Platform* platform)
v8::V8::SetEntropySource(&generateEntropy);
v8::V8::SetArrayBufferAllocator(WebCore::v8ArrayBufferAllocator());
- static const char* kArrayBufferFlag = "--harmony_array_buffer";
- v8::V8::SetFlagsFromString(kArrayBufferFlag, strlen(kArrayBufferFlag));
+ static const char* kTypedArraysFlag = "--harmony_array_buffer --harmony_typed_arrays";
+ v8::V8::SetFlagsFromString(kTypedArraysFlag, strlen(kTypedArraysFlag));
v8::V8::Initialize();
WebCore::V8PerIsolateData::ensureInitialized(v8::Isolate::GetCurrent());