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 "V8ArrayBuffer.h" | 8 #include "V8ArrayBuffer.h" |
9 | 9 |
10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 // Transfer the ownership of the allocated memory to an ArrayBuffer without | 48 // Transfer the ownership of the allocated memory to an ArrayBuffer without |
49 // copying. | 49 // copying. |
50 v8::ArrayBuffer::Contents v8Contents = v8buffer->Externalize(); | 50 v8::ArrayBuffer::Contents v8Contents = v8buffer->Externalize(); |
51 WTF::ArrayBufferContents contents(v8Contents.Data(), v8Contents.ByteLength()
, 0); | 51 WTF::ArrayBufferContents contents(v8Contents.Data(), v8Contents.ByteLength()
, 0); |
52 RefPtr<TestArrayBuffer> buffer = TestArrayBuffer::create(contents); | 52 RefPtr<TestArrayBuffer> buffer = TestArrayBuffer::create(contents); |
53 // Since this transfer doesn't allocate new memory, do not call | 53 // Since this transfer doesn't allocate new memory, do not call |
54 // DOMArrayBufferDeallocationObserver::blinkAllocatedMemory. | 54 // DOMArrayBufferDeallocationObserver::blinkAllocatedMemory. |
55 buffer->buffer()->setDeallocationObserverWithoutAllocationNotification( | 55 buffer->buffer()->setDeallocationObserverWithoutAllocationNotification( |
56 DOMArrayBufferDeallocationObserver::instance()); | 56 DOMArrayBufferDeallocationObserver::instance()); |
57 buffer->associateWithWrapper(buffer->wrapperTypeInfo(), object, v8::Isolate:
:GetCurrent()); | 57 buffer->associateWithWrapper(v8::Isolate::GetCurrent(), buffer->wrapperTypeI
nfo(), object); |
58 | 58 |
59 return buffer.get(); | 59 return buffer.get(); |
60 } | 60 } |
61 | 61 |
62 TestArrayBuffer* V8ArrayBuffer::toImplWithTypeCheck(v8::Isolate* isolate, v8::Ha
ndle<v8::Value> value) | 62 TestArrayBuffer* V8ArrayBuffer::toImplWithTypeCheck(v8::Isolate* isolate, v8::Ha
ndle<v8::Value> value) |
63 { | 63 { |
64 return hasInstance(value, isolate) ? toImpl(v8::Handle<v8::Object>::Cast(val
ue)) : 0; | 64 return hasInstance(value, isolate) ? toImpl(v8::Handle<v8::Object>::Cast(val
ue)) : 0; |
65 } | 65 } |
66 | 66 |
67 void V8ArrayBuffer::refObject(ScriptWrappable* scriptWrappable) | 67 void V8ArrayBuffer::refObject(ScriptWrappable* scriptWrappable) |
68 { | 68 { |
69 scriptWrappable->toImpl<TestArrayBuffer>()->ref(); | 69 scriptWrappable->toImpl<TestArrayBuffer>()->ref(); |
70 } | 70 } |
71 | 71 |
72 void V8ArrayBuffer::derefObject(ScriptWrappable* scriptWrappable) | 72 void V8ArrayBuffer::derefObject(ScriptWrappable* scriptWrappable) |
73 { | 73 { |
74 scriptWrappable->toImpl<TestArrayBuffer>()->deref(); | 74 scriptWrappable->toImpl<TestArrayBuffer>()->deref(); |
75 } | 75 } |
76 | 76 |
77 template<> | 77 template<> |
78 v8::Handle<v8::Value> toV8NoInline(TestArrayBuffer* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) | 78 v8::Handle<v8::Value> toV8NoInline(TestArrayBuffer* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) |
79 { | 79 { |
80 return toV8(impl, creationContext, isolate); | 80 return toV8(impl, creationContext, isolate); |
81 } | 81 } |
82 | 82 |
83 } // namespace blink | 83 } // namespace blink |
OLD | NEW |