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

Side by Side Diff: Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.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 #include "V8TestInterfaceNamedConstructor.h" 8 #include "V8TestInterfaceNamedConstructor.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 12 matching lines...) Expand all
23 const WrapperTypeInfo V8TestInterfaceNamedConstructor::wrapperTypeInfo = { gin:: kEmbedderBlink, V8TestInterfaceNamedConstructor::domTemplate, V8TestInterfaceNam edConstructor::refObject, V8TestInterfaceNamedConstructor::derefObject, V8TestIn terfaceNamedConstructor::trace, V8TestInterfaceNamedConstructor::toActiveDOMObje ct, 0, V8TestInterfaceNamedConstructor::preparePrototypeObject, V8TestInterfaceN amedConstructor::installConditionallyEnabledProperties, "TestInterfaceNamedConst ructor", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::Object ClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo::Dependent, WrapperTypeInfo::RefCountedObject }; 23 const WrapperTypeInfo V8TestInterfaceNamedConstructor::wrapperTypeInfo = { gin:: kEmbedderBlink, V8TestInterfaceNamedConstructor::domTemplate, V8TestInterfaceNam edConstructor::refObject, V8TestInterfaceNamedConstructor::derefObject, V8TestIn terfaceNamedConstructor::trace, V8TestInterfaceNamedConstructor::toActiveDOMObje ct, 0, V8TestInterfaceNamedConstructor::preparePrototypeObject, V8TestInterfaceN amedConstructor::installConditionallyEnabledProperties, "TestInterfaceNamedConst ructor", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::Object ClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo::Dependent, WrapperTypeInfo::RefCountedObject };
24 24
25 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eNamedConstructor.h. 25 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eNamedConstructor.h.
26 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 26 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
27 // bindings/core/v8/ScriptWrappable.h. 27 // bindings/core/v8/ScriptWrappable.h.
28 const WrapperTypeInfo& TestInterfaceNamedConstructor::s_wrapperTypeInfo = V8Test InterfaceNamedConstructor::wrapperTypeInfo; 28 const WrapperTypeInfo& TestInterfaceNamedConstructor::s_wrapperTypeInfo = V8Test InterfaceNamedConstructor::wrapperTypeInfo;
29 29
30 namespace TestInterfaceNamedConstructorV8Internal { 30 namespace TestInterfaceNamedConstructorV8Internal {
31 31
32 template<class CallbackInfo> 32 template<class CallbackInfo>
33 static void TestInterfaceNamedConstructorForceSetAttributeOnThis(v8::Local<v8::N ame> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info) 33 static bool TestInterfaceNamedConstructorCreateDataProperty(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info)
34 { 34 {
35 ASSERT(info.This()->IsObject()); 35 ASSERT(info.This()->IsObject());
36 v8::Local<v8::Object>::Cast(info.This())->ForceSet(info.GetIsolate()->GetCur rentContext(), name, v8Value); 36 return v8CallBoolean(v8::Local<v8::Object>::Cast(info.This())->CreateDataPro perty(info.GetIsolate()->GetCurrentContext(), name, v8Value));
37 } 37 }
38 38
39 static void TestInterfaceNamedConstructorConstructorAttributeSetterCallback(v8:: Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<vo id>& info) 39 static void TestInterfaceNamedConstructorConstructorAttributeSetterCallback(v8:: Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<vo id>& info)
40 { 40 {
41 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 41 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
42 do { 42 do {
43 v8::Local<v8::Value> data = info.Data(); 43 v8::Local<v8::Value> data = info.Data();
44 ASSERT(data->IsExternal()); 44 ASSERT(data->IsExternal());
45 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()- >CreationContext()); 45 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()- >CreationContext());
46 if (!perContextData) 46 if (!perContextData)
47 break; 47 break;
48 const WrapperTypeInfo* wrapperTypeInfo = WrapperTypeInfo::unwrap(data); 48 const WrapperTypeInfo* wrapperTypeInfo = WrapperTypeInfo::unwrap(data);
49 if (!wrapperTypeInfo) 49 if (!wrapperTypeInfo)
50 break; 50 break;
51 TestInterfaceNamedConstructorForceSetAttributeOnThis(v8String(info.GetIs olate(), wrapperTypeInfo->interfaceName), v8Value, info); 51 TestInterfaceNamedConstructorCreateDataProperty(v8String(info.GetIsolate (), wrapperTypeInfo->interfaceName), v8Value, info);
52 } while (false); // do ... while (false) just for use of break 52 } while (false); // do ... while (false) just for use of break
53 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 53 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
54 } 54 }
55 55
56 static void testNamedConstructorConstructorAttributeAttributeSetter(v8::Local<v8 ::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 56 static void testNamedConstructorConstructorAttributeAttributeSetter(v8::Local<v8 ::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
57 { 57 {
58 v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "test NamedConstructorConstructorAttribute"); 58 v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "test NamedConstructorConstructorAttribute");
59 TestInterfaceNamedConstructorForceSetAttributeOnThis(propertyName, v8Value, info); 59 TestInterfaceNamedConstructorCreateDataProperty(propertyName, v8Value, info) ;
60 } 60 }
61 61
62 static void testNamedConstructorConstructorAttributeAttributeSetterCallback(v8:: Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<vo id>& info) 62 static void testNamedConstructorConstructorAttributeAttributeSetterCallback(v8:: Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<vo id>& info)
63 { 63 {
64 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 64 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
65 TestInterfaceNamedConstructorV8Internal::testNamedConstructorConstructorAttr ibuteAttributeSetter(v8Value, info); 65 TestInterfaceNamedConstructorV8Internal::testNamedConstructorConstructorAttr ibuteAttributeSetter(v8Value, info);
66 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 66 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
67 } 67 }
68 68
69 } // namespace TestInterfaceNamedConstructorV8Internal 69 } // namespace TestInterfaceNamedConstructorV8Internal
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 { 209 {
210 scriptWrappable->toImpl<TestInterfaceNamedConstructor>()->ref(); 210 scriptWrappable->toImpl<TestInterfaceNamedConstructor>()->ref();
211 } 211 }
212 212
213 void V8TestInterfaceNamedConstructor::derefObject(ScriptWrappable* scriptWrappab le) 213 void V8TestInterfaceNamedConstructor::derefObject(ScriptWrappable* scriptWrappab le)
214 { 214 {
215 scriptWrappable->toImpl<TestInterfaceNamedConstructor>()->deref(); 215 scriptWrappable->toImpl<TestInterfaceNamedConstructor>()->deref();
216 } 216 }
217 217
218 } // namespace blink 218 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp ('k') | Source/bindings/tests/results/core/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698