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