| 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 "V8TestCustomAccessors.h" | 34 #include "V8TestCustomAccessors.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 | 43 |
| 43 namespace WebCore { | 44 namespace WebCore { |
| 44 | 45 |
| 45 static void initializeScriptWrappableForInterface(TestCustomAccessors* object) | 46 static void initializeScriptWrappableForInterface(TestCustomAccessors* object) |
| 46 { | 47 { |
| 47 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 48 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
| 48 ScriptWrappable::setTypeInfoInObject(object, &V8TestCustomAccessors::wra
pperTypeInfo); | 49 ScriptWrappable::setTypeInfoInObject(object, &V8TestCustomAccessors::wra
pperTypeInfo); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 V8TestCustomAccessors::namedPropertyQueryCustom(name, info); | 142 V8TestCustomAccessors::namedPropertyQueryCustom(name, info); |
| 142 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 143 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 143 } | 144 } |
| 144 | 145 |
| 145 } // namespace TestCustomAccessorsV8Internal | 146 } // namespace TestCustomAccessorsV8Internal |
| 146 | 147 |
| 147 static const V8DOMConfiguration::MethodConfiguration V8TestCustomAccessorsMethod
s[] = { | 148 static const V8DOMConfiguration::MethodConfiguration V8TestCustomAccessorsMethod
s[] = { |
| 148 {"anotherFunction", TestCustomAccessorsV8Internal::anotherFunctionMethodCall
back, 0, 1}, | 149 {"anotherFunction", TestCustomAccessorsV8Internal::anotherFunctionMethodCall
back, 0, 1}, |
| 149 }; | 150 }; |
| 150 | 151 |
| 151 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestCustomAccessorsTemplate(v
8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperW
orldType currentWorldType) | 152 static void configureV8TestCustomAccessorsTemplate(v8::Handle<v8::FunctionTempla
te> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) |
| 152 { | 153 { |
| 153 functionTemplate->ReadOnlyPrototype(); | 154 functionTemplate->ReadOnlyPrototype(); |
| 154 | 155 |
| 155 v8::Local<v8::Signature> defaultSignature; | 156 v8::Local<v8::Signature> defaultSignature; |
| 156 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestCustomAccessors", v8::Local<v8::FunctionTemplate>(), V8TestCustomAcces
sors::internalFieldCount, | 157 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestCustomAccessors", v8::Local<v8::FunctionTemplate>(), V8TestCustomAcces
sors::internalFieldCount, |
| 157 0, 0, | 158 0, 0, |
| 158 0, 0, | 159 0, 0, |
| 159 V8TestCustomAccessorsMethods, WTF_ARRAY_LENGTH(V8TestCustomAccessorsMeth
ods), | 160 V8TestCustomAccessorsMethods, WTF_ARRAY_LENGTH(V8TestCustomAccessorsMeth
ods), |
| 160 isolate, currentWorldType); | 161 isolate, currentWorldType); |
| 161 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 162 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 162 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 163 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 163 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestCustomAc
cessorsV8Internal::indexedPropertyGetterCallback, TestCustomAccessorsV8Internal:
:indexedPropertySetterCallback, 0, TestCustomAccessorsV8Internal::indexedPropert
yDeleterCallback, 0); | 164 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestCustomAc
cessorsV8Internal::indexedPropertyGetterCallback, TestCustomAccessorsV8Internal:
:indexedPropertySetterCallback, 0, TestCustomAccessorsV8Internal::indexedPropert
yDeleterCallback, 0); |
| 164 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestCustomAcce
ssorsV8Internal::namedPropertyGetterCallback, TestCustomAccessorsV8Internal::nam
edPropertySetterCallback, TestCustomAccessorsV8Internal::namedPropertyQueryCallb
ack, TestCustomAccessorsV8Internal::namedPropertyDeleterCallback, TestCustomAcce
ssorsV8Internal::namedPropertyEnumeratorCallback); | 165 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestCustomAcce
ssorsV8Internal::namedPropertyGetterCallback, TestCustomAccessorsV8Internal::nam
edPropertySetterCallback, TestCustomAccessorsV8Internal::namedPropertyQueryCallb
ack, TestCustomAccessorsV8Internal::namedPropertyDeleterCallback, TestCustomAcce
ssorsV8Internal::namedPropertyEnumeratorCallback); |
| 165 | 166 |
| 166 // Custom toString template | 167 // Custom toString template |
| 167 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 168 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
| 168 return functionTemplate; | |
| 169 } | 169 } |
| 170 | 170 |
| 171 v8::Handle<v8::FunctionTemplate> V8TestCustomAccessors::domTemplate(v8::Isolate*
isolate, WrapperWorldType currentWorldType) | 171 v8::Handle<v8::FunctionTemplate> V8TestCustomAccessors::domTemplate(v8::Isolate*
isolate, WrapperWorldType currentWorldType) |
| 172 { | 172 { |
| 173 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 173 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 174 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 174 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
| 175 if (result != data->templateMap(currentWorldType).end()) | 175 if (result != data->templateMap(currentWorldType).end()) |
| 176 return result->value.newLocal(isolate); | 176 return result->value.newLocal(isolate); |
| 177 | 177 |
| 178 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 178 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 179 v8::EscapableHandleScope handleScope(isolate); | 179 v8::EscapableHandleScope handleScope(isolate); |
| 180 v8::Local<v8::FunctionTemplate> templ = | 180 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); |
| 181 ConfigureV8TestCustomAccessorsTemplate(data->rawDOMTemplate(&wrapperType
Info, currentWorldType), isolate, currentWorldType); | 181 configureV8TestCustomAccessorsTemplate(templ, isolate, currentWorldType); |
| 182 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 182 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 183 return handleScope.Escape(templ); | 183 return handleScope.Escape(templ); |
| 184 } | 184 } |
| 185 | 185 |
| 186 bool V8TestCustomAccessors::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isola
te* isolate, WrapperWorldType currentWorldType) | 186 bool V8TestCustomAccessors::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isola
te* isolate, WrapperWorldType currentWorldType) |
| 187 { | 187 { |
| 188 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); | 188 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); |
| 189 } | 189 } |
| 190 | 190 |
| 191 bool V8TestCustomAccessors::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue,
v8::Isolate* isolate) | 191 bool V8TestCustomAccessors::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue,
v8::Isolate* isolate) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 220 fromInternalPointer(object)->deref(); | 220 fromInternalPointer(object)->deref(); |
| 221 } | 221 } |
| 222 | 222 |
| 223 template<> | 223 template<> |
| 224 v8::Handle<v8::Value> toV8NoInline(TestCustomAccessors* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) | 224 v8::Handle<v8::Value> toV8NoInline(TestCustomAccessors* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) |
| 225 { | 225 { |
| 226 return toV8(impl, creationContext, isolate); | 226 return toV8(impl, creationContext, isolate); |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace WebCore | 229 } // namespace WebCore |
| OLD | NEW |