| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 v8SetReturnValueString(info, imp->initializedByEventConstructorReadonlyStrin
gAttribute(), info.GetIsolate()); | 92 v8SetReturnValueString(info, imp->initializedByEventConstructorReadonlyStrin
gAttribute(), info.GetIsolate()); |
| 93 } | 93 } |
| 94 | 94 |
| 95 static void initializedByEventConstructorReadonlyStringAttributeAttributeGetterC
allback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 95 static void initializedByEventConstructorReadonlyStringAttributeAttributeGetterC
allback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 96 { | 96 { |
| 97 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 97 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 98 TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadon
lyStringAttributeAttributeGetter(info); | 98 TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadon
lyStringAttributeAttributeGetter(info); |
| 99 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 99 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 100 } | 100 } |
| 101 | 101 |
| 102 static void initializedByEventConstructorReadonlyAnyAttributeAttributeGetter(con
st v8::PropertyCallbackInfo<v8::Value>& info) |
| 103 { |
| 104 TestInterfaceEventConstructor* imp = V8TestInterfaceEventConstructor::toNati
ve(info.Holder()); |
| 105 v8SetReturnValue(info, imp->initializedByEventConstructorReadonlyAnyAttribut
e().v8Value()); |
| 106 } |
| 107 |
| 108 static void initializedByEventConstructorReadonlyAnyAttributeAttributeGetterCall
back(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 109 { |
| 110 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 111 TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadon
lyAnyAttributeAttributeGetter(info); |
| 112 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 113 } |
| 114 |
| 102 static void deprecatedInitializedByEventConstructorReadonlyStringAttributeAttrib
uteGetter(const v8::PropertyCallbackInfo<v8::Value>& info) | 115 static void deprecatedInitializedByEventConstructorReadonlyStringAttributeAttrib
uteGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| 103 { | 116 { |
| 104 TestInterfaceEventConstructor* imp = V8TestInterfaceEventConstructor::toNati
ve(info.Holder()); | 117 TestInterfaceEventConstructor* imp = V8TestInterfaceEventConstructor::toNati
ve(info.Holder()); |
| 105 v8SetReturnValueString(info, imp->deprecatedInitializedByEventConstructorRea
donlyStringAttribute(), info.GetIsolate()); | 118 v8SetReturnValueString(info, imp->deprecatedInitializedByEventConstructorRea
donlyStringAttribute(), info.GetIsolate()); |
| 106 } | 119 } |
| 107 | 120 |
| 108 static void deprecatedInitializedByEventConstructorReadonlyStringAttributeAttrib
uteGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Valu
e>& info) | 121 static void deprecatedInitializedByEventConstructorReadonlyStringAttributeAttrib
uteGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Valu
e>& info) |
| 109 { | 122 { |
| 110 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 123 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 111 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::initializ
edByEventConstructorReadonlyStringAttribute); | 124 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::initializ
edByEventConstructorReadonlyStringAttribute); |
| 112 TestInterfaceEventConstructorV8Internal::deprecatedInitializedByEventConstru
ctorReadonlyStringAttributeAttributeGetter(info); | 125 TestInterfaceEventConstructorV8Internal::deprecatedInitializedByEventConstru
ctorReadonlyStringAttributeAttributeGetter(info); |
| 113 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 126 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 114 } | 127 } |
| 115 | 128 |
| 116 static void initializedByEventConstructorReadonlyAnyAttributeAttributeGetter(con
st v8::PropertyCallbackInfo<v8::Value>& info) | 129 static void implementedAsInitializedByEventConstructorReadonlyStringAttributeAtt
ributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| 117 { | 130 { |
| 118 TestInterfaceEventConstructor* imp = V8TestInterfaceEventConstructor::toNati
ve(info.Holder()); | 131 TestInterfaceEventConstructor* imp = V8TestInterfaceEventConstructor::toNati
ve(info.Holder()); |
| 119 v8SetReturnValue(info, imp->initializedByEventConstructorReadonlyAnyAttribut
e().v8Value()); | 132 v8SetReturnValueString(info, imp->implementedAsName(), info.GetIsolate()); |
| 120 } | 133 } |
| 121 | 134 |
| 122 static void initializedByEventConstructorReadonlyAnyAttributeAttributeGetterCall
back(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 135 static void implementedAsInitializedByEventConstructorReadonlyStringAttributeAtt
ributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::V
alue>& info) |
| 123 { | 136 { |
| 124 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 137 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 125 TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadon
lyAnyAttributeAttributeGetter(info); | 138 TestInterfaceEventConstructorV8Internal::implementedAsInitializedByEventCons
tructorReadonlyStringAttributeAttributeGetter(info); |
| 126 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 139 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 127 } | 140 } |
| 128 | 141 |
| 142 static void deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAt
tributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
| 143 { |
| 144 TestInterfaceEventConstructor* imp = V8TestInterfaceEventConstructor::toNati
ve(info.Holder()); |
| 145 v8SetReturnValueString(info, imp->deprecatedImplementedAsName(), info.GetIso
late()); |
| 146 } |
| 147 |
| 148 static void deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAt
tributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallback
Info<v8::Value>& info) |
| 149 { |
| 150 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 151 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::initializ
edByEventConstructorReadonlyStringAttribute); |
| 152 TestInterfaceEventConstructorV8Internal::deprecatedImplementedAsInitializedB
yEventConstructorReadonlyStringAttributeAttributeGetter(info); |
| 153 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 154 } |
| 155 |
| 129 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) | 156 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 130 { | 157 { |
| 131 if (info.Length() < 1) { | 158 if (info.Length() < 1) { |
| 132 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceEventC
onstructor", "An event name must be provided."), info.GetIsolate()); | 159 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceEventC
onstructor", "An event name must be provided."), info.GetIsolate()); |
| 133 return; | 160 return; |
| 134 } | 161 } |
| 135 | 162 |
| 136 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]); | 163 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]); |
| 137 v8::Local<v8::Value> initializedByEventConstructorReadonlyAnyAttribute; | 164 v8::Local<v8::Value> initializedByEventConstructorReadonlyAnyAttribute; |
| 138 TestInterfaceEventConstructorInit eventInit; | 165 TestInterfaceEventConstructorInit eventInit; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 156 v8::Handle<v8::Object> wrapper = info.Holder(); | 183 v8::Handle<v8::Object> wrapper = info.Holder(); |
| 157 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEventConstructor>(ev
ent.release(), &V8TestInterfaceEventConstructor::wrapperTypeInfo, wrapper, info.
GetIsolate(), WrapperConfiguration::Dependent); | 184 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEventConstructor>(ev
ent.release(), &V8TestInterfaceEventConstructor::wrapperTypeInfo, wrapper, info.
GetIsolate(), WrapperConfiguration::Dependent); |
| 158 v8SetReturnValue(info, wrapper); | 185 v8SetReturnValue(info, wrapper); |
| 159 } | 186 } |
| 160 | 187 |
| 161 } // namespace TestInterfaceEventConstructorV8Internal | 188 } // namespace TestInterfaceEventConstructorV8Internal |
| 162 | 189 |
| 163 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceEventCons
tructorAttributes[] = { | 190 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceEventCons
tructorAttributes[] = { |
| 164 {"readonlyStringAttribute", TestInterfaceEventConstructorV8Internal::readonl
yStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessContr
ol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance
*/}, | 191 {"readonlyStringAttribute", TestInterfaceEventConstructorV8Internal::readonl
yStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessContr
ol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance
*/}, |
| 165 {"initializedByEventConstructorReadonlyStringAttribute", TestInterfaceEventC
onstructorV8Internal::initializedByEventConstructorReadonlyStringAttributeAttrib
uteGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stat
ic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 192 {"initializedByEventConstructorReadonlyStringAttribute", TestInterfaceEventC
onstructorV8Internal::initializedByEventConstructorReadonlyStringAttributeAttrib
uteGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stat
ic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 193 {"initializedByEventConstructorReadonlyAnyAttribute", TestInterfaceEventCons
tructorV8Internal::initializedByEventConstructorReadonlyAnyAttributeAttributeGet
terCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas
t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 166 {"deprecatedInitializedByEventConstructorReadonlyStringAttribute", TestInter
faceEventConstructorV8Internal::deprecatedInitializedByEventConstructorReadonlyS
tringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance *
/}, | 194 {"deprecatedInitializedByEventConstructorReadonlyStringAttribute", TestInter
faceEventConstructorV8Internal::deprecatedInitializedByEventConstructorReadonlyS
tringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance *
/}, |
| 167 {"initializedByEventConstructorReadonlyAnyAttribute", TestInterfaceEventCons
tructorV8Internal::initializedByEventConstructorReadonlyAnyAttributeAttributeGet
terCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas
t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 195 {"implementedAsInitializedByEventConstructorReadonlyStringAttribute", TestIn
terfaceEventConstructorV8Internal::implementedAsInitializedByEventConstructorRea
donlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessC
ontrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on inst
ance */}, |
| 196 {"deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttribut
e", TestInterfaceEventConstructorV8Internal::deprecatedImplementedAsInitializedB
yEventConstructorReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, sta
tic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8:
:None), 0 /* on instance */}, |
| 168 }; | 197 }; |
| 169 | 198 |
| 170 bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit&
eventInit, const Dictionary& options, ExceptionState& exceptionState, const Stri
ng& forEventName) | 199 bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit&
eventInit, const Dictionary& options, ExceptionState& exceptionState, const Stri
ng& forEventName) |
| 171 { | 200 { |
| 172 Dictionary::ConversionContext conversionContext(forEventName.isEmpty() ? Str
ing("TestInterfaceEventConstructor") : forEventName, "", exceptionState); | 201 Dictionary::ConversionContext conversionContext(forEventName.isEmpty() ? Str
ing("TestInterfaceEventConstructor") : forEventName, "", exceptionState); |
| 173 if (!initializeEvent(eventInit, options, exceptionState, forEventName.isEmpt
y() ? String("TestInterfaceEventConstructor") : forEventName)) | 202 if (!initializeEvent(eventInit, options, exceptionState, forEventName.isEmpt
y() ? String("TestInterfaceEventConstructor") : forEventName)) |
| 174 return false; | 203 return false; |
| 175 | 204 |
| 176 if (!options.convert(conversionContext, "initializedByEventConstructorReadon
lyStringAttribute", eventInit.initializedByEventConstructorReadonlyStringAttribu
te)) | 205 if (!options.convert(conversionContext, "initializedByEventConstructorReadon
lyStringAttribute", eventInit.initializedByEventConstructorReadonlyStringAttribu
te)) |
| 177 return false; | 206 return false; |
| 178 if (options.convert(conversionContext, "deprecatedInitializedByEventConstruc
torReadonlyStringAttribute", eventInit.deprecatedInitializedByEventConstructorRe
adonlyStringAttribute)) { | 207 if (options.convert(conversionContext, "deprecatedInitializedByEventConstruc
torReadonlyStringAttribute", eventInit.deprecatedInitializedByEventConstructorRe
adonlyStringAttribute)) { |
| 179 if (options.hasProperty("deprecatedInitializedByEventConstructorReadonly
StringAttribute")) | 208 if (options.hasProperty("deprecatedInitializedByEventConstructorReadonly
StringAttribute")) |
| 180 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::i
nitializedByEventConstructorReadonlyStringAttribute); | 209 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::i
nitializedByEventConstructorReadonlyStringAttribute); |
| 181 } else { | 210 } else { |
| 182 return false; | 211 return false; |
| 183 } | 212 } |
| 213 if (!options.convert(conversionContext, "implementedAsInitializedByEventCons
tructorReadonlyStringAttribute", eventInit.implementedAsName)) |
| 214 return false; |
| 215 if (options.convert(conversionContext, "deprecatedImplementedAsInitializedBy
EventConstructorReadonlyStringAttribute", eventInit.deprecatedImplementedAsName)
) { |
| 216 if (options.hasProperty("deprecatedImplementedAsInitializedByEventConstr
uctorReadonlyStringAttribute")) |
| 217 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::i
nitializedByEventConstructorReadonlyStringAttribute); |
| 218 } else { |
| 219 return false; |
| 220 } |
| 184 return true; | 221 return true; |
| 185 } | 222 } |
| 186 | 223 |
| 187 void V8TestInterfaceEventConstructor::constructorCallback(const v8::FunctionCall
backInfo<v8::Value>& info) | 224 void V8TestInterfaceEventConstructor::constructorCallback(const v8::FunctionCall
backInfo<v8::Value>& info) |
| 188 { | 225 { |
| 189 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); | 226 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); |
| 190 if (!info.IsConstructCall()) { | 227 if (!info.IsConstructCall()) { |
| 191 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceEventC
onstructor", "Please use the 'new' operator, this DOM object constructor cannot
be called as a function."), info.GetIsolate()); | 228 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceEventC
onstructor", "Please use the 'new' operator, this DOM object constructor cannot
be called as a function."), info.GetIsolate()); |
| 192 return; | 229 return; |
| 193 } | 230 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 fromInternalPointer(object)->deref(); | 309 fromInternalPointer(object)->deref(); |
| 273 } | 310 } |
| 274 | 311 |
| 275 template<> | 312 template<> |
| 276 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventConstructor* impl, v8::Hand
le<v8::Object> creationContext, v8::Isolate* isolate) | 313 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventConstructor* impl, v8::Hand
le<v8::Object> creationContext, v8::Isolate* isolate) |
| 277 { | 314 { |
| 278 return toV8(impl, creationContext, isolate); | 315 return toV8(impl, creationContext, isolate); |
| 279 } | 316 } |
| 280 | 317 |
| 281 } // namespace WebCore | 318 } // namespace WebCore |
| OLD | NEW |