| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
| 6 | 6 |
| 7 #include "config.h" | 7 #include "config.h" |
| 8 #include "V8Uint8ClampedArray.h" | 8 #include "V8Uint8ClampedArray.h" |
| 9 | 9 |
| 10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
| 11 #include "bindings/core/v8/V8ArrayBuffer.h" | 11 #include "bindings/core/v8/V8ArrayBuffer.h" |
| 12 #include "bindings/core/v8/V8DOMConfiguration.h" | 12 #include "bindings/core/v8/V8DOMConfiguration.h" |
| 13 #include "bindings/core/v8/V8ObjectConstructor.h" | 13 #include "bindings/core/v8/V8ObjectConstructor.h" |
| 14 #include "bindings/core/v8/V8SharedArrayBuffer.h" |
| 14 #include "core/dom/ContextFeatures.h" | 15 #include "core/dom/ContextFeatures.h" |
| 15 #include "core/dom/Document.h" | 16 #include "core/dom/Document.h" |
| 16 #include "platform/RuntimeEnabledFeatures.h" | 17 #include "platform/RuntimeEnabledFeatures.h" |
| 17 #include "platform/TraceEvent.h" | 18 #include "platform/TraceEvent.h" |
| 18 #include "wtf/GetPtr.h" | 19 #include "wtf/GetPtr.h" |
| 19 #include "wtf/RefPtr.h" | 20 #include "wtf/RefPtr.h" |
| 20 | 21 |
| 21 namespace blink { | 22 namespace blink { |
| 22 | 23 |
| 23 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial | 24 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial |
| (...skipping 17 matching lines...) Expand all Loading... |
| 41 } | 42 } |
| 42 | 43 |
| 43 TestUint8ClampedArray* V8Uint8ClampedArray::toImpl(v8::Local<v8::Object> object) | 44 TestUint8ClampedArray* V8Uint8ClampedArray::toImpl(v8::Local<v8::Object> object) |
| 44 { | 45 { |
| 45 ASSERT(object->IsUint8ClampedArray()); | 46 ASSERT(object->IsUint8ClampedArray()); |
| 46 ScriptWrappable* scriptWrappable = toScriptWrappable(object); | 47 ScriptWrappable* scriptWrappable = toScriptWrappable(object); |
| 47 if (scriptWrappable) | 48 if (scriptWrappable) |
| 48 return scriptWrappable->toImpl<TestUint8ClampedArray>(); | 49 return scriptWrappable->toImpl<TestUint8ClampedArray>(); |
| 49 | 50 |
| 50 v8::Local<v8::Uint8ClampedArray> v8View = object.As<v8::Uint8ClampedArray>()
; | 51 v8::Local<v8::Uint8ClampedArray> v8View = object.As<v8::Uint8ClampedArray>()
; |
| 51 RefPtr<TestUint8ClampedArray> typedArray = TestUint8ClampedArray::create(V8A
rrayBuffer::toImpl(v8View->Buffer()), v8View->ByteOffset(), v8View->Length()); | 52 v8::Local<v8::Object> arrayBuffer = v8View->Buffer(); |
| 53 RefPtr<TestUint8ClampedArray> typedArray; |
| 54 if (arrayBuffer->IsArrayBuffer()) { |
| 55 typedArray = TestUint8ClampedArray::create(V8ArrayBuffer::toImpl(arrayBu
ffer), v8View->ByteOffset(), v8View->Length()); |
| 56 } else if (arrayBuffer->IsSharedArrayBuffer()) { |
| 57 typedArray = TestUint8ClampedArray::create(V8SharedArrayBuffer::toImpl(a
rrayBuffer), v8View->ByteOffset(), v8View->Length()); |
| 58 } else { |
| 59 ASSERT_NOT_REACHED(); |
| 60 } |
| 52 v8::Local<v8::Object> associatedWrapper = typedArray->associateWithWrapper(v
8::Isolate::GetCurrent(), typedArray->wrapperTypeInfo(), object); | 61 v8::Local<v8::Object> associatedWrapper = typedArray->associateWithWrapper(v
8::Isolate::GetCurrent(), typedArray->wrapperTypeInfo(), object); |
| 53 ASSERT_UNUSED(associatedWrapper, associatedWrapper == object); | 62 ASSERT_UNUSED(associatedWrapper, associatedWrapper == object); |
| 54 | 63 |
| 55 return typedArray->toImpl<TestUint8ClampedArray>(); | 64 return typedArray->toImpl<TestUint8ClampedArray>(); |
| 56 } | 65 } |
| 57 | 66 |
| 58 TestUint8ClampedArray* V8Uint8ClampedArray::toImplWithTypeCheck(v8::Isolate* iso
late, v8::Local<v8::Value> value) | 67 TestUint8ClampedArray* V8Uint8ClampedArray::toImplWithTypeCheck(v8::Isolate* iso
late, v8::Local<v8::Value> value) |
| 59 { | 68 { |
| 60 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; | 69 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; |
| 61 } | 70 } |
| 62 | 71 |
| 63 void V8Uint8ClampedArray::refObject(ScriptWrappable* scriptWrappable) | 72 void V8Uint8ClampedArray::refObject(ScriptWrappable* scriptWrappable) |
| 64 { | 73 { |
| 65 scriptWrappable->toImpl<TestUint8ClampedArray>()->ref(); | 74 scriptWrappable->toImpl<TestUint8ClampedArray>()->ref(); |
| 66 } | 75 } |
| 67 | 76 |
| 68 void V8Uint8ClampedArray::derefObject(ScriptWrappable* scriptWrappable) | 77 void V8Uint8ClampedArray::derefObject(ScriptWrappable* scriptWrappable) |
| 69 { | 78 { |
| 70 scriptWrappable->toImpl<TestUint8ClampedArray>()->deref(); | 79 scriptWrappable->toImpl<TestUint8ClampedArray>()->deref(); |
| 71 } | 80 } |
| 72 | 81 |
| 73 } // namespace blink | 82 } // namespace blink |
| OLD | NEW |