| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! | 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! |
| 32 | 32 |
| 33 #include "config.h" | 33 #include "config.h" |
| 34 #include "V8TestInterfaceImplementedAs.h" | 34 #include "V8TestInterfaceImplementedAs.h" |
| 35 | 35 |
| 36 #include "RuntimeEnabledFeatures.h" | 36 #include "RuntimeEnabledFeatures.h" |
| 37 #include "bindings/v8/ExceptionState.h" | 37 #include "bindings/v8/ExceptionState.h" |
| 38 #include "bindings/v8/V8DOMConfiguration.h" | 38 #include "bindings/v8/V8DOMConfiguration.h" |
| 39 #include "bindings/v8/V8ObjectConstructor.h" |
| 39 #include "core/dom/ContextFeatures.h" | 40 #include "core/dom/ContextFeatures.h" |
| 40 #include "core/dom/Document.h" | 41 #include "core/dom/Document.h" |
| 41 #include "platform/TraceEvent.h" | 42 #include "platform/TraceEvent.h" |
| 42 #include "wtf/GetPtr.h" | 43 #include "wtf/GetPtr.h" |
| 43 #include "wtf/RefPtr.h" | 44 #include "wtf/RefPtr.h" |
| 44 | 45 |
| 45 namespace WebCore { | 46 namespace WebCore { |
| 46 | 47 |
| 47 static void initializeScriptWrappableForInterface(RealClass* object) | 48 static void initializeScriptWrappableForInterface(RealClass* object) |
| 48 { | 49 { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceImplement
edAsAttributes[] = { | 166 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceImplement
edAsAttributes[] = { |
| 166 {"a", RealClassV8Internal::aAttributeGetterCallback, RealClassV8Internal::aA
ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st
atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 167 {"a", RealClassV8Internal::aAttributeGetterCallback, RealClassV8Internal::aA
ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st
atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 167 {"b", RealClassV8Internal::bAttributeGetterCallback, RealClassV8Internal::bA
ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st
atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 168 {"b", RealClassV8Internal::bAttributeGetterCallback, RealClassV8Internal::bA
ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st
atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 168 }; | 169 }; |
| 169 | 170 |
| 170 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceImplementedA
sMethods[] = { | 171 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceImplementedA
sMethods[] = { |
| 171 {"func1", RealClassV8Internal::func1MethodCallback, 0, 1}, | 172 {"func1", RealClassV8Internal::func1MethodCallback, 0, 1}, |
| 172 {"funcTestInterfaceImplementedAsParam", RealClassV8Internal::funcTestInterfa
ceImplementedAsParamMethodCallback, 0, 1}, | 173 {"funcTestInterfaceImplementedAsParam", RealClassV8Internal::funcTestInterfa
ceImplementedAsParamMethodCallback, 0, 1}, |
| 173 }; | 174 }; |
| 174 | 175 |
| 175 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceImplementedAsTem
plate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, W
rapperWorldType currentWorldType) | 176 static void configureV8TestInterfaceImplementedAsTemplate(v8::Handle<v8::Functio
nTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorld
Type) |
| 176 { | 177 { |
| 177 functionTemplate->ReadOnlyPrototype(); | 178 functionTemplate->ReadOnlyPrototype(); |
| 178 | 179 |
| 179 v8::Local<v8::Signature> defaultSignature; | 180 v8::Local<v8::Signature> defaultSignature; |
| 180 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceImplementedAs", v8::Local<v8::FunctionTemplate>(), V8TestInte
rfaceImplementedAs::internalFieldCount, | 181 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceImplementedAs", v8::Local<v8::FunctionTemplate>(), V8TestInte
rfaceImplementedAs::internalFieldCount, |
| 181 V8TestInterfaceImplementedAsAttributes, WTF_ARRAY_LENGTH(V8TestInterface
ImplementedAsAttributes), | 182 V8TestInterfaceImplementedAsAttributes, WTF_ARRAY_LENGTH(V8TestInterface
ImplementedAsAttributes), |
| 182 0, 0, | 183 0, 0, |
| 183 V8TestInterfaceImplementedAsMethods, WTF_ARRAY_LENGTH(V8TestInterfaceImp
lementedAsMethods), | 184 V8TestInterfaceImplementedAsMethods, WTF_ARRAY_LENGTH(V8TestInterfaceImp
lementedAsMethods), |
| 184 isolate, currentWorldType); | 185 isolate, currentWorldType); |
| 185 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 186 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 186 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 187 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 187 | 188 |
| 188 // Custom toString template | 189 // Custom toString template |
| 189 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 190 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
| 190 return functionTemplate; | |
| 191 } | 191 } |
| 192 | 192 |
| 193 v8::Handle<v8::FunctionTemplate> V8TestInterfaceImplementedAs::domTemplate(v8::I
solate* isolate, WrapperWorldType currentWorldType) | 193 v8::Handle<v8::FunctionTemplate> V8TestInterfaceImplementedAs::domTemplate(v8::I
solate* isolate, WrapperWorldType currentWorldType) |
| 194 { | 194 { |
| 195 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 195 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 196 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 196 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
| 197 if (result != data->templateMap(currentWorldType).end()) | 197 if (result != data->templateMap(currentWorldType).end()) |
| 198 return result->value.newLocal(isolate); | 198 return result->value.newLocal(isolate); |
| 199 | 199 |
| 200 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 200 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 201 v8::EscapableHandleScope handleScope(isolate); | 201 v8::EscapableHandleScope handleScope(isolate); |
| 202 v8::Local<v8::FunctionTemplate> templ = | 202 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); |
| 203 ConfigureV8TestInterfaceImplementedAsTemplate(data->rawDOMTemplate(&wrap
perTypeInfo, currentWorldType), isolate, currentWorldType); | 203 configureV8TestInterfaceImplementedAsTemplate(templ, isolate, currentWorldTy
pe); |
| 204 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 204 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 205 return handleScope.Escape(templ); | 205 return handleScope.Escape(templ); |
| 206 } | 206 } |
| 207 | 207 |
| 208 bool V8TestInterfaceImplementedAs::hasInstance(v8::Handle<v8::Value> jsValue, v8
::Isolate* isolate, WrapperWorldType currentWorldType) | 208 bool V8TestInterfaceImplementedAs::hasInstance(v8::Handle<v8::Value> jsValue, v8
::Isolate* isolate, WrapperWorldType currentWorldType) |
| 209 { | 209 { |
| 210 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); | 210 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); |
| 211 } | 211 } |
| 212 | 212 |
| 213 bool V8TestInterfaceImplementedAs::hasInstanceInAnyWorld(v8::Handle<v8::Value> j
sValue, v8::Isolate* isolate) | 213 bool V8TestInterfaceImplementedAs::hasInstanceInAnyWorld(v8::Handle<v8::Value> j
sValue, v8::Isolate* isolate) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 242 fromInternalPointer(object)->deref(); | 242 fromInternalPointer(object)->deref(); |
| 243 } | 243 } |
| 244 | 244 |
| 245 template<> | 245 template<> |
| 246 v8::Handle<v8::Value> toV8NoInline(RealClass* impl, v8::Handle<v8::Object> creat
ionContext, v8::Isolate* isolate) | 246 v8::Handle<v8::Value> toV8NoInline(RealClass* impl, v8::Handle<v8::Object> creat
ionContext, v8::Isolate* isolate) |
| 247 { | 247 { |
| 248 return toV8(impl, creationContext, isolate); | 248 return toV8(impl, creationContext, isolate); |
| 249 } | 249 } |
| 250 | 250 |
| 251 } // namespace WebCore | 251 } // namespace WebCore |
| OLD | NEW |