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 24 matching lines...) Expand all Loading... |
35 | 35 |
36 #include "RuntimeEnabledFeatures.h" | 36 #include "RuntimeEnabledFeatures.h" |
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/V8DOMConfiguration.h" | 40 #include "bindings/v8/V8DOMConfiguration.h" |
41 #include "bindings/v8/V8ObjectConstructor.h" | 41 #include "bindings/v8/V8ObjectConstructor.h" |
42 #include "core/dom/ContextFeatures.h" | 42 #include "core/dom/ContextFeatures.h" |
43 #include "core/dom/Document.h" | 43 #include "core/dom/Document.h" |
44 #include "platform/TraceEvent.h" | 44 #include "platform/TraceEvent.h" |
45 #include "wtf/UnusedParam.h" | |
46 | 45 |
47 namespace WebCore { | 46 namespace WebCore { |
48 | 47 |
49 static void initializeScriptWrappableForInterface(TestNamedConstructor* object) | 48 static void initializeScriptWrappableForInterface(TestNamedConstructor* object) |
50 { | 49 { |
51 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 50 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
52 ScriptWrappable::setTypeInfoInObject(object, &V8TestNamedConstructor::wr
apperTypeInfo); | 51 ScriptWrappable::setTypeInfoInObject(object, &V8TestNamedConstructor::wr
apperTypeInfo); |
53 else | 52 else |
54 ASSERT_NOT_REACHED(); | 53 ASSERT_NOT_REACHED(); |
55 } | 54 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestNamedConstructorTemplate(
v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, Wrapper
WorldType currentWorldType) | 137 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestNamedConstructorTemplate(
v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, Wrapper
WorldType currentWorldType) |
139 { | 138 { |
140 functionTemplate->ReadOnlyPrototype(); | 139 functionTemplate->ReadOnlyPrototype(); |
141 | 140 |
142 v8::Local<v8::Signature> defaultSignature; | 141 v8::Local<v8::Signature> defaultSignature; |
143 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestNamedConstructor", v8::Local<v8::FunctionTemplate>(), V8TestNamedConst
ructor::internalFieldCount, | 142 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestNamedConstructor", v8::Local<v8::FunctionTemplate>(), V8TestNamedConst
ructor::internalFieldCount, |
144 0, 0, | 143 0, 0, |
145 0, 0, | 144 0, 0, |
146 0, 0, | 145 0, 0, |
147 isolate, currentWorldType); | 146 isolate, currentWorldType); |
148 UNUSED_PARAM(defaultSignature); | 147 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
149 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 148 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
150 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | |
151 UNUSED_PARAM(instanceTemplate); | |
152 UNUSED_PARAM(prototypeTemplate); | |
153 | 149 |
154 // Custom toString template | 150 // Custom toString template |
155 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 151 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
156 return functionTemplate; | 152 return functionTemplate; |
157 } | 153 } |
158 | 154 |
159 v8::Handle<v8::FunctionTemplate> V8TestNamedConstructor::domTemplate(v8::Isolate
* isolate, WrapperWorldType currentWorldType) | 155 v8::Handle<v8::FunctionTemplate> V8TestNamedConstructor::domTemplate(v8::Isolate
* isolate, WrapperWorldType currentWorldType) |
160 { | 156 { |
161 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 157 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
162 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 158 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 fromInternalPointer(object)->deref(); | 209 fromInternalPointer(object)->deref(); |
214 } | 210 } |
215 | 211 |
216 template<> | 212 template<> |
217 v8::Handle<v8::Value> toV8NoInline(TestNamedConstructor* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) | 213 v8::Handle<v8::Value> toV8NoInline(TestNamedConstructor* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) |
218 { | 214 { |
219 return toV8(impl, creationContext, isolate); | 215 return toV8(impl, creationContext, isolate); |
220 } | 216 } |
221 | 217 |
222 } // namespace WebCore | 218 } // namespace WebCore |
OLD | NEW |