Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: Source/bindings/tests/results/V8TestNode.cpp

Issue 27207002: Add support for [PutForwards] IDL extended attribute (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nits Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 This file is part of the Blink open source project. 2 This file is part of the Blink open source project.
3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY!
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 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 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, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19 */ 19 */
20 20
21 #include "config.h" 21 #include "config.h"
22 #include "V8TestNode.h" 22 #include "V8TestNode.h"
23 23
24 #include "RuntimeEnabledFeatures.h" 24 #include "RuntimeEnabledFeatures.h"
25 #include "V8Node.h" 25 #include "V8Node.h"
26 #include "bindings/v8/ExceptionMessages.h" 26 #include "bindings/v8/ExceptionMessages.h"
27 #include "bindings/v8/ExceptionState.h"
27 #include "bindings/v8/ScriptController.h" 28 #include "bindings/v8/ScriptController.h"
28 #include "bindings/v8/V8Binding.h" 29 #include "bindings/v8/V8Binding.h"
29 #include "bindings/v8/V8DOMConfiguration.h" 30 #include "bindings/v8/V8DOMConfiguration.h"
30 #include "bindings/v8/V8DOMWrapper.h" 31 #include "bindings/v8/V8DOMWrapper.h"
31 #include "bindings/v8/V8ObjectConstructor.h" 32 #include "bindings/v8/V8ObjectConstructor.h"
32 #include "core/dom/ContextFeatures.h" 33 #include "core/dom/ContextFeatures.h"
33 #include "core/dom/Document.h" 34 #include "core/dom/Document.h"
34 #include "platform/TraceEvent.h" 35 #include "platform/TraceEvent.h"
35 #include "wtf/UnusedParam.h" 36 #include "wtf/UnusedParam.h"
36 37
(...skipping 18 matching lines...) Expand all
55 WebCore::initializeScriptWrappableForInterface(object); 56 WebCore::initializeScriptWrappableForInterface(object);
56 } 57 }
57 58
58 namespace WebCore { 59 namespace WebCore {
59 WrapperTypeInfo V8TestNode::info = { V8TestNode::GetTemplate, V8TestNode::derefO bject, 0, V8TestNode::toEventTarget, 0, V8TestNode::installPerContextPrototypePr operties, &V8Node::info, WrapperTypeObjectPrototype }; 60 WrapperTypeInfo V8TestNode::info = { V8TestNode::GetTemplate, V8TestNode::derefO bject, 0, V8TestNode::toEventTarget, 0, V8TestNode::installPerContextPrototypePr operties, &V8Node::info, WrapperTypeObjectPrototype };
60 61
61 namespace TestNodeV8Internal { 62 namespace TestNodeV8Internal {
62 63
63 template <typename T> void V8_USE(T) { } 64 template <typename T> void V8_USE(T) { }
64 65
66 static void hrefAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCa llbackInfo<v8::Value>& info)
67 {
68 TestNode* imp = V8TestNode::toNative(info.Holder());
69 v8SetReturnValueString(info, imp->href(), info.GetIsolate());
70 }
71
72 static void hrefAttributeGetterCallback(v8::Local<v8::String> name, const v8::Pr opertyCallbackInfo<v8::Value>& info)
73 {
74 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
75 TestNodeV8Internal::hrefAttributeGetter(name, info);
76 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
77 }
78
79 static void hrefAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
80 {
81 TestNode* imp = V8TestNode::toNative(info.Holder());
82 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value);
83 imp->setHref(v);
84 }
85
86 static void hrefAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8 ::Value> value, const v8::PropertyCallbackInfo<void>& info)
87 {
88 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
89 TestNodeV8Internal::hrefAttributeSetter(name, value, info);
90 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
91 }
92
93 static void hrefThrowsAttributeGetter(v8::Local<v8::String> name, const v8::Prop ertyCallbackInfo<v8::Value>& info)
94 {
95 TestNode* imp = V8TestNode::toNative(info.Holder());
96 v8SetReturnValueString(info, imp->hrefThrows(), info.GetIsolate());
97 }
98
99 static void hrefThrowsAttributeGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
100 {
101 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
102 TestNodeV8Internal::hrefThrowsAttributeGetter(name, info);
103 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
104 }
105
106 static void hrefThrowsAttributeSetter(v8::Local<v8::String> name, v8::Local<v8:: Value> value, const v8::PropertyCallbackInfo<void>& info)
107 {
108 TestNode* imp = V8TestNode::toNative(info.Holder());
109 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value);
110 ExceptionState es(info.GetIsolate());
111 imp->setHrefThrows(v, es);
112 es.throwIfNeeded();
113 }
114
115 static void hrefThrowsAttributeSetterCallback(v8::Local<v8::String> name, v8::Lo cal<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
116 {
117 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
118 TestNodeV8Internal::hrefThrowsAttributeSetter(name, value, info);
119 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
120 }
121
65 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args) 122 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args)
66 { 123 {
67 124
68 RefPtr<TestNode> impl = TestNode::create(); 125 RefPtr<TestNode> impl = TestNode::create();
69 v8::Handle<v8::Object> wrapper = args.Holder(); 126 v8::Handle<v8::Object> wrapper = args.Holder();
70 127
71 V8DOMWrapper::associateObjectWithWrapper<V8TestNode>(impl.release(), &V8Test Node::info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent); 128 V8DOMWrapper::associateObjectWithWrapper<V8TestNode>(impl.release(), &V8Test Node::info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
72 args.GetReturnValue().Set(wrapper); 129 args.GetReturnValue().Set(wrapper);
73 } 130 }
74 131
75 } // namespace TestNodeV8Internal 132 } // namespace TestNodeV8Internal
76 133
134 static const V8DOMConfiguration::AttributeConfiguration V8TestNodeAttributes[] = {
135 {"href", TestNodeV8Internal::hrefAttributeGetterCallback, TestNodeV8Internal ::hrefAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAU LT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
136 {"hrefThrows", TestNodeV8Internal::hrefThrowsAttributeGetterCallback, TestNo deV8Internal::hrefThrowsAttributeSetterCallback, 0, 0, 0, static_cast<v8::Access Control>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on ins tance */},
137 };
138
77 void V8TestNode::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& args) 139 void V8TestNode::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& args)
78 { 140 {
79 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); 141 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor");
80 if (!args.IsConstructCall()) { 142 if (!args.IsConstructCall()) {
81 throwTypeError(ExceptionMessages::failedToConstruct("TestNode", "Please use the 'new' operator, this DOM object constructor cannot be called as a functi on."), args.GetIsolate()); 143 throwTypeError(ExceptionMessages::failedToConstruct("TestNode", "Please use the 'new' operator, this DOM object constructor cannot be called as a functi on."), args.GetIsolate());
82 return; 144 return;
83 } 145 }
84 146
85 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { 147 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
86 args.GetReturnValue().Set(args.Holder()); 148 args.GetReturnValue().Set(args.Holder());
87 return; 149 return;
88 } 150 }
89 151
90 TestNodeV8Internal::constructor(args); 152 TestNodeV8Internal::constructor(args);
91 } 153 }
92 154
93 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestNodeTemplate(v8::Handle<v 8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorldTy pe) 155 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestNodeTemplate(v8::Handle<v 8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorldTy pe)
94 { 156 {
95 desc->ReadOnlyPrototype(); 157 desc->ReadOnlyPrototype();
96 158
97 v8::Local<v8::Signature> defaultSignature; 159 v8::Local<v8::Signature> defaultSignature;
98 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "TestNo de", V8Node::GetTemplate(isolate, currentWorldType), V8TestNode::internalFieldCo unt, 160 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "TestNo de", V8Node::GetTemplate(isolate, currentWorldType), V8TestNode::internalFieldCo unt,
99 0, 0, 161 V8TestNodeAttributes, WTF_ARRAY_LENGTH(V8TestNodeAttributes),
100 0, 0, isolate, currentWorldType); 162 0, 0, isolate, currentWorldType);
101 UNUSED_PARAM(defaultSignature); 163 UNUSED_PARAM(defaultSignature);
102 desc->SetCallHandler(V8TestNode::constructorCallback); 164 desc->SetCallHandler(V8TestNode::constructorCallback);
103 desc->SetLength(0); 165 desc->SetLength(0);
104 166
105 // Custom toString template 167 // Custom toString template
106 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to StringTemplate()); 168 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to StringTemplate());
107 return desc; 169 return desc;
108 } 170 }
109 171
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 V8DOMWrapper::associateObjectWithWrapper<V8TestNode>(impl, &info, wrapper, i solate, WrapperConfiguration::Dependent); 220 V8DOMWrapper::associateObjectWithWrapper<V8TestNode>(impl, &info, wrapper, i solate, WrapperConfiguration::Dependent);
159 return wrapper; 221 return wrapper;
160 } 222 }
161 223
162 void V8TestNode::derefObject(void* object) 224 void V8TestNode::derefObject(void* object)
163 { 225 {
164 fromInternalPointer(object)->deref(); 226 fromInternalPointer(object)->deref();
165 } 227 }
166 228
167 } // namespace WebCore 229 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/idls/TestObject.idl ('k') | Source/bindings/tests/results/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698