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

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

Issue 290333008: Oilpan: add [WillBeGarbageCollected] for Element. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + remove WebNode FIXME Created 6 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestInterfaceWillBeGarbageCollected.h" 8 #include "V8TestInterfaceWillBeGarbageCollected.h"
9 9
10 #include "RuntimeEnabledFeatures.h" 10 #include "RuntimeEnabledFeatures.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } // namespace TestInterfaceWillBeGarbageCollectedV8Internal 108 } // namespace TestInterfaceWillBeGarbageCollectedV8Internal
109 109
110 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceWillBeGar bageCollectedAttributes[] = { 110 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceWillBeGar bageCollectedAttributes[] = {
111 {"attr1", TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeGette rCallback, TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeSetterCa llback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr opertyAttribute>(v8::None), 0 /* on instance */}, 111 {"attr1", TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeGette rCallback, TestInterfaceWillBeGarbageCollectedV8Internal::attr1AttributeSetterCa llback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Pr opertyAttribute>(v8::None), 0 /* on instance */},
112 }; 112 };
113 113
114 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceWillBeGarbag eCollectedMethods[] = { 114 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceWillBeGarbag eCollectedMethods[] = {
115 {"func", TestInterfaceWillBeGarbageCollectedV8Internal::funcMethodCallback, 0, 1}, 115 {"func", TestInterfaceWillBeGarbageCollectedV8Internal::funcMethodCallback, 0, 1},
116 }; 116 };
117 117
118 const WrapperTypeInfo V8TestInterfaceWillBeGarbageCollectedConstructor::wrapperT ypeInfo = { gin::kEmbedderBlink, V8TestInterfaceWillBeGarbageCollectedConstructo r::domTemplate, V8TestInterfaceWillBeGarbageCollected::derefObject, 0, V8TestInt erfaceWillBeGarbageCollected::toEventTarget, 0, V8TestInterfaceWillBeGarbageColl ected::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype, WillBeGar bageCollectedObject };
119
120 static void V8TestInterfaceWillBeGarbageCollectedConstructorCallback(const v8::F unctionCallbackInfo<v8::Value>& info)
121 {
122 v8::Isolate* isolate = info.GetIsolate();
123 if (!info.IsConstructCall()) {
124 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Test Interface"), isolate);
125 return;
126 }
127
128 if (ConstructorMode::current(isolate) == ConstructorMode::WrapExistingObject ) {
129 v8SetReturnValue(info, info.Holder());
130 return;
131 }
132
133 Document* document = currentDOMWindow(isolate)->document();
134 ASSERT(document);
135
136 // Make sure the document is added to the DOM Node map. Otherwise, the TestI nterfaceWillBeGarbageCollected instance
137 // may end up being the only node in the map and get garbage-collected prema turely.
138 toV8(document, info.Holder(), isolate);
139
140 if (UNLIKELY(info.Length() < 1)) {
141 throwMinimumArityTypeErrorForConstructor("TestInterfaceWillBeGarbageColl ected", 1, info.Length(), info.GetIsolate());
142 return;
143 }
144 TOSTRING_VOID(V8StringResource<>, str, info[0]);
145 RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> impl = TestInterface WillBeGarbageCollected::createForJSConstructor(*document, str);
146
147 v8::Handle<v8::Object> wrapper = info.Holder();
148 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceWillBeGarbageCollect ed>(impl.release(), &V8TestInterfaceWillBeGarbageCollectedConstructor::wrapperTy peInfo, wrapper, isolate, WrapperConfiguration::Independent);
149 v8SetReturnValue(info, wrapper);
150 }
151
152 v8::Handle<v8::FunctionTemplate> V8TestInterfaceWillBeGarbageCollectedConstructo r::domTemplate(v8::Isolate* isolate)
153 {
154 static int domTemplateKey; // This address is used for a key to look up the dom template.
155 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
156 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl ateKey);
157 if (!result.IsEmpty())
158 return result;
159
160 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
161 result = v8::FunctionTemplate::New(isolate, V8TestInterfaceWillBeGarbageColl ectedConstructorCallback);
162 v8::Local<v8::ObjectTemplate> instanceTemplate = result->InstanceTemplate();
163 instanceTemplate->SetInternalFieldCount(V8TestInterfaceWillBeGarbageCollecte d::internalFieldCount);
164 result->SetClassName(v8AtomicString(isolate, "TestInterfaceWillBeGarbageColl ected"));
165 result->Inherit(V8TestInterfaceWillBeGarbageCollected::domTemplate(isolate)) ;
166 data->setDOMTemplate(&domTemplateKey, result);
167 return result;
168 }
169
118 void V8TestInterfaceWillBeGarbageCollected::constructorCallback(const v8::Functi onCallbackInfo<v8::Value>& info) 170 void V8TestInterfaceWillBeGarbageCollected::constructorCallback(const v8::Functi onCallbackInfo<v8::Value>& info)
119 { 171 {
120 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); 172 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor");
121 if (!info.IsConstructCall()) { 173 if (!info.IsConstructCall()) {
122 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Test InterfaceWillBeGarbageCollected"), info.GetIsolate()); 174 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Test InterfaceWillBeGarbageCollected"), info.GetIsolate());
123 return; 175 return;
124 } 176 }
125 177
126 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis tingObject) { 178 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis tingObject) {
127 v8SetReturnValue(info, info.Holder()); 179 v8SetReturnValue(info, info.Holder());
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 #endif // !ENABLE(OILPAN) 263 #endif // !ENABLE(OILPAN)
212 } 264 }
213 265
214 template<> 266 template<>
215 v8::Handle<v8::Value> toV8NoInline(TestInterfaceWillBeGarbageCollected* impl, v8 ::Handle<v8::Object> creationContext, v8::Isolate* isolate) 267 v8::Handle<v8::Value> toV8NoInline(TestInterfaceWillBeGarbageCollected* impl, v8 ::Handle<v8::Object> creationContext, v8::Isolate* isolate)
216 { 268 {
217 return toV8(impl, creationContext, isolate); 269 return toV8(impl, creationContext, isolate);
218 } 270 }
219 271
220 } // namespace WebCore 272 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterfaceWillBeGarbageCollected.h ('k') | Source/bindings/v8/CustomElementWrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698