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

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp

Issue 1873323002: Have bindings layer assume and insist that all interface types are GCed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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 "V8TestInterfaceConstructor2.h" 7 #include "V8TestInterfaceConstructor2.h"
8 8
9 #include "bindings/core/v8/Dictionary.h" 9 #include "bindings/core/v8/Dictionary.h"
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
11 #include "bindings/core/v8/V8DOMConfiguration.h" 11 #include "bindings/core/v8/V8DOMConfiguration.h"
12 #include "bindings/core/v8/V8ObjectConstructor.h" 12 #include "bindings/core/v8/V8ObjectConstructor.h"
13 #include "bindings/core/v8/V8TestInterfaceEmpty.h" 13 #include "bindings/core/v8/V8TestInterfaceEmpty.h"
14 #include "core/dom/Document.h" 14 #include "core/dom/Document.h"
15 #include "core/frame/LocalDOMWindow.h" 15 #include "core/frame/LocalDOMWindow.h"
16 #include "wtf/GetPtr.h" 16 #include "wtf/GetPtr.h"
17 #include "wtf/RefPtr.h" 17 #include "wtf/RefPtr.h"
18 18
19 namespace blink { 19 namespace blink {
20 20
21 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv ial 21 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv ial
22 // and does not depend on another global objects. 22 // and does not depend on another global objects.
23 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) 23 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
24 #pragma clang diagnostic push 24 #pragma clang diagnostic push
25 #pragma clang diagnostic ignored "-Wglobal-constructors" 25 #pragma clang diagnostic ignored "-Wglobal-constructors"
26 #endif 26 #endif
27 const WrapperTypeInfo V8TestInterfaceConstructor2::wrapperTypeInfo = { gin::kEmb edderBlink, V8TestInterfaceConstructor2::domTemplate, V8TestInterfaceConstructor 2::refObject, V8TestInterfaceConstructor2::derefObject, V8TestInterfaceConstruct or2::trace, 0, 0, V8TestInterfaceConstructor2::preparePrototypeAndInterfaceObjec t, V8TestInterfaceConstructor2::installConditionallyEnabledProperties, "TestInte rfaceConstructor2", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeI nfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo: :Independent, WrapperTypeInfo::RefCountedObject }; 27 const WrapperTypeInfo V8TestInterfaceConstructor2::wrapperTypeInfo = { gin::kEmb edderBlink, V8TestInterfaceConstructor2::domTemplate, V8TestInterfaceConstructor 2::trace, 0, 0, V8TestInterfaceConstructor2::preparePrototypeAndInterfaceObject, V8TestInterfaceConstructor2::installConditionallyEnabledProperties, "TestInterf aceConstructor2", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInf o::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo::I ndependent };
28 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) 28 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
29 #pragma clang diagnostic pop 29 #pragma clang diagnostic pop
30 #endif 30 #endif
31 31
32 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eConstructor2.h. 32 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eConstructor2.h.
33 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 33 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
34 // bindings/core/v8/ScriptWrappable.h. 34 // bindings/core/v8/ScriptWrappable.h.
35 const WrapperTypeInfo& TestInterfaceConstructor2::s_wrapperTypeInfo = V8TestInte rfaceConstructor2::wrapperTypeInfo; 35 const WrapperTypeInfo& TestInterfaceConstructor2::s_wrapperTypeInfo = V8TestInte rfaceConstructor2::wrapperTypeInfo;
36 36
37 namespace TestInterfaceConstructor2V8Internal { 37 namespace TestInterfaceConstructor2V8Internal {
38 38
39 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) 39 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info)
40 { 40 {
41 V8StringResource<> stringArg; 41 V8StringResource<> stringArg;
42 { 42 {
43 stringArg = info[0]; 43 stringArg = info[0];
44 if (!stringArg.prepare()) 44 if (!stringArg.prepare())
45 return; 45 return;
46 } 46 }
47 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(s tringArg); 47 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(stringAr g);
48 v8::Local<v8::Object> wrapper = info.Holder(); 48 v8::Local<v8::Object> wrapper = info.Holder();
49 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper); 49 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper);
50 v8SetReturnValue(info, wrapper); 50 v8SetReturnValue(info, wrapper);
51 } 51 }
52 52
53 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) 53 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info)
54 { 54 {
55 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate()); 55 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate());
56 Dictionary dictionaryArg; 56 Dictionary dictionaryArg;
57 { 57 {
58 if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) { 58 if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) {
59 exceptionState.throwTypeError("parameter 1 ('dictionaryArg') is not an object."); 59 exceptionState.throwTypeError("parameter 1 ('dictionaryArg') is not an object.");
60 exceptionState.throwIfNeeded(); 60 exceptionState.throwIfNeeded();
61 return; 61 return;
62 } 62 }
63 dictionaryArg = Dictionary(info[0], info.GetIsolate(), exceptionState); 63 dictionaryArg = Dictionary(info[0], info.GetIsolate(), exceptionState);
64 if (exceptionState.throwIfNeeded()) 64 if (exceptionState.throwIfNeeded())
65 return; 65 return;
66 } 66 }
67 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(d ictionaryArg); 67 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(dictiona ryArg);
68 v8::Local<v8::Object> wrapper = info.Holder(); 68 v8::Local<v8::Object> wrapper = info.Holder();
69 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper); 69 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper);
70 v8SetReturnValue(info, wrapper); 70 v8SetReturnValue(info, wrapper);
71 } 71 }
72 72
73 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) 73 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info)
74 { 74 {
75 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate()); 75 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate());
76 Vector<Vector<String>> stringSequenceSequenceArg; 76 Vector<Vector<String>> stringSequenceSequenceArg;
77 { 77 {
78 stringSequenceSequenceArg = toImplArray<Vector<Vector<String>>>(info[0], 1, info.GetIsolate(), exceptionState); 78 stringSequenceSequenceArg = toImplArray<Vector<Vector<String>>>(info[0], 1, info.GetIsolate(), exceptionState);
79 if (exceptionState.throwIfNeeded()) 79 if (exceptionState.throwIfNeeded())
80 return; 80 return;
81 } 81 }
82 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(s tringSequenceSequenceArg); 82 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(stringSe quenceSequenceArg);
83 v8::Local<v8::Object> wrapper = info.Holder(); 83 v8::Local<v8::Object> wrapper = info.Holder();
84 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper); 84 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper);
85 v8SetReturnValue(info, wrapper); 85 v8SetReturnValue(info, wrapper);
86 } 86 }
87 87
88 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info) 88 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info)
89 { 89 {
90 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate()); 90 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate());
91 TestInterfaceEmpty* testInterfaceEmptyArg; 91 TestInterfaceEmpty* testInterfaceEmptyArg;
92 int longArg; 92 int longArg;
(...skipping 29 matching lines...) Expand all
122 } 122 }
123 if (!isUndefinedOrNull(info[4]) && !info[4]->IsObject()) { 123 if (!isUndefinedOrNull(info[4]) && !info[4]->IsObject()) {
124 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptiona lDictionaryArg') is not an object."); 124 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptiona lDictionaryArg') is not an object.");
125 exceptionState.throwIfNeeded(); 125 exceptionState.throwIfNeeded();
126 return; 126 return;
127 } 127 }
128 defaultUndefinedOptionalDictionaryArg = Dictionary(info[4], info.GetIsol ate(), exceptionState); 128 defaultUndefinedOptionalDictionaryArg = Dictionary(info[4], info.GetIsol ate(), exceptionState);
129 if (exceptionState.throwIfNeeded()) 129 if (exceptionState.throwIfNeeded())
130 return; 130 return;
131 if (UNLIKELY(numArgsPassed <= 5)) { 131 if (UNLIKELY(numArgsPassed <= 5)) {
132 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2:: create(testInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaul tNullStringOptionalStringArg, defaultUndefinedOptionalDictionaryArg); 132 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create( testInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullSt ringOptionalStringArg, defaultUndefinedOptionalDictionaryArg);
133 v8::Local<v8::Object> wrapper = info.Holder(); 133 v8::Local<v8::Object> wrapper = info.Holder();
134 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInter faceConstructor2::wrapperTypeInfo, wrapper); 134 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInter faceConstructor2::wrapperTypeInfo, wrapper);
135 v8SetReturnValue(info, wrapper); 135 v8SetReturnValue(info, wrapper);
136 return; 136 return;
137 } 137 }
138 optionalStringArg = info[5]; 138 optionalStringArg = info[5];
139 if (!optionalStringArg.prepare()) 139 if (!optionalStringArg.prepare())
140 return; 140 return;
141 } 141 }
142 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(t estInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullStr ingOptionalStringArg, defaultUndefinedOptionalDictionaryArg, optionalStringArg); 142 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(testInte rfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullStringOpti onalStringArg, defaultUndefinedOptionalDictionaryArg, optionalStringArg);
143 v8::Local<v8::Object> wrapper = info.Holder(); 143 v8::Local<v8::Object> wrapper = info.Holder();
144 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper); 144 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons tructor2::wrapperTypeInfo, wrapper);
145 v8SetReturnValue(info, wrapper); 145 v8SetReturnValue(info, wrapper);
146 } 146 }
147 147
148 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 148 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
149 { 149 {
150 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate()); 150 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate());
151 switch (std::min(6, info.Length())) { 151 switch (std::min(6, info.Length())) {
152 case 1: 152 case 1:
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 v8::Local<v8::Object> V8TestInterfaceConstructor2::findInstanceInPrototypeChain( v8::Local<v8::Value> v8Value, v8::Isolate* isolate) 248 v8::Local<v8::Object> V8TestInterfaceConstructor2::findInstanceInPrototypeChain( v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
249 { 249 {
250 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value); 250 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value);
251 } 251 }
252 252
253 TestInterfaceConstructor2* V8TestInterfaceConstructor2::toImplWithTypeCheck(v8:: Isolate* isolate, v8::Local<v8::Value> value) 253 TestInterfaceConstructor2* V8TestInterfaceConstructor2::toImplWithTypeCheck(v8:: Isolate* isolate, v8::Local<v8::Value> value)
254 { 254 {
255 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : 0; 255 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : 0;
256 } 256 }
257 257
258 void V8TestInterfaceConstructor2::refObject(ScriptWrappable* scriptWrappable)
259 {
260 scriptWrappable->toImpl<TestInterfaceConstructor2>()->ref();
261 }
262
263 void V8TestInterfaceConstructor2::derefObject(ScriptWrappable* scriptWrappable)
264 {
265 scriptWrappable->toImpl<TestInterfaceConstructor2>()->deref();
266 }
267
268 } // namespace blink 258 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698