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

Side by Side Diff: Source/bindings/tests/results/modules/V8TestInterface5.cpp

Issue 1153613007: bindings: Use CreateDataProperty() instead of ForceSet() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix uninitialized error Created 5 years, 6 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 #if ENABLE(CONDITION) 8 #if ENABLE(CONDITION)
9 #include "V8TestInterface5.h" 9 #include "V8TestInterface5.h"
10 10
(...skipping 18 matching lines...) Expand all
29 const WrapperTypeInfo V8TestInterface5::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface5::domTemplate, V8TestInterface5::refObject, V8TestInterface5::d erefObject, V8TestInterface5::trace, V8TestInterface5::toActiveDOMObject, V8Test Interface5::visitDOMWrapper, V8TestInterface5::preparePrototypeObject, V8TestInt erface5::installConditionallyEnabledProperties, "TestInterface5", &V8TestInterfa ceEmpty::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTy peInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeIn fo::Dependent, WrapperTypeInfo::RefCountedObject }; 29 const WrapperTypeInfo V8TestInterface5::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface5::domTemplate, V8TestInterface5::refObject, V8TestInterface5::d erefObject, V8TestInterface5::trace, V8TestInterface5::toActiveDOMObject, V8Test Interface5::visitDOMWrapper, V8TestInterface5::preparePrototypeObject, V8TestInt erface5::installConditionallyEnabledProperties, "TestInterface5", &V8TestInterfa ceEmpty::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTy peInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeIn fo::Dependent, WrapperTypeInfo::RefCountedObject };
30 30
31 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac e5Implementation.h. 31 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac e5Implementation.h.
32 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 32 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
33 // bindings/core/v8/ScriptWrappable.h. 33 // bindings/core/v8/ScriptWrappable.h.
34 const WrapperTypeInfo& TestInterface5Implementation::s_wrapperTypeInfo = V8TestI nterface5::wrapperTypeInfo; 34 const WrapperTypeInfo& TestInterface5Implementation::s_wrapperTypeInfo = V8TestI nterface5::wrapperTypeInfo;
35 35
36 namespace TestInterface5ImplementationV8Internal { 36 namespace TestInterface5ImplementationV8Internal {
37 37
38 template<class CallbackInfo> 38 template<class CallbackInfo>
39 static void TestInterface5ImplementationForceSetAttributeOnThis(v8::Local<v8::Na me> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info) 39 static bool TestInterface5ImplementationCreateDataProperty(v8::Local<v8::Name> n ame, v8::Local<v8::Value> v8Value, const CallbackInfo& info)
40 { 40 {
41 ASSERT(info.This()->IsObject()); 41 ASSERT(info.This()->IsObject());
42 v8::Local<v8::Object>::Cast(info.This())->ForceSet(info.GetIsolate()->GetCur rentContext(), name, v8Value); 42 return v8CallBoolean(v8::Local<v8::Object>::Cast(info.This())->CreateDataPro perty(info.GetIsolate()->GetCurrentContext(), name, v8Value));
43 } 43 }
44 44
45 static void TestInterface5ImplementationConstructorAttributeSetterCallback(v8::L ocal<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<voi d>& info) 45 static void TestInterface5ImplementationConstructorAttributeSetterCallback(v8::L ocal<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<voi d>& info)
46 { 46 {
47 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 47 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
48 do { 48 do {
49 v8::Local<v8::Value> data = info.Data(); 49 v8::Local<v8::Value> data = info.Data();
50 ASSERT(data->IsExternal()); 50 ASSERT(data->IsExternal());
51 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()- >CreationContext()); 51 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()- >CreationContext());
52 if (!perContextData) 52 if (!perContextData)
53 break; 53 break;
54 const WrapperTypeInfo* wrapperTypeInfo = WrapperTypeInfo::unwrap(data); 54 const WrapperTypeInfo* wrapperTypeInfo = WrapperTypeInfo::unwrap(data);
55 if (!wrapperTypeInfo) 55 if (!wrapperTypeInfo)
56 break; 56 break;
57 TestInterface5ImplementationForceSetAttributeOnThis(v8String(info.GetIso late(), wrapperTypeInfo->interfaceName), v8Value, info); 57 TestInterface5ImplementationCreateDataProperty(v8String(info.GetIsolate( ), wrapperTypeInfo->interfaceName), v8Value, info);
58 } while (false); // do ... while (false) just for use of break 58 } while (false); // do ... while (false) just for use of break
59 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 59 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
60 } 60 }
61 61
62 static void testInterfaceAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info) 62 static void testInterfaceAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info)
63 { 63 {
64 v8::Local<v8::Object> holder = info.Holder(); 64 v8::Local<v8::Object> holder = info.Holder();
65 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 65 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
66 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl ); 66 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl );
67 } 67 }
(...skipping 23 matching lines...) Expand all
91 { 91 {
92 v8::Local<v8::Value> v8Value = info[0]; 92 v8::Local<v8::Value> v8Value = info[0];
93 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 93 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
94 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSette r(v8Value, info); 94 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSette r(v8Value, info);
95 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 95 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
96 } 96 }
97 97
98 static void testInterfaceConstructorAttributeAttributeSetter(v8::Local<v8::Value > v8Value, const v8::PropertyCallbackInfo<void>& info) 98 static void testInterfaceConstructorAttributeAttributeSetter(v8::Local<v8::Value > v8Value, const v8::PropertyCallbackInfo<void>& info)
99 { 99 {
100 v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "test InterfaceConstructorAttribute"); 100 v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "test InterfaceConstructorAttribute");
101 TestInterface5ImplementationForceSetAttributeOnThis(propertyName, v8Value, i nfo); 101 TestInterface5ImplementationCreateDataProperty(propertyName, v8Value, info);
102 } 102 }
103 103
104 static void testInterfaceConstructorAttributeAttributeSetterCallback(v8::Local<v 8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& in fo) 104 static void testInterfaceConstructorAttributeAttributeSetterCallback(v8::Local<v 8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& in fo)
105 { 105 {
106 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 106 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
107 TestInterface5ImplementationV8Internal::testInterfaceConstructorAttributeAtt ributeSetter(v8Value, info); 107 TestInterface5ImplementationV8Internal::testInterfaceConstructorAttributeAtt ributeSetter(v8Value, info);
108 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 108 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
109 } 109 }
110 110
111 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va lue>& info) 111 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va lue>& info)
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 scriptWrappable->toImpl<TestInterface5Implementation>()->ref(); 1062 scriptWrappable->toImpl<TestInterface5Implementation>()->ref();
1063 } 1063 }
1064 1064
1065 void V8TestInterface5::derefObject(ScriptWrappable* scriptWrappable) 1065 void V8TestInterface5::derefObject(ScriptWrappable* scriptWrappable)
1066 { 1066 {
1067 scriptWrappable->toImpl<TestInterface5Implementation>()->deref(); 1067 scriptWrappable->toImpl<TestInterface5Implementation>()->deref();
1068 } 1068 }
1069 1069
1070 } // namespace blink 1070 } // namespace blink
1071 #endif // ENABLE(CONDITION) 1071 #endif // ENABLE(CONDITION)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698