| 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 28 matching lines...) Expand all Loading... |
| 39 #include "bindings/v8/Dictionary.h" | 39 #include "bindings/v8/Dictionary.h" |
| 40 #include "bindings/v8/ExceptionMessages.h" | 40 #include "bindings/v8/ExceptionMessages.h" |
| 41 #include "bindings/v8/V8Binding.h" | 41 #include "bindings/v8/V8Binding.h" |
| 42 #include "bindings/v8/V8DOMConfiguration.h" | 42 #include "bindings/v8/V8DOMConfiguration.h" |
| 43 #include "bindings/v8/V8DOMWrapper.h" | 43 #include "bindings/v8/V8DOMWrapper.h" |
| 44 #include "bindings/v8/V8ObjectConstructor.h" | 44 #include "bindings/v8/V8ObjectConstructor.h" |
| 45 #include "core/dom/ContextFeatures.h" | 45 #include "core/dom/ContextFeatures.h" |
| 46 #include "core/dom/Document.h" | 46 #include "core/dom/Document.h" |
| 47 #include "core/frame/UseCounter.h" | 47 #include "core/frame/UseCounter.h" |
| 48 #include "platform/TraceEvent.h" | 48 #include "platform/TraceEvent.h" |
| 49 #include "wtf/UnusedParam.h" | |
| 50 | 49 |
| 51 namespace WebCore { | 50 namespace WebCore { |
| 52 | 51 |
| 53 static void initializeScriptWrappableForInterface(Event* object) | 52 static void initializeScriptWrappableForInterface(Event* object) |
| 54 { | 53 { |
| 55 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 54 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
| 56 ScriptWrappable::setTypeInfoInObject(object, &V8TestExtendedEvent::wrapp
erTypeInfo); | 55 ScriptWrappable::setTypeInfoInObject(object, &V8TestExtendedEvent::wrapp
erTypeInfo); |
| 57 else | 56 else |
| 58 ASSERT_NOT_REACHED(); | 57 ASSERT_NOT_REACHED(); |
| 59 } | 58 } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 return; | 161 return; |
| 163 } | 162 } |
| 164 | 163 |
| 165 EventV8Internal::constructor(info); | 164 EventV8Internal::constructor(info); |
| 166 } | 165 } |
| 167 | 166 |
| 168 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestExtendedEventTemplate(v8:
:Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWor
ldType currentWorldType) | 167 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestExtendedEventTemplate(v8:
:Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWor
ldType currentWorldType) |
| 169 { | 168 { |
| 170 functionTemplate->ReadOnlyPrototype(); | 169 functionTemplate->ReadOnlyPrototype(); |
| 171 | 170 |
| 172 v8::Local<v8::Signature> defaultSignature; | 171 v8::Local<v8::Signature> ALLOW_UNUSED defaultSignature; |
| 173 if (!RuntimeEnabledFeatures::testEnabled()) | 172 if (!RuntimeEnabledFeatures::testEnabled()) |
| 174 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionT
emplate, "", V8TestEvent::GetTemplate(isolate, currentWorldType), V8TestExtended
Event::internalFieldCount, 0, 0, 0, 0, 0, 0, isolate, currentWorldType); | 173 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionT
emplate, "", V8TestEvent::GetTemplate(isolate, currentWorldType), V8TestExtended
Event::internalFieldCount, 0, 0, 0, 0, 0, 0, isolate, currentWorldType); |
| 175 else | 174 else |
| 176 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionT
emplate, "TestExtendedEvent", V8TestEvent::GetTemplate(isolate, currentWorldType
), V8TestExtendedEvent::internalFieldCount, | 175 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionT
emplate, "TestExtendedEvent", V8TestEvent::GetTemplate(isolate, currentWorldType
), V8TestExtendedEvent::internalFieldCount, |
| 177 V8TestExtendedEventAttributes, WTF_ARRAY_LENGTH(V8TestExtendedEventA
ttributes), | 176 V8TestExtendedEventAttributes, WTF_ARRAY_LENGTH(V8TestExtendedEventA
ttributes), |
| 178 0, 0, | 177 0, 0, |
| 179 0, 0, | 178 0, 0, |
| 180 isolate, currentWorldType); | 179 isolate, currentWorldType); |
| 181 UNUSED_PARAM(defaultSignature); | |
| 182 functionTemplate->SetCallHandler(V8TestExtendedEvent::constructorCallback); | 180 functionTemplate->SetCallHandler(V8TestExtendedEvent::constructorCallback); |
| 183 functionTemplate->SetLength(1); | 181 functionTemplate->SetLength(1); |
| 184 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 182 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 185 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | 183 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 186 UNUSED_PARAM(instanceTemplate); | |
| 187 UNUSED_PARAM(prototypeTemplate); | |
| 188 | 184 |
| 189 // Custom toString template | 185 // Custom toString template |
| 190 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 186 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
| 191 return functionTemplate; | 187 return functionTemplate; |
| 192 } | 188 } |
| 193 | 189 |
| 194 v8::Handle<v8::FunctionTemplate> V8TestExtendedEvent::GetTemplate(v8::Isolate* i
solate, WrapperWorldType currentWorldType) | 190 v8::Handle<v8::FunctionTemplate> V8TestExtendedEvent::GetTemplate(v8::Isolate* i
solate, WrapperWorldType currentWorldType) |
| 195 { | 191 { |
| 196 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 192 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 197 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 193 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 240 } |
| 245 | 241 |
| 246 template<> | 242 template<> |
| 247 v8::Handle<v8::Value> toV8NoInline(Event* impl, v8::Handle<v8::Object> creationC
ontext, v8::Isolate* isolate) | 243 v8::Handle<v8::Value> toV8NoInline(Event* impl, v8::Handle<v8::Object> creationC
ontext, v8::Isolate* isolate) |
| 248 { | 244 { |
| 249 return toV8(impl, creationContext, isolate); | 245 return toV8(impl, creationContext, isolate); |
| 250 } | 246 } |
| 251 | 247 |
| 252 } // namespace WebCore | 248 } // namespace WebCore |
| 253 #endif // ENABLE(TEST) | 249 #endif // ENABLE(TEST) |
| OLD | NEW |