• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2     This file is part of the WebKit open source project.
3     This file has been generated by generate-bindings.pl. DO NOT MODIFY!
4 
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.
9 
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.
14 
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.
19 */
20 
21 #include "config.h"
22 #include "V8TestSerializedScriptValueInterface.h"
23 
24 #if ENABLE(Condition1) || ENABLE(Condition2)
25 
26 #include "RuntimeEnabledFeatures.h"
27 #include "SerializedScriptValue.h"
28 #include "V8Binding.h"
29 #include "V8BindingState.h"
30 #include "V8DOMWrapper.h"
31 #include "V8IsolatedContext.h"
32 #include "V8Proxy.h"
33 #include <wtf/UnusedParam.h>
34 
35 namespace WebCore {
36 
37 WrapperTypeInfo V8TestSerializedScriptValueInterface::info = { V8TestSerializedScriptValueInterface::GetTemplate, V8TestSerializedScriptValueInterface::derefObject, 0, 0 };
38 
39 namespace TestSerializedScriptValueInterfaceInternal {
40 
V8_USE(T)41 template <typename T> void V8_USE(T) { }
42 
43 } // namespace TestSerializedScriptValueInterfaceInternal
44 
ConfigureV8TestSerializedScriptValueInterfaceTemplate(v8::Persistent<v8::FunctionTemplate> desc)45 static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestSerializedScriptValueInterfaceTemplate(v8::Persistent<v8::FunctionTemplate> desc)
46 {
47     v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "TestSerializedScriptValueInterface", v8::Persistent<v8::FunctionTemplate>(), V8TestSerializedScriptValueInterface::internalFieldCount,
48         0, 0,
49         0, 0);
50     UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
51 
52 
53     // Custom toString template
54     desc->Set(getToStringName(), getToStringTemplate());
55     return desc;
56 }
57 
GetRawTemplate()58 v8::Persistent<v8::FunctionTemplate> V8TestSerializedScriptValueInterface::GetRawTemplate()
59 {
60     static v8::Persistent<v8::FunctionTemplate> V8TestSerializedScriptValueInterfaceRawCache = createRawTemplate();
61     return V8TestSerializedScriptValueInterfaceRawCache;
62 }
63 
GetTemplate()64 v8::Persistent<v8::FunctionTemplate> V8TestSerializedScriptValueInterface::GetTemplate()
65 {
66     static v8::Persistent<v8::FunctionTemplate> V8TestSerializedScriptValueInterfaceCache = ConfigureV8TestSerializedScriptValueInterfaceTemplate(GetRawTemplate());
67     return V8TestSerializedScriptValueInterfaceCache;
68 }
69 
HasInstance(v8::Handle<v8::Value> value)70 bool V8TestSerializedScriptValueInterface::HasInstance(v8::Handle<v8::Value> value)
71 {
72     return GetRawTemplate()->HasInstance(value);
73 }
74 
75 
wrapSlow(TestSerializedScriptValueInterface * impl)76 v8::Handle<v8::Object> V8TestSerializedScriptValueInterface::wrapSlow(TestSerializedScriptValueInterface* impl)
77 {
78     v8::Handle<v8::Object> wrapper;
79     V8Proxy* proxy = 0;
80     wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
81     if (wrapper.IsEmpty())
82         return wrapper;
83 
84     impl->ref();
85     SerializedScriptValue::deserializeAndSetProperty(wrapper, "value", static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly), impl->value());
86     v8::Persistent<v8::Object> wrapperHandle = v8::Persistent<v8::Object>::New(wrapper);
87     getDOMObjectMap().set(impl, wrapperHandle);
88     return wrapper;
89 }
90 
derefObject(void * object)91 void V8TestSerializedScriptValueInterface::derefObject(void* object)
92 {
93     static_cast<TestSerializedScriptValueInterface*>(object)->deref();
94 }
95 
96 } // namespace WebCore
97 
98 #endif // ENABLE(Condition1) || ENABLE(Condition2)
99