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 "bindings/v8/ExceptionMessages.h" | 37 #include "bindings/v8/ExceptionMessages.h" |
38 #include "bindings/v8/ExceptionState.h" | 38 #include "bindings/v8/ExceptionState.h" |
39 #include "bindings/v8/V8DOMConfiguration.h" | 39 #include "bindings/v8/V8DOMConfiguration.h" |
40 #include "bindings/v8/V8ObjectConstructor.h" | 40 #include "bindings/v8/V8ObjectConstructor.h" |
41 #include "core/dom/ContextFeatures.h" | 41 #include "core/dom/ContextFeatures.h" |
42 #include "core/dom/Document.h" | 42 #include "core/dom/Document.h" |
43 #include "core/frame/UseCounter.h" | 43 #include "core/frame/UseCounter.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(TestInterfaceConstructor* obje
ct) | 48 static void initializeScriptWrappableForInterface(TestInterfaceConstructor* obje
ct) |
50 { | 49 { |
51 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 50 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
52 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceConstructor
::wrapperTypeInfo); | 51 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceConstructor
::wrapperTypeInfo); |
53 else | 52 else |
54 ASSERT_NOT_REACHED(); | 53 ASSERT_NOT_REACHED(); |
55 } | 54 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceConstructorTempl
ate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, Wra
pperWorldType currentWorldType) | 107 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceConstructorTempl
ate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, Wra
pperWorldType currentWorldType) |
109 { | 108 { |
110 functionTemplate->ReadOnlyPrototype(); | 109 functionTemplate->ReadOnlyPrototype(); |
111 | 110 |
112 v8::Local<v8::Signature> defaultSignature; | 111 v8::Local<v8::Signature> defaultSignature; |
113 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceConstructor", v8::Local<v8::FunctionTemplate>(), V8TestInterf
aceConstructor::internalFieldCount, | 112 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceConstructor", v8::Local<v8::FunctionTemplate>(), V8TestInterf
aceConstructor::internalFieldCount, |
114 0, 0, | 113 0, 0, |
115 0, 0, | 114 0, 0, |
116 0, 0, | 115 0, 0, |
117 isolate, currentWorldType); | 116 isolate, currentWorldType); |
118 UNUSED_PARAM(defaultSignature); | |
119 functionTemplate->SetCallHandler(V8TestInterfaceConstructor::constructorCall
back); | 117 functionTemplate->SetCallHandler(V8TestInterfaceConstructor::constructorCall
back); |
120 functionTemplate->SetLength(0); | 118 functionTemplate->SetLength(0); |
121 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 119 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
122 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | 120 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
123 UNUSED_PARAM(instanceTemplate); | |
124 UNUSED_PARAM(prototypeTemplate); | |
125 | 121 |
126 // Custom toString template | 122 // Custom toString template |
127 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 123 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
128 return functionTemplate; | 124 return functionTemplate; |
129 } | 125 } |
130 | 126 |
131 v8::Handle<v8::FunctionTemplate> V8TestInterfaceConstructor::domTemplate(v8::Iso
late* isolate, WrapperWorldType currentWorldType) | 127 v8::Handle<v8::FunctionTemplate> V8TestInterfaceConstructor::domTemplate(v8::Iso
late* isolate, WrapperWorldType currentWorldType) |
132 { | 128 { |
133 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 129 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
134 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 130 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 fromInternalPointer(object)->deref(); | 176 fromInternalPointer(object)->deref(); |
181 } | 177 } |
182 | 178 |
183 template<> | 179 template<> |
184 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) | 180 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) |
185 { | 181 { |
186 return toV8(impl, creationContext, isolate); | 182 return toV8(impl, creationContext, isolate); |
187 } | 183 } |
188 | 184 |
189 } // namespace WebCore | 185 } // namespace WebCore |
OLD | NEW |