2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 #include "V8TestSerializedScriptValueInterface.h"
24 #if ENABLE(Condition1) || ENABLE(Condition2)
26 #include "RuntimeEnabledFeatures.h"
27 #include "SerializedScriptValue.h"
28 #include "V8Binding.h"
29 #include "V8BindingState.h"
30 #include "V8DOMWrapper.h"
31 #include "V8IsolatedContext.h"
33 #include <wtf/UnusedParam.h>
37 WrapperTypeInfo V8TestSerializedScriptValueInterface::info = { V8TestSerializedScriptValueInterface::GetTemplate, V8TestSerializedScriptValueInterface::derefObject, 0, 0 };
39 namespace TestSerializedScriptValueInterfaceInternal {
41 template <typename T> void V8_USE(T) { }
43 } // namespace TestSerializedScriptValueInterfaceInternal
45 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestSerializedScriptValueInterfaceTemplate(v8::Persistent<v8::FunctionTemplate> desc)
47 desc->ReadOnlyPrototype();
49 v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "TestSerializedScriptValueInterface", v8::Persistent<v8::FunctionTemplate>(), V8TestSerializedScriptValueInterface::internalFieldCount,
52 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
55 // Custom toString template
56 desc->Set(getToStringName(), getToStringTemplate());
60 v8::Persistent<v8::FunctionTemplate> V8TestSerializedScriptValueInterface::GetRawTemplate()
62 V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();
63 V8BindingPerIsolateData::TemplateMap::iterator result = data->rawTemplateMap().find(&info);
64 if (result != data->rawTemplateMap().end())
65 return result->second;
67 v8::HandleScope handleScope;
68 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
69 data->rawTemplateMap().add(&info, templ);
73 v8::Persistent<v8::FunctionTemplate> V8TestSerializedScriptValueInterface::GetTemplate()
75 V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();
76 V8BindingPerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
77 if (result != data->templateMap().end())
78 return result->second;
80 v8::HandleScope handleScope;
81 v8::Persistent<v8::FunctionTemplate> templ =
82 ConfigureV8TestSerializedScriptValueInterfaceTemplate(GetRawTemplate());
83 data->templateMap().add(&info, templ);
87 bool V8TestSerializedScriptValueInterface::HasInstance(v8::Handle<v8::Value> value)
89 return GetRawTemplate()->HasInstance(value);
93 v8::Handle<v8::Object> V8TestSerializedScriptValueInterface::wrapSlow(TestSerializedScriptValueInterface* impl)
95 v8::Handle<v8::Object> wrapper;
97 wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
98 if (wrapper.IsEmpty())
102 SerializedScriptValue::deserializeAndSetProperty(wrapper, "value", static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly), impl->value());
103 v8::Persistent<v8::Object> wrapperHandle = v8::Persistent<v8::Object>::New(wrapper);
105 if (!hasDependentLifetime)
106 wrapperHandle.MarkIndependent();
107 getDOMObjectMap().set(impl, wrapperHandle);
111 void V8TestSerializedScriptValueInterface::derefObject(void* object)
113 static_cast<TestSerializedScriptValueInterface*>(object)->deref();
116 } // namespace WebCore
118 #endif // ENABLE(Condition1) || ENABLE(Condition2)