| 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 28 matching lines...) Expand all Loading... |
| 39 if (v8buffer->IsExternal()) { | 39 if (v8buffer->IsExternal()) { |
| 40 const WrapperTypeInfo* wrapperTypeInfo = toWrapperTypeInfo(object); | 40 const WrapperTypeInfo* wrapperTypeInfo = toWrapperTypeInfo(object); |
| 41 RELEASE_ASSERT(wrapperTypeInfo); | 41 RELEASE_ASSERT(wrapperTypeInfo); |
| 42 RELEASE_ASSERT(wrapperTypeInfo->ginEmbedder == gin::kEmbedderBlink); | 42 RELEASE_ASSERT(wrapperTypeInfo->ginEmbedder == gin::kEmbedderBlink); |
| 43 return toScriptWrappable(object)->toImpl<TestArrayBuffer>(); | 43 return toScriptWrappable(object)->toImpl<TestArrayBuffer>(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 // Transfer the ownership of the allocated memory to an ArrayBuffer without | 46 // Transfer the ownership of the allocated memory to an ArrayBuffer without |
| 47 // copying. | 47 // copying. |
| 48 v8::ArrayBuffer::Contents v8Contents = v8buffer->Externalize(); | 48 v8::ArrayBuffer::Contents v8Contents = v8buffer->Externalize(); |
| 49 WTF::ArrayBufferContents contents(v8Contents.Data(), v8Contents.ByteLength()
); | 49 WTF::ArrayBufferContents contents(v8Contents.Data(), v8Contents.ByteLength()
, WTF::ArrayBufferContents::NotShared); |
| 50 RefPtr<TestArrayBuffer> buffer = TestArrayBuffer::create(contents); | 50 RefPtr<TestArrayBuffer> buffer = TestArrayBuffer::create(contents); |
| 51 buffer->associateWithWrapper(v8::Isolate::GetCurrent(), buffer->wrapperTypeI
nfo(), object); | 51 buffer->associateWithWrapper(v8::Isolate::GetCurrent(), buffer->wrapperTypeI
nfo(), object); |
| 52 | 52 |
| 53 return buffer.get(); | 53 return buffer.get(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 TestArrayBuffer* V8ArrayBuffer::toImplWithTypeCheck(v8::Isolate* isolate, v8::Lo
cal<v8::Value> value) | 56 TestArrayBuffer* V8ArrayBuffer::toImplWithTypeCheck(v8::Isolate* isolate, v8::Lo
cal<v8::Value> value) |
| 57 { | 57 { |
| 58 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; | 58 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; |
| 59 } | 59 } |
| 60 | 60 |
| 61 void V8ArrayBuffer::refObject(ScriptWrappable* scriptWrappable) | 61 void V8ArrayBuffer::refObject(ScriptWrappable* scriptWrappable) |
| 62 { | 62 { |
| 63 scriptWrappable->toImpl<TestArrayBuffer>()->ref(); | 63 scriptWrappable->toImpl<TestArrayBuffer>()->ref(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void V8ArrayBuffer::derefObject(ScriptWrappable* scriptWrappable) | 66 void V8ArrayBuffer::derefObject(ScriptWrappable* scriptWrappable) |
| 67 { | 67 { |
| 68 scriptWrappable->toImpl<TestArrayBuffer>()->deref(); | 68 scriptWrappable->toImpl<TestArrayBuffer>()->deref(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 } // namespace blink | 71 } // namespace blink |
| OLD | NEW |