Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / tests / results / core / V8TestSpecialOperationsNotEnumerable.cpp
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6
7 #include "config.h"
8 #include "V8TestSpecialOperationsNotEnumerable.h"
9
10 #include "bindings/core/v8/ExceptionState.h"
11 #include "bindings/core/v8/V8DOMConfiguration.h"
12 #include "bindings/core/v8/V8HiddenValue.h"
13 #include "bindings/core/v8/V8ObjectConstructor.h"
14 #include "core/dom/ContextFeatures.h"
15 #include "core/dom/Document.h"
16 #include "platform/RuntimeEnabledFeatures.h"
17 #include "platform/TraceEvent.h"
18 #include "wtf/GetPtr.h"
19 #include "wtf/RefPtr.h"
20
21 namespace blink {
22
23 const WrapperTypeInfo V8TestSpecialOperationsNotEnumerable::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestSpecialOperationsNotEnumerable::domTemplate, V8TestSpecialOperationsNotEnumerable::refObject, V8TestSpecialOperationsNotEnumerable::derefObject, V8TestSpecialOperationsNotEnumerable::trace, 0, 0, 0, V8TestSpecialOperationsNotEnumerable::installConditionallyEnabledMethods, V8TestSpecialOperationsNotEnumerable::installConditionallyEnabledProperties, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::Independent, WrapperTypeInfo::RefCountedObject };
24
25 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestSpecialOperationsNotEnumerable.h.
26 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
27 // bindings/core/v8/ScriptWrappable.h.
28 const WrapperTypeInfo& TestSpecialOperationsNotEnumerable::s_wrapperTypeInfo = V8TestSpecialOperationsNotEnumerable::wrapperTypeInfo;
29
30 namespace TestSpecialOperationsNotEnumerableV8Internal {
31
32 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
33 {
34     TestSpecialOperationsNotEnumerable* impl = V8TestSpecialOperationsNotEnumerable::toImpl(info.Holder());
35     String result = impl->anonymousIndexedGetter(index);
36     if (result.isNull())
37         return;
38     v8SetReturnValueString(info, result, info.GetIsolate());
39 }
40
41 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
42 {
43     TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty");
44     TestSpecialOperationsNotEnumerableV8Internal::indexedPropertyGetter(index, info);
45     TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
46 }
47
48 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
49 {
50     if (info.Holder()->HasRealNamedProperty(name))
51         return;
52     if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
53         return;
54
55     TestSpecialOperationsNotEnumerable* impl = V8TestSpecialOperationsNotEnumerable::toImpl(info.Holder());
56     AtomicString propertyName = toCoreAtomicString(name);
57     String result = impl->anonymousNamedGetter(propertyName);
58     if (result.isNull())
59         return;
60     v8SetReturnValueString(info, result, info.GetIsolate());
61 }
62
63 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
64 {
65     TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty");
66     TestSpecialOperationsNotEnumerableV8Internal::namedPropertyGetter(name, info);
67     TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
68 }
69
70 } // namespace TestSpecialOperationsNotEnumerableV8Internal
71
72 static void installV8TestSpecialOperationsNotEnumerableTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
73 {
74     functionTemplate->ReadOnlyPrototype();
75
76     v8::Local<v8::Signature> defaultSignature;
77     defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestSpecialOperationsNotEnumerable", v8::Local<v8::FunctionTemplate>(), V8TestSpecialOperationsNotEnumerable::internalFieldCount,
78         0, 0,
79         0, 0,
80         0, 0,
81         isolate);
82     v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
83     ALLOW_UNUSED_LOCAL(instanceTemplate);
84     v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
85     ALLOW_UNUSED_LOCAL(prototypeTemplate);
86     functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestSpecialOperationsNotEnumerableV8Internal::indexedPropertyGetterCallback, 0, 0, 0, 0);
87     functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestSpecialOperationsNotEnumerableV8Internal::namedPropertyGetterCallback, 0, 0, 0, 0);
88
89     // Custom toString template
90     functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
91 }
92
93 v8::Handle<v8::FunctionTemplate> V8TestSpecialOperationsNotEnumerable::domTemplate(v8::Isolate* isolate)
94 {
95     return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestSpecialOperationsNotEnumerableTemplate);
96 }
97
98 bool V8TestSpecialOperationsNotEnumerable::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
99 {
100     return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
101 }
102
103 v8::Handle<v8::Object> V8TestSpecialOperationsNotEnumerable::findInstanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
104 {
105     return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
106 }
107
108 TestSpecialOperationsNotEnumerable* V8TestSpecialOperationsNotEnumerable::toImplWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value)
109 {
110     return hasInstance(value, isolate) ? blink::toScriptWrappableBase(v8::Handle<v8::Object>::Cast(value))->toImpl<TestSpecialOperationsNotEnumerable>() : 0;
111 }
112
113 void V8TestSpecialOperationsNotEnumerable::refObject(ScriptWrappableBase* scriptWrappableBase)
114 {
115     scriptWrappableBase->toImpl<TestSpecialOperationsNotEnumerable>()->ref();
116 }
117
118 void V8TestSpecialOperationsNotEnumerable::derefObject(ScriptWrappableBase* scriptWrappableBase)
119 {
120     scriptWrappableBase->toImpl<TestSpecialOperationsNotEnumerable>()->deref();
121 }
122
123 template<>
124 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsNotEnumerable* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
125 {
126     return toV8(impl, creationContext, isolate);
127 }
128
129 } // namespace blink