| 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 "V8TestInterfaceWillBeGarbageCollected.h" | 8 #include "V8TestInterfaceWillBeGarbageCollected.h" |
| 9 | 9 |
| 10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // bindings/core/v8/ScriptWrappable.h. | 43 // bindings/core/v8/ScriptWrappable.h. |
| 44 const WrapperTypeInfo& TestInterfaceWillBeGarbageCollected::s_wrapperTypeInfo =
V8TestInterfaceWillBeGarbageCollected::wrapperTypeInfo; | 44 const WrapperTypeInfo& TestInterfaceWillBeGarbageCollected::s_wrapperTypeInfo =
V8TestInterfaceWillBeGarbageCollected::wrapperTypeInfo; |
| 45 | 45 |
| 46 namespace TestInterfaceWillBeGarbageCollectedV8Internal { | 46 namespace TestInterfaceWillBeGarbageCollectedV8Internal { |
| 47 | 47 |
| 48 template <typename T> void V8_USE(T) { } | 48 template <typename T> void V8_USE(T) { } |
| 49 | 49 |
| 50 static void attr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info
) | 50 static void attr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info
) |
| 51 { | 51 { |
| 52 v8::Handle<v8::Object> holder = info.Holder(); | 52 v8::Handle<v8::Object> holder = info.Holder(); |
| 53 TestInterfaceWillBeGarbageCollected* impl = V8TestInterfaceWillBeGarbageColl
ected::toNative(holder); | 53 TestInterfaceWillBeGarbageCollected* impl = V8TestInterfaceWillBeGarbageColl
ected::toImpl(holder); |
| 54 v8SetReturnValueFast(info, WTF::getPtr(impl->attr1()), impl); | 54 v8SetReturnValueFast(info, WTF::getPtr(impl->attr1()), impl); |
| 55 } | 55 } |
| 56 | 56 |
| 57 static void attr1AttributeGetterCallback(v8::Local<v8::String>, const v8::Proper
tyCallbackInfo<v8::Value>& info) | 57 static void attr1AttributeGetterCallback(v8::Local<v8::String>, const v8::Proper
tyCallbackInfo<v8::Value>& info) |
| 58 { | 58 { |
| 59 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 59 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
| 60 TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeGetter(info); | 60 TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeGetter(info); |
| 61 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 61 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 62 } | 62 } |
| 63 | 63 |
| 64 static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::Propert
yCallbackInfo<void>& info) | 64 static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::Propert
yCallbackInfo<void>& info) |
| 65 { | 65 { |
| 66 v8::Handle<v8::Object> holder = info.Holder(); | 66 v8::Handle<v8::Object> holder = info.Holder(); |
| 67 TestInterfaceWillBeGarbageCollected* impl = V8TestInterfaceWillBeGarbageColl
ected::toNative(holder); | 67 TestInterfaceWillBeGarbageCollected* impl = V8TestInterfaceWillBeGarbageColl
ected::toImpl(holder); |
| 68 TONATIVE_VOID(TestInterfaceWillBeGarbageCollected*, cppValue, V8TestInterfac
eWillBeGarbageCollected::toNativeWithTypeCheck(info.GetIsolate(), v8Value)); | 68 TONATIVE_VOID(TestInterfaceWillBeGarbageCollected*, cppValue, V8TestInterfac
eWillBeGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value)); |
| 69 impl->setAttr1(WTF::getPtr(cppValue)); | 69 impl->setAttr1(WTF::getPtr(cppValue)); |
| 70 } | 70 } |
| 71 | 71 |
| 72 static void attr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Va
lue> v8Value, const v8::PropertyCallbackInfo<void>& info) | 72 static void attr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Va
lue> v8Value, const v8::PropertyCallbackInfo<void>& info) |
| 73 { | 73 { |
| 74 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 74 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
| 75 TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeSetter(v8Value,
info); | 75 TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeSetter(v8Value,
info); |
| 76 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 76 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 77 } | 77 } |
| 78 | 78 |
| 79 static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 79 static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 80 { | 80 { |
| 81 if (UNLIKELY(info.Length() < 1)) { | 81 if (UNLIKELY(info.Length() < 1)) { |
| 82 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("f
unc", "TestInterfaceWillBeGarbageCollected", 1, info.Length(), info.GetIsolate()
), info.GetIsolate()); | 82 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("f
unc", "TestInterfaceWillBeGarbageCollected", 1, info.Length(), info.GetIsolate()
), info.GetIsolate()); |
| 83 return; | 83 return; |
| 84 } | 84 } |
| 85 TestInterfaceWillBeGarbageCollected* impl = V8TestInterfaceWillBeGarbageColl
ected::toNative(info.Holder()); | 85 TestInterfaceWillBeGarbageCollected* impl = V8TestInterfaceWillBeGarbageColl
ected::toImpl(info.Holder()); |
| 86 TestInterfaceWillBeGarbageCollected* arg; | 86 TestInterfaceWillBeGarbageCollected* arg; |
| 87 { | 87 { |
| 88 v8::TryCatch block; | 88 v8::TryCatch block; |
| 89 V8RethrowTryCatchScope rethrow(block); | 89 V8RethrowTryCatchScope rethrow(block); |
| 90 TONATIVE_VOID_INTERNAL(arg, V8TestInterfaceWillBeGarbageCollected::toNat
iveWithTypeCheck(info.GetIsolate(), info[0])); | 90 TONATIVE_VOID_INTERNAL(arg, V8TestInterfaceWillBeGarbageCollected::toImp
lWithTypeCheck(info.GetIsolate(), info[0])); |
| 91 } | 91 } |
| 92 impl->func(arg); | 92 impl->func(arg); |
| 93 } | 93 } |
| 94 | 94 |
| 95 static void funcMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 95 static void funcMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 96 { | 96 { |
| 97 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | 97 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
| 98 TestInterfaceWillBeGarbageCollectedV8Internal::funcMethod(info); | 98 TestInterfaceWillBeGarbageCollectedV8Internal::funcMethod(info); |
| 99 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 99 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 100 } | 100 } |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 bool V8TestInterfaceWillBeGarbageCollected::hasInstance(v8::Handle<v8::Value> v8
Value, v8::Isolate* isolate) | 213 bool V8TestInterfaceWillBeGarbageCollected::hasInstance(v8::Handle<v8::Value> v8
Value, v8::Isolate* isolate) |
| 214 { | 214 { |
| 215 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); | 215 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); |
| 216 } | 216 } |
| 217 | 217 |
| 218 v8::Handle<v8::Object> V8TestInterfaceWillBeGarbageCollected::findInstanceInProt
otypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) | 218 v8::Handle<v8::Object> V8TestInterfaceWillBeGarbageCollected::findInstanceInProt
otypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) |
| 219 { | 219 { |
| 220 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 220 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
| 221 } | 221 } |
| 222 | 222 |
| 223 TestInterfaceWillBeGarbageCollected* V8TestInterfaceWillBeGarbageCollected::toNa
tiveWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value) | 223 TestInterfaceWillBeGarbageCollected* V8TestInterfaceWillBeGarbageCollected::toIm
plWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value) |
| 224 { | 224 { |
| 225 return hasInstance(value, isolate) ? fromInternalPointer(blink::toInternalPo
inter(v8::Handle<v8::Object>::Cast(value))) : 0; | 225 return hasInstance(value, isolate) ? blink::toScriptWrappableBase(v8::Handle
<v8::Object>::Cast(value))->toImpl<TestInterfaceWillBeGarbageCollected>() : 0; |
| 226 } | 226 } |
| 227 | 227 |
| 228 EventTarget* V8TestInterfaceWillBeGarbageCollected::toEventTarget(v8::Handle<v8:
:Object> object) | 228 EventTarget* V8TestInterfaceWillBeGarbageCollected::toEventTarget(v8::Handle<v8:
:Object> object) |
| 229 { | 229 { |
| 230 return toNative(object); | 230 return toImpl(object); |
| 231 } | 231 } |
| 232 | 232 |
| 233 | 233 |
| 234 void V8TestInterfaceWillBeGarbageCollected::refObject(ScriptWrappableBase* inter
nalPointer) | 234 void V8TestInterfaceWillBeGarbageCollected::refObject(ScriptWrappableBase* inter
nalPointer) |
| 235 { | 235 { |
| 236 #if !ENABLE(OILPAN) | 236 #if !ENABLE(OILPAN) |
| 237 fromInternalPointer(internalPointer)->ref(); | 237 internalPointer->toImpl<TestInterfaceWillBeGarbageCollected>()->ref(); |
| 238 #endif | 238 #endif |
| 239 } | 239 } |
| 240 | 240 |
| 241 void V8TestInterfaceWillBeGarbageCollected::derefObject(ScriptWrappableBase* int
ernalPointer) | 241 void V8TestInterfaceWillBeGarbageCollected::derefObject(ScriptWrappableBase* int
ernalPointer) |
| 242 { | 242 { |
| 243 #if !ENABLE(OILPAN) | 243 #if !ENABLE(OILPAN) |
| 244 fromInternalPointer(internalPointer)->deref(); | 244 internalPointer->toImpl<TestInterfaceWillBeGarbageCollected>()->deref(); |
| 245 #endif | 245 #endif |
| 246 } | 246 } |
| 247 | 247 |
| 248 WrapperPersistentNode* V8TestInterfaceWillBeGarbageCollected::createPersistentHa
ndle(ScriptWrappableBase* internalPointer) | 248 WrapperPersistentNode* V8TestInterfaceWillBeGarbageCollected::createPersistentHa
ndle(ScriptWrappableBase* internalPointer) |
| 249 { | 249 { |
| 250 #if ENABLE(OILPAN) | 250 #if ENABLE(OILPAN) |
| 251 return new WrapperPersistent<TestInterfaceWillBeGarbageCollected>(fromIntern
alPointer(internalPointer)); | 251 return new WrapperPersistent<TestInterfaceWillBeGarbageCollected>(internalPo
inter->toImpl<TestInterfaceWillBeGarbageCollected>()); |
| 252 #else | 252 #else |
| 253 ASSERT_NOT_REACHED(); | 253 ASSERT_NOT_REACHED(); |
| 254 return 0; | 254 return 0; |
| 255 #endif | 255 #endif |
| 256 } | 256 } |
| 257 | 257 |
| 258 template<> | 258 template<> |
| 259 v8::Handle<v8::Value> toV8NoInline(TestInterfaceWillBeGarbageCollected* impl, v8
::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 259 v8::Handle<v8::Value> toV8NoInline(TestInterfaceWillBeGarbageCollected* impl, v8
::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 260 { | 260 { |
| 261 return toV8(impl, creationContext, isolate); | 261 return toV8(impl, creationContext, isolate); |
| 262 } | 262 } |
| 263 | 263 |
| 264 } // namespace blink | 264 } // namespace blink |
| OLD | NEW |