| 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/ExceptionState.h" | 39 #include "bindings/v8/ExceptionState.h" |
| 40 #include "bindings/v8/V8Binding.h" | 40 #include "bindings/v8/V8Binding.h" |
| 41 #include "bindings/v8/V8DOMConfiguration.h" | 41 #include "bindings/v8/V8DOMConfiguration.h" |
| 42 #include "bindings/v8/V8DOMWrapper.h" | 42 #include "bindings/v8/V8DOMWrapper.h" |
| 43 #include "bindings/v8/V8ObjectConstructor.h" | 43 #include "bindings/v8/V8ObjectConstructor.h" |
| 44 #include "bindings/v8/custom/V8ArrayBufferCustom.h" | 44 #include "bindings/v8/custom/V8ArrayBufferCustom.h" |
| 45 #include "bindings/v8/custom/V8ArrayBufferViewCustom.h" | 45 #include "bindings/v8/custom/V8ArrayBufferViewCustom.h" |
| 46 #include "core/dom/ContextFeatures.h" | 46 #include "core/dom/ContextFeatures.h" |
| 47 #include "core/dom/Document.h" | 47 #include "core/dom/Document.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(TestOverloadedConstructors* ob
ject) | 52 static void initializeScriptWrappableForInterface(TestOverloadedConstructors* ob
ject) |
| 54 { | 53 { |
| 55 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 54 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
| 56 ScriptWrappable::setTypeInfoInObject(object, &V8TestOverloadedConstructo
rs::wrapperTypeInfo); | 55 ScriptWrappable::setTypeInfoInObject(object, &V8TestOverloadedConstructo
rs::wrapperTypeInfo); |
| 57 else | 56 else |
| 58 ASSERT_NOT_REACHED(); | 57 ASSERT_NOT_REACHED(); |
| 59 } | 58 } |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 return; | 156 return; |
| 158 } | 157 } |
| 159 | 158 |
| 160 TestOverloadedConstructorsV8Internal::constructor(info); | 159 TestOverloadedConstructorsV8Internal::constructor(info); |
| 161 } | 160 } |
| 162 | 161 |
| 163 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestOverloadedConstructorsTem
plate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, W
rapperWorldType currentWorldType) | 162 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestOverloadedConstructorsTem
plate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, W
rapperWorldType currentWorldType) |
| 164 { | 163 { |
| 165 functionTemplate->ReadOnlyPrototype(); | 164 functionTemplate->ReadOnlyPrototype(); |
| 166 | 165 |
| 167 v8::Local<v8::Signature> defaultSignature; | 166 v8::Local<v8::Signature> ALLOW_UNUSED defaultSignature; |
| 168 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestOverloadedConstructors", v8::Local<v8::FunctionTemplate>(), V8TestOver
loadedConstructors::internalFieldCount, | 167 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestOverloadedConstructors", v8::Local<v8::FunctionTemplate>(), V8TestOver
loadedConstructors::internalFieldCount, |
| 169 0, 0, | 168 0, 0, |
| 170 0, 0, | 169 0, 0, |
| 171 0, 0, | 170 0, 0, |
| 172 isolate, currentWorldType); | 171 isolate, currentWorldType); |
| 173 UNUSED_PARAM(defaultSignature); | |
| 174 functionTemplate->SetCallHandler(V8TestOverloadedConstructors::constructorCa
llback); | 172 functionTemplate->SetCallHandler(V8TestOverloadedConstructors::constructorCa
llback); |
| 175 functionTemplate->SetLength(1); | 173 functionTemplate->SetLength(1); |
| 176 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 174 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 177 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | 175 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 178 UNUSED_PARAM(instanceTemplate); | |
| 179 UNUSED_PARAM(prototypeTemplate); | |
| 180 | 176 |
| 181 // Custom toString template | 177 // Custom toString template |
| 182 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 178 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
| 183 return functionTemplate; | 179 return functionTemplate; |
| 184 } | 180 } |
| 185 | 181 |
| 186 v8::Handle<v8::FunctionTemplate> V8TestOverloadedConstructors::GetTemplate(v8::I
solate* isolate, WrapperWorldType currentWorldType) | 182 v8::Handle<v8::FunctionTemplate> V8TestOverloadedConstructors::GetTemplate(v8::I
solate* isolate, WrapperWorldType currentWorldType) |
| 187 { | 183 { |
| 188 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 184 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 189 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 185 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 fromInternalPointer(object)->deref(); | 231 fromInternalPointer(object)->deref(); |
| 236 } | 232 } |
| 237 | 233 |
| 238 template<> | 234 template<> |
| 239 v8::Handle<v8::Value> toV8NoInline(TestOverloadedConstructors* impl, v8::Handle<
v8::Object> creationContext, v8::Isolate* isolate) | 235 v8::Handle<v8::Value> toV8NoInline(TestOverloadedConstructors* impl, v8::Handle<
v8::Object> creationContext, v8::Isolate* isolate) |
| 240 { | 236 { |
| 241 return toV8(impl, creationContext, isolate); | 237 return toV8(impl, creationContext, isolate); |
| 242 } | 238 } |
| 243 | 239 |
| 244 } // namespace WebCore | 240 } // namespace WebCore |
| OLD | NEW |