| Index: Source/bindings/scripts/implementation.template
|
| diff --git a/Source/bindings/scripts/implementation.template b/Source/bindings/scripts/implementation.template
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..74349dcf51b5d31c36dc843f580a6d80c4c9464c
|
| --- /dev/null
|
| +++ b/Source/bindings/scripts/implementation.template
|
| @@ -0,0 +1,117 @@
|
| +/*
|
| + This file is part of the Blink open source project.
|
| + This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY!
|
| +
|
| + This library is free software; you can redistribute it and/or
|
| + modify it under the terms of the GNU Library General Public
|
| + License as published by the Free Software Foundation; either
|
| + version 2 of the License, or (at your option) any later version.
|
| +
|
| + This library is distributed in the hope that it will be useful,
|
| + but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
| + Library General Public License for more details.
|
| +
|
| + You should have received a copy of the GNU Library General Public License
|
| + along with this library; see the file COPYING.LIB. If not, write to
|
| + the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
| + Boston, MA 02111-1307, USA.
|
| +*/
|
| +
|
| +#include "config.h"
|
| +#include "{{v8_class_name}}.h"
|
| +{{conditional_if}}
|
| +
|
| +{%- for filename in includes %}
|
| +#include "{{ filename }}"
|
| +{%- endfor %}
|
| +
|
| +namespace WebCore {
|
| +
|
| +static void initializeScriptWrappableForInterface({{impl_class_name}}* object)
|
| +{
|
| + if (ScriptWrappable::wrapperCanBeStoredInObject(object))
|
| + ScriptWrappable::setTypeInfoInObject(object, &{{v8_class_name}}::info);
|
| + else
|
| + ASSERT_NOT_REACHED();
|
| +}
|
| +
|
| +} // namespace WebCore
|
| +
|
| +// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
|
| +// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
|
| +// in the global namespace.
|
| +// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
|
| +void webCoreInitializeScriptWrappableForInterface({{namespace_for_interface and "WebCore::" or ""}}{{impl_class_name}}* object)
|
| +{
|
| + WebCore::initializeScriptWrappableForInterface(object);
|
| +}
|
| +
|
| +namespace WebCore {
|
| +WrapperTypeInfo {{v8_class_name}}::info = { {{v8_class_name}}::GetTemplate, {{v8_class_name}}::derefObject, {{to_active_dom_object}}, {{to_event_target}}, {{root_for_gc}}, {{v8_class_name}}::installPerContextPrototypeProperties, {{parent_class_info}}, {{wrapper_type_prototype}} };
|
| +
|
| +namespace {{impl_class_name}}V8Internal {
|
| +
|
| +template <typename T> void V8_USE(T) { }
|
| +
|
| +} // namespace {{impl_class_name}}V8Internal
|
| +
|
| +static v8::Handle<v8::FunctionTemplate> Configure{{v8_class_name}}Template(v8::Handle<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorldType)
|
| +{
|
| + desc->ReadOnlyPrototype();
|
| +
|
| + v8::Local<v8::Signature> defaultSignature;
|
| +{% if enabled_at_runtime %}
|
| + if (!{{enable_function}}())
|
| + defaultSignature = V8DOMConfiguration::configureTemplate(desc, "", {{parent_class_template}}, {{v8_class_name}}::internalFieldCount, 0, 0, 0, 0, isolate, currentWorldType);
|
| + else
|
| +{% endif %}
|
| + defaultSignature = V8DOMConfiguration::configureTemplate(desc, "{{interface_name}}", {{parent_class_template}}, {{v8_class_name}}::internalFieldCount,
|
| + {{configure_template_batched_attribute}}, {{configure_template_attribute_count}},
|
| + {{configure_template_batched_method}}, {{configure_template_method_count}}, isolate, currentWorldType);
|
| + UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
|
| +
|
| + // Custom toString template
|
| + desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
|
| + return desc;
|
| +}
|
| +
|
| +v8::Handle<v8::FunctionTemplate> {{v8_class_name}}::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
|
| +{
|
| + V8PerIsolateData* data = V8PerIsolateData::from(isolate);
|
| + V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&info);
|
| + if (result != data->templateMap(currentWorldType).end())
|
| + return result->value.newLocal(isolate);
|
| +
|
| + v8::HandleScope handleScope(isolate);
|
| + v8::Handle<v8::FunctionTemplate> templ =
|
| + Configure{{v8_class_name}}Template(data->rawTemplate(&info, currentWorldType), isolate, currentWorldType);
|
| + data->templateMap(currentWorldType).add(&info, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
|
| + return handleScope.Close(templ);
|
| +}
|
| +
|
| +bool {{v8_class_name}}::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType currentWorldType)
|
| +{
|
| + return V8PerIsolateData::from(isolate)->hasInstance(&info, value, currentWorldType);
|
| +}
|
| +
|
| +bool {{v8_class_name}}::HasInstanceInAnyWorld(v8::Handle<v8::Value> value, v8::Isolate* isolate)
|
| +{
|
| + return V8PerIsolateData::from(isolate)->hasInstance(&info, value, MainWorld)
|
| + || V8PerIsolateData::from(isolate)->hasInstance(&info, value, IsolatedWorld)
|
| + || V8PerIsolateData::from(isolate)->hasInstance(&info, value, WorkerWorld);
|
| +}
|
| +
|
| +{% if inherits_extended_attribute_event_target %}
|
| +EventTarget* {{v8_class_name}}::toEventTarget(v8::Handle<v8::Object> object)
|
| +{
|
| + return toNative(object);
|
| +}
|
| +{% endif %}
|
| +
|
| +
|
| +
|
| +} // namespace WebCore
|
| +
|
| +{{conditional_endif}}
|
| +
|
|
|