| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 static int domTemplateKey; // This address is used for a key to look up the
dom template. | 138 static int domTemplateKey; // This address is used for a key to look up the
dom template. |
| 139 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 139 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 140 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl
ateKey); | 140 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl
ateKey); |
| 141 if (!result.IsEmpty()) | 141 if (!result.IsEmpty()) |
| 142 return result; | 142 return result; |
| 143 | 143 |
| 144 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate"); | 144 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate"); |
| 145 result = v8::FunctionTemplate::New(isolate, V8TestInterfaceWillBeGarbageColl
ectedConstructorCallback); | 145 result = v8::FunctionTemplate::New(isolate, V8TestInterfaceWillBeGarbageColl
ectedConstructorCallback); |
| 146 v8::Local<v8::ObjectTemplate> instanceTemplate = result->InstanceTemplate(); | 146 v8::Local<v8::ObjectTemplate> instanceTemplate = result->InstanceTemplate(); |
| 147 instanceTemplate->SetInternalFieldCount(V8TestInterfaceWillBeGarbageCollecte
d::internalFieldCount); | 147 instanceTemplate->SetInternalFieldCount(V8TestInterfaceWillBeGarbageCollecte
d::internalFieldCount); |
| 148 result->SetClassName(v8AtomicString(isolate, "TestInterfaceWillBeGarbageColl
ected")); | |
| 149 result->Inherit(V8TestInterfaceWillBeGarbageCollected::domTemplate(isolate))
; | 148 result->Inherit(V8TestInterfaceWillBeGarbageCollected::domTemplate(isolate))
; |
| 150 data->setDOMTemplate(&domTemplateKey, result); | 149 data->setDOMTemplate(&domTemplateKey, result); |
| 151 return result; | 150 return result; |
| 152 } | 151 } |
| 153 | 152 |
| 154 void V8TestInterfaceWillBeGarbageCollected::constructorCallback(const v8::Functi
onCallbackInfo<v8::Value>& info) | 153 void V8TestInterfaceWillBeGarbageCollected::constructorCallback(const v8::Functi
onCallbackInfo<v8::Value>& info) |
| 155 { | 154 { |
| 156 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor"); | 155 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor"); |
| 157 if (!info.IsConstructCall()) { | 156 if (!info.IsConstructCall()) { |
| 158 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("TestInterfaceWillBeGarbageCollected")); | 157 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("TestInterfaceWillBeGarbageCollected")); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 180 functionTemplate->SetLength(1); | 179 functionTemplate->SetLength(1); |
| 181 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 180 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); |
| 182 ALLOW_UNUSED_LOCAL(instanceTemplate); | 181 ALLOW_UNUSED_LOCAL(instanceTemplate); |
| 183 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | 182 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); |
| 184 ALLOW_UNUSED_LOCAL(prototypeTemplate); | 183 ALLOW_UNUSED_LOCAL(prototypeTemplate); |
| 185 const V8DOMConfiguration::MethodConfiguration funcMethodConfiguration = { | 184 const V8DOMConfiguration::MethodConfiguration funcMethodConfiguration = { |
| 186 "func", TestInterfaceWillBeGarbageCollectedV8Internal::funcMethodCallbac
k, 0, 1, V8DOMConfiguration::ExposedToAllScripts, | 185 "func", TestInterfaceWillBeGarbageCollectedV8Internal::funcMethodCallbac
k, 0, 1, V8DOMConfiguration::ExposedToAllScripts, |
| 187 }; | 186 }; |
| 188 V8DOMConfiguration::installMethod(isolate, instanceTemplate, defaultSignatur
e, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly), funcMethod
Configuration); | 187 V8DOMConfiguration::installMethod(isolate, instanceTemplate, defaultSignatur
e, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly), funcMethod
Configuration); |
| 189 | 188 |
| 189 prototypeTemplate->Set(v8::Symbol::GetToStringTag(isolate), v8AtomicString(i
solate, "TestInterfaceWillBeGarbageCollected")); |
| 190 |
| 190 // Custom toString template | 191 // Custom toString template |
| 191 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); | 192 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); |
| 192 } | 193 } |
| 193 | 194 |
| 194 v8::Local<v8::FunctionTemplate> V8TestInterfaceWillBeGarbageCollected::domTempla
te(v8::Isolate* isolate) | 195 v8::Local<v8::FunctionTemplate> V8TestInterfaceWillBeGarbageCollected::domTempla
te(v8::Isolate* isolate) |
| 195 { | 196 { |
| 196 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI
nfo*>(&wrapperTypeInfo), installV8TestInterfaceWillBeGarbageCollectedTemplate); | 197 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI
nfo*>(&wrapperTypeInfo), installV8TestInterfaceWillBeGarbageCollectedTemplate); |
| 197 } | 198 } |
| 198 | 199 |
| 199 bool V8TestInterfaceWillBeGarbageCollected::hasInstance(v8::Local<v8::Value> v8V
alue, v8::Isolate* isolate) | 200 bool V8TestInterfaceWillBeGarbageCollected::hasInstance(v8::Local<v8::Value> v8V
alue, v8::Isolate* isolate) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 219 } | 220 } |
| 220 | 221 |
| 221 void V8TestInterfaceWillBeGarbageCollected::derefObject(ScriptWrappable* scriptW
rappable) | 222 void V8TestInterfaceWillBeGarbageCollected::derefObject(ScriptWrappable* scriptW
rappable) |
| 222 { | 223 { |
| 223 #if !ENABLE(OILPAN) | 224 #if !ENABLE(OILPAN) |
| 224 scriptWrappable->toImpl<TestInterfaceWillBeGarbageCollected>()->deref(); | 225 scriptWrappable->toImpl<TestInterfaceWillBeGarbageCollected>()->deref(); |
| 225 #endif | 226 #endif |
| 226 } | 227 } |
| 227 | 228 |
| 228 } // namespace blink | 229 } // namespace blink |
| OLD | NEW |