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 25 matching lines...) Expand all Loading... |
36 #include "RuntimeEnabledFeatures.h" | 36 #include "RuntimeEnabledFeatures.h" |
37 #include "V8Interface1.h" | 37 #include "V8Interface1.h" |
38 #include "V8Interface2.h" | 38 #include "V8Interface2.h" |
39 #include "bindings/v8/ExceptionMessages.h" | 39 #include "bindings/v8/ExceptionMessages.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 "core/dom/ContextFeatures.h" | 43 #include "core/dom/ContextFeatures.h" |
44 #include "core/dom/Document.h" | 44 #include "core/dom/Document.h" |
45 #include "platform/TraceEvent.h" | 45 #include "platform/TraceEvent.h" |
46 #include "wtf/UnusedParam.h" | |
47 | 46 |
48 namespace WebCore { | 47 namespace WebCore { |
49 | 48 |
50 static void initializeScriptWrappableForInterface(TestInterfacePython2* object) | 49 static void initializeScriptWrappableForInterface(TestInterfacePython2* object) |
51 { | 50 { |
52 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 51 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
53 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfacePython2::wr
apperTypeInfo); | 52 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfacePython2::wr
apperTypeInfo); |
54 else | 53 else |
55 ASSERT_NOT_REACHED(); | 54 ASSERT_NOT_REACHED(); |
56 } | 55 } |
(...skipping 21 matching lines...) Expand all Loading... |
78 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfacePython2Template(
v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, Wrapper
WorldType currentWorldType) | 77 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfacePython2Template(
v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, Wrapper
WorldType currentWorldType) |
79 { | 78 { |
80 functionTemplate->ReadOnlyPrototype(); | 79 functionTemplate->ReadOnlyPrototype(); |
81 | 80 |
82 v8::Local<v8::Signature> defaultSignature; | 81 v8::Local<v8::Signature> defaultSignature; |
83 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfacePython2", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceP
ython2::internalFieldCount, | 82 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfacePython2", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceP
ython2::internalFieldCount, |
84 0, 0, | 83 0, 0, |
85 0, 0, | 84 0, 0, |
86 0, 0, | 85 0, 0, |
87 isolate, currentWorldType); | 86 isolate, currentWorldType); |
88 UNUSED_PARAM(defaultSignature); | 87 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
89 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 88 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
90 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | |
91 UNUSED_PARAM(instanceTemplate); | |
92 UNUSED_PARAM(prototypeTemplate); | |
93 | 89 |
94 // Custom toString template | 90 // Custom toString template |
95 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 91 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
96 return functionTemplate; | 92 return functionTemplate; |
97 } | 93 } |
98 | 94 |
99 v8::Handle<v8::FunctionTemplate> V8TestInterfacePython2::GetTemplate(v8::Isolate
* isolate, WrapperWorldType currentWorldType) | 95 v8::Handle<v8::FunctionTemplate> V8TestInterfacePython2::GetTemplate(v8::Isolate
* isolate, WrapperWorldType currentWorldType) |
100 { | 96 { |
101 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 97 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
102 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 98 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 fromInternalPointer(object)->deref(); | 155 fromInternalPointer(object)->deref(); |
160 } | 156 } |
161 | 157 |
162 template<> | 158 template<> |
163 v8::Handle<v8::Value> toV8NoInline(TestInterfacePython2* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) | 159 v8::Handle<v8::Value> toV8NoInline(TestInterfacePython2* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) |
164 { | 160 { |
165 return toV8(impl, creationContext, isolate); | 161 return toV8(impl, creationContext, isolate); |
166 } | 162 } |
167 | 163 |
168 } // namespace WebCore | 164 } // namespace WebCore |
OLD | NEW |