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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 #include "config.h" | 33 #include "config.h" |
34 #include "V8TestInterfaceEmpty.h" | 34 #include "V8TestInterfaceEmpty.h" |
35 | 35 |
36 #include "RuntimeEnabledFeatures.h" | 36 #include "RuntimeEnabledFeatures.h" |
37 #include "bindings/v8/ExceptionMessages.h" | 37 #include "bindings/v8/ExceptionMessages.h" |
38 #include "bindings/v8/V8DOMConfiguration.h" | 38 #include "bindings/v8/V8DOMConfiguration.h" |
39 #include "core/dom/ContextFeatures.h" | 39 #include "core/dom/ContextFeatures.h" |
40 #include "core/dom/Document.h" | 40 #include "core/dom/Document.h" |
41 #include "platform/TraceEvent.h" | 41 #include "platform/TraceEvent.h" |
42 #include "wtf/UnusedParam.h" | |
43 | 42 |
44 namespace WebCore { | 43 namespace WebCore { |
45 | 44 |
46 static void initializeScriptWrappableForInterface(TestInterfaceEmpty* object) | 45 static void initializeScriptWrappableForInterface(TestInterfaceEmpty* object) |
47 { | 46 { |
48 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 47 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
49 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceEmpty::wrap
perTypeInfo); | 48 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceEmpty::wrap
perTypeInfo); |
50 else | 49 else |
51 ASSERT_NOT_REACHED(); | 50 ASSERT_NOT_REACHED(); |
52 } | 51 } |
(...skipping 21 matching lines...) Expand all Loading... |
74 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceEmptyTemplate(v8
::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWo
rldType currentWorldType) | 73 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceEmptyTemplate(v8
::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWo
rldType currentWorldType) |
75 { | 74 { |
76 functionTemplate->ReadOnlyPrototype(); | 75 functionTemplate->ReadOnlyPrototype(); |
77 | 76 |
78 v8::Local<v8::Signature> defaultSignature; | 77 v8::Local<v8::Signature> defaultSignature; |
79 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceEmpty", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceEmp
ty::internalFieldCount, | 78 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceEmpty", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceEmp
ty::internalFieldCount, |
80 0, 0, | 79 0, 0, |
81 0, 0, | 80 0, 0, |
82 0, 0, | 81 0, 0, |
83 isolate, currentWorldType); | 82 isolate, currentWorldType); |
84 UNUSED_PARAM(defaultSignature); | 83 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
85 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 84 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
86 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | |
87 UNUSED_PARAM(instanceTemplate); | |
88 UNUSED_PARAM(prototypeTemplate); | |
89 | 85 |
90 // Custom toString template | 86 // Custom toString template |
91 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 87 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
92 return functionTemplate; | 88 return functionTemplate; |
93 } | 89 } |
94 | 90 |
95 v8::Handle<v8::FunctionTemplate> V8TestInterfaceEmpty::domTemplate(v8::Isolate*
isolate, WrapperWorldType currentWorldType) | 91 v8::Handle<v8::FunctionTemplate> V8TestInterfaceEmpty::domTemplate(v8::Isolate*
isolate, WrapperWorldType currentWorldType) |
96 { | 92 { |
97 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 93 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
98 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 94 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 fromInternalPointer(object)->deref(); | 140 fromInternalPointer(object)->deref(); |
145 } | 141 } |
146 | 142 |
147 template<> | 143 template<> |
148 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEmpty* impl, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate* isolate) | 144 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEmpty* impl, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate* isolate) |
149 { | 145 { |
150 return toV8(impl, creationContext, isolate); | 146 return toV8(impl, creationContext, isolate); |
151 } | 147 } |
152 | 148 |
153 } // namespace WebCore | 149 } // namespace WebCore |
OLD | NEW |