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 "core/dom/ContextFeatures.h" | 40 #include "core/dom/ContextFeatures.h" |
41 #include "core/dom/Document.h" | 41 #include "core/dom/Document.h" |
42 #include "platform/TraceEvent.h" | 42 #include "platform/TraceEvent.h" |
43 #include "wtf/GetPtr.h" | 43 #include "wtf/GetPtr.h" |
44 #include "wtf/RefPtr.h" | 44 #include "wtf/RefPtr.h" |
45 #include "wtf/UnusedParam.h" | |
46 | 45 |
47 namespace WebCore { | 46 namespace WebCore { |
48 | 47 |
49 static void initializeScriptWrappableForInterface(RealClass* object) | 48 static void initializeScriptWrappableForInterface(RealClass* object) |
50 { | 49 { |
51 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 50 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
52 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceImplemented
As::wrapperTypeInfo); | 51 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceImplemented
As::wrapperTypeInfo); |
53 else | 52 else |
54 ASSERT_NOT_REACHED(); | 53 ASSERT_NOT_REACHED(); |
55 } | 54 } |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceImplementedAsTem
plate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, W
rapperWorldType currentWorldType) | 175 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceImplementedAsTem
plate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, W
rapperWorldType currentWorldType) |
177 { | 176 { |
178 functionTemplate->ReadOnlyPrototype(); | 177 functionTemplate->ReadOnlyPrototype(); |
179 | 178 |
180 v8::Local<v8::Signature> defaultSignature; | 179 v8::Local<v8::Signature> defaultSignature; |
181 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceImplementedAs", v8::Local<v8::FunctionTemplate>(), V8TestInte
rfaceImplementedAs::internalFieldCount, | 180 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceImplementedAs", v8::Local<v8::FunctionTemplate>(), V8TestInte
rfaceImplementedAs::internalFieldCount, |
182 V8TestInterfaceImplementedAsAttributes, WTF_ARRAY_LENGTH(V8TestInterface
ImplementedAsAttributes), | 181 V8TestInterfaceImplementedAsAttributes, WTF_ARRAY_LENGTH(V8TestInterface
ImplementedAsAttributes), |
183 0, 0, | 182 0, 0, |
184 V8TestInterfaceImplementedAsMethods, WTF_ARRAY_LENGTH(V8TestInterfaceImp
lementedAsMethods), | 183 V8TestInterfaceImplementedAsMethods, WTF_ARRAY_LENGTH(V8TestInterfaceImp
lementedAsMethods), |
185 isolate, currentWorldType); | 184 isolate, currentWorldType); |
186 UNUSED_PARAM(defaultSignature); | 185 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
187 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 186 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
188 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | |
189 UNUSED_PARAM(instanceTemplate); | |
190 UNUSED_PARAM(prototypeTemplate); | |
191 | 187 |
192 // Custom Signature 'funcTestInterfaceImplementedAsParam' | 188 // Custom Signature 'funcTestInterfaceImplementedAsParam' |
193 const int funcTestInterfaceImplementedAsParamArgc = 1; | 189 const int funcTestInterfaceImplementedAsParamArgc = 1; |
194 v8::Handle<v8::FunctionTemplate> funcTestInterfaceImplementedAsParamArgv[fun
cTestInterfaceImplementedAsParamArgc] = { V8PerIsolateData::from(isolate)->rawDO
MTemplate(&V8TestInterfaceImplementedAs::wrapperTypeInfo, currentWorldType) }; | 190 v8::Handle<v8::FunctionTemplate> funcTestInterfaceImplementedAsParamArgv[fun
cTestInterfaceImplementedAsParamArgc] = { V8PerIsolateData::from(isolate)->rawDO
MTemplate(&V8TestInterfaceImplementedAs::wrapperTypeInfo, currentWorldType) }; |
195 v8::Handle<v8::Signature> funcTestInterfaceImplementedAsParamSignature = v8:
:Signature::New(isolate, functionTemplate, funcTestInterfaceImplementedAsParamAr
gc, funcTestInterfaceImplementedAsParamArgv); | 191 v8::Handle<v8::Signature> funcTestInterfaceImplementedAsParamSignature = v8:
:Signature::New(isolate, functionTemplate, funcTestInterfaceImplementedAsParamAr
gc, funcTestInterfaceImplementedAsParamArgv); |
196 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "funcTestInterfaceIm
plementedAsParam", v8::String::kInternalizedString), v8::FunctionTemplate::New(i
solate, RealClassV8Internal::funcTestInterfaceImplementedAsParamMethodCallback,
v8Undefined(), funcTestInterfaceImplementedAsParamSignature, 1)); | 192 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "funcTestInterfaceIm
plementedAsParam", v8::String::kInternalizedString), v8::FunctionTemplate::New(i
solate, RealClassV8Internal::funcTestInterfaceImplementedAsParamMethodCallback,
v8Undefined(), funcTestInterfaceImplementedAsParamSignature, 1)); |
197 | 193 |
198 // Custom toString template | 194 // Custom toString template |
199 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 195 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
200 return functionTemplate; | 196 return functionTemplate; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 fromInternalPointer(object)->deref(); | 248 fromInternalPointer(object)->deref(); |
253 } | 249 } |
254 | 250 |
255 template<> | 251 template<> |
256 v8::Handle<v8::Value> toV8NoInline(RealClass* impl, v8::Handle<v8::Object> creat
ionContext, v8::Isolate* isolate) | 252 v8::Handle<v8::Value> toV8NoInline(RealClass* impl, v8::Handle<v8::Object> creat
ionContext, v8::Isolate* isolate) |
257 { | 253 { |
258 return toV8(impl, creationContext, isolate); | 254 return toV8(impl, creationContext, isolate); |
259 } | 255 } |
260 | 256 |
261 } // namespace WebCore | 257 } // namespace WebCore |
OLD | NEW |