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

Side by Side Diff: Source/bindings/tests/results/core/V8TestInterface.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 "V8TestInterface.h" 9 #include "V8TestInterface.h"
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 namespace TestInterfaceImplementationV8Internal { 51 namespace TestInterfaceImplementationV8Internal {
52 static void (*voidMethodPartialOverloadMethodForPartialInterface)(const v8::Func tionCallbackInfo<v8::Value>&) = 0; 52 static void (*voidMethodPartialOverloadMethodForPartialInterface)(const v8::Func tionCallbackInfo<v8::Value>&) = 0;
53 static void (*staticVoidMethodPartialOverloadMethodForPartialInterface)(const v8 ::FunctionCallbackInfo<v8::Value>&) = 0; 53 static void (*staticVoidMethodPartialOverloadMethodForPartialInterface)(const v8 ::FunctionCallbackInfo<v8::Value>&) = 0;
54 static void (*promiseMethodPartialOverloadMethodForPartialInterface)(const v8::F unctionCallbackInfo<v8::Value>&) = 0; 54 static void (*promiseMethodPartialOverloadMethodForPartialInterface)(const v8::F unctionCallbackInfo<v8::Value>&) = 0;
55 static void (*staticPromiseMethodPartialOverloadMethodForPartialInterface)(const v8::FunctionCallbackInfo<v8::Value>&) = 0; 55 static void (*staticPromiseMethodPartialOverloadMethodForPartialInterface)(const v8::FunctionCallbackInfo<v8::Value>&) = 0;
56 static void (*partial2VoidMethodMethodForPartialInterface)(const v8::FunctionCal lbackInfo<v8::Value>&) = 0; 56 static void (*partial2VoidMethodMethodForPartialInterface)(const v8::FunctionCal lbackInfo<v8::Value>&) = 0;
57 static void (*partial2StaticVoidMethodMethodForPartialInterface)(const v8::Funct ionCallbackInfo<v8::Value>&) = 0; 57 static void (*partial2StaticVoidMethodMethodForPartialInterface)(const v8::Funct ionCallbackInfo<v8::Value>&) = 0;
58 58
59 template<class CallbackInfo> 59 template<class CallbackInfo>
60 static void TestInterfaceImplementationForceSetAttributeOnThis(v8::Local<v8::Nam e> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info) 60 static bool TestInterfaceImplementationCreateDataProperty(v8::Local<v8::Name> na me, v8::Local<v8::Value> v8Value, const CallbackInfo& info)
61 { 61 {
62 ASSERT(info.This()->IsObject()); 62 ASSERT(info.This()->IsObject());
63 v8::Local<v8::Object>::Cast(info.This())->ForceSet(info.GetIsolate()->GetCur rentContext(), name, v8Value); 63 return v8CallBoolean(v8::Local<v8::Object>::Cast(info.This())->CreateDataPro perty(info.GetIsolate()->GetCurrentContext(), name, v8Value));
64 } 64 }
65 65
66 static void TestInterfaceImplementationConstructorAttributeSetterCallback(v8::Lo cal<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void >& info) 66 static void TestInterfaceImplementationConstructorAttributeSetterCallback(v8::Lo cal<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void >& info)
67 { 67 {
68 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 68 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
69 do { 69 do {
70 v8::Local<v8::Value> data = info.Data(); 70 v8::Local<v8::Value> data = info.Data();
71 ASSERT(data->IsExternal()); 71 ASSERT(data->IsExternal());
72 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()- >CreationContext()); 72 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()- >CreationContext());
73 if (!perContextData) 73 if (!perContextData)
74 break; 74 break;
75 const WrapperTypeInfo* wrapperTypeInfo = WrapperTypeInfo::unwrap(data); 75 const WrapperTypeInfo* wrapperTypeInfo = WrapperTypeInfo::unwrap(data);
76 if (!wrapperTypeInfo) 76 if (!wrapperTypeInfo)
77 break; 77 break;
78 TestInterfaceImplementationForceSetAttributeOnThis(v8String(info.GetIsol ate(), wrapperTypeInfo->interfaceName), v8Value, info); 78 TestInterfaceImplementationCreateDataProperty(v8String(info.GetIsolate() , wrapperTypeInfo->interfaceName), v8Value, info);
79 } while (false); // do ... while (false) just for use of break 79 } while (false); // do ... while (false) just for use of break
80 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 80 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
81 } 81 }
82 82
83 static void testInterfaceAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info) 83 static void testInterfaceAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info)
84 { 84 {
85 v8::Local<v8::Object> holder = info.Holder(); 85 v8::Local<v8::Object> holder = info.Holder();
86 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); 86 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder);
87 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl ); 87 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl );
88 } 88 }
(...skipping 25 matching lines...) Expand all
114 v8::Local<v8::Value> v8Value = info[0]; 114 v8::Local<v8::Value> v8Value = info[0];
115 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 115 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
116 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte xt(info.GetIsolate()), UseCounter::V8TestInterface_TestInterfaceAttribute_Attrib uteSetter); 116 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte xt(info.GetIsolate()), UseCounter::V8TestInterface_TestInterfaceAttribute_Attrib uteSetter);
117 TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeSetter (v8Value, info); 117 TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeSetter (v8Value, info);
118 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 118 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
119 } 119 }
120 120
121 static void testInterfaceConstructorAttributeAttributeSetter(v8::Local<v8::Value > v8Value, const v8::PropertyCallbackInfo<void>& info) 121 static void testInterfaceConstructorAttributeAttributeSetter(v8::Local<v8::Value > v8Value, const v8::PropertyCallbackInfo<void>& info)
122 { 122 {
123 v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "test InterfaceConstructorAttribute"); 123 v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "test InterfaceConstructorAttribute");
124 TestInterfaceImplementationForceSetAttributeOnThis(propertyName, v8Value, in fo); 124 TestInterfaceImplementationCreateDataProperty(propertyName, v8Value, info);
125 } 125 }
126 126
127 static void testInterfaceConstructorAttributeAttributeSetterCallback(v8::Local<v 8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& in fo) 127 static void testInterfaceConstructorAttributeAttributeSetterCallback(v8::Local<v 8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& in fo)
128 { 128 {
129 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 129 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
130 TestInterfaceImplementationV8Internal::testInterfaceConstructorAttributeAttr ibuteSetter(v8Value, info); 130 TestInterfaceImplementationV8Internal::testInterfaceConstructorAttributeAttr ibuteSetter(v8Value, info);
131 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 131 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
132 } 132 }
133 133
134 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va lue>& info) 134 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va lue>& info)
(...skipping 2525 matching lines...) Expand 10 before | Expand all | Expand 10 after
2660 void V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(void ( *method)(const v8::FunctionCallbackInfo<v8::Value>&)) 2660 void V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(void ( *method)(const v8::FunctionCallbackInfo<v8::Value>&))
2661 { 2661 {
2662 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt erface = method; 2662 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt erface = method;
2663 } 2663 }
2664 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface( void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 2664 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface( void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
2665 { 2665 {
2666 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart ialInterface = method; 2666 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart ialInterface = method;
2667 } 2667 }
2668 } // namespace blink 2668 } // namespace blink
2669 #endif // ENABLE(CONDITION) 2669 #endif // ENABLE(CONDITION)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698