| 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 "V8Document.h" | 37 #include "V8Document.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/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 "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(TestNamedConstructor* object) | 50 static void initializeScriptWrappableForInterface(TestNamedConstructor* object) |
| 52 { | 51 { |
| 53 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 52 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
| 54 ScriptWrappable::setTypeInfoInObject(object, &V8TestNamedConstructor::wr
apperTypeInfo); | 53 ScriptWrappable::setTypeInfoInObject(object, &V8TestNamedConstructor::wr
apperTypeInfo); |
| 55 else | 54 else |
| 56 ASSERT_NOT_REACHED(); | 55 ASSERT_NOT_REACHED(); |
| 57 } | 56 } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 result->Inherit(V8TestNamedConstructor::GetTemplate(isolate, currentWorldTyp
e)); | 133 result->Inherit(V8TestNamedConstructor::GetTemplate(isolate, currentWorldTyp
e)); |
| 135 data->setPrivateTemplate(currentWorldType, &privateTemplateUniqueKey, result
); | 134 data->setPrivateTemplate(currentWorldType, &privateTemplateUniqueKey, result
); |
| 136 | 135 |
| 137 return scope.Escape(result); | 136 return scope.Escape(result); |
| 138 } | 137 } |
| 139 | 138 |
| 140 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestNamedConstructorTemplate(
v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, Wrapper
WorldType currentWorldType) | 139 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestNamedConstructorTemplate(
v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, Wrapper
WorldType currentWorldType) |
| 141 { | 140 { |
| 142 functionTemplate->ReadOnlyPrototype(); | 141 functionTemplate->ReadOnlyPrototype(); |
| 143 | 142 |
| 144 v8::Local<v8::Signature> defaultSignature; | 143 v8::Local<v8::Signature> ALLOW_UNUSED defaultSignature; |
| 145 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestNamedConstructor", v8::Local<v8::FunctionTemplate>(), V8TestNamedConst
ructor::internalFieldCount, | 144 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestNamedConstructor", v8::Local<v8::FunctionTemplate>(), V8TestNamedConst
ructor::internalFieldCount, |
| 146 0, 0, | 145 0, 0, |
| 147 0, 0, | 146 0, 0, |
| 148 0, 0, | 147 0, 0, |
| 149 isolate, currentWorldType); | 148 isolate, currentWorldType); |
| 150 UNUSED_PARAM(defaultSignature); | 149 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 151 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 150 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 152 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | |
| 153 UNUSED_PARAM(instanceTemplate); | |
| 154 UNUSED_PARAM(prototypeTemplate); | |
| 155 | 151 |
| 156 // Custom toString template | 152 // Custom toString template |
| 157 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 153 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
| 158 return functionTemplate; | 154 return functionTemplate; |
| 159 } | 155 } |
| 160 | 156 |
| 161 v8::Handle<v8::FunctionTemplate> V8TestNamedConstructor::GetTemplate(v8::Isolate
* isolate, WrapperWorldType currentWorldType) | 157 v8::Handle<v8::FunctionTemplate> V8TestNamedConstructor::GetTemplate(v8::Isolate
* isolate, WrapperWorldType currentWorldType) |
| 162 { | 158 { |
| 163 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 159 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 164 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 160 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 fromInternalPointer(object)->deref(); | 211 fromInternalPointer(object)->deref(); |
| 216 } | 212 } |
| 217 | 213 |
| 218 template<> | 214 template<> |
| 219 v8::Handle<v8::Value> toV8NoInline(TestNamedConstructor* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) | 215 v8::Handle<v8::Value> toV8NoInline(TestNamedConstructor* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) |
| 220 { | 216 { |
| 221 return toV8(impl, creationContext, isolate); | 217 return toV8(impl, creationContext, isolate); |
| 222 } | 218 } |
| 223 | 219 |
| 224 } // namespace WebCore | 220 } // namespace WebCore |
| OLD | NEW |