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 #include "V8TestInterfacePython.h" | 35 #include "V8TestInterfacePython.h" |
36 | 36 |
37 #include "RuntimeEnabledFeatures.h" | 37 #include "RuntimeEnabledFeatures.h" |
38 #include "bindings/v8/ExceptionMessages.h" | 38 #include "bindings/v8/ExceptionMessages.h" |
39 #include "bindings/v8/V8DOMConfiguration.h" | 39 #include "bindings/v8/V8DOMConfiguration.h" |
40 #include "bindings/v8/V8GCController.h" | 40 #include "bindings/v8/V8GCController.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/dom/Element.h" | 43 #include "core/dom/Element.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(TestInterfacePythonImplementat
ion* object) | 48 static void initializeScriptWrappableForInterface(TestInterfacePythonImplementat
ion* object) |
50 { | 49 { |
51 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 50 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
52 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfacePython::wra
pperTypeInfo); | 51 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfacePython::wra
pperTypeInfo); |
53 else | 52 else |
54 ASSERT_NOT_REACHED(); | 53 ASSERT_NOT_REACHED(); |
55 } | 54 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 89 |
91 v8::Local<v8::Signature> defaultSignature; | 90 v8::Local<v8::Signature> defaultSignature; |
92 if (!RuntimeEnabledFeatures::featureNameEnabled()) | 91 if (!RuntimeEnabledFeatures::featureNameEnabled()) |
93 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionT
emplate, "", V8TestInterfaceEmpty::domTemplate(isolate, currentWorldType), V8Tes
tInterfacePython::internalFieldCount, 0, 0, 0, 0, 0, 0, isolate, currentWorldTyp
e); | 92 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionT
emplate, "", V8TestInterfaceEmpty::domTemplate(isolate, currentWorldType), V8Tes
tInterfacePython::internalFieldCount, 0, 0, 0, 0, 0, 0, isolate, currentWorldTyp
e); |
94 else | 93 else |
95 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionT
emplate, "TestInterfacePython", V8TestInterfaceEmpty::domTemplate(isolate, curre
ntWorldType), V8TestInterfacePython::internalFieldCount, | 94 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionT
emplate, "TestInterfacePython", V8TestInterfaceEmpty::domTemplate(isolate, curre
ntWorldType), V8TestInterfacePython::internalFieldCount, |
96 0, 0, | 95 0, 0, |
97 0, 0, | 96 0, 0, |
98 0, 0, | 97 0, 0, |
99 isolate, currentWorldType); | 98 isolate, currentWorldType); |
100 UNUSED_PARAM(defaultSignature); | 99 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
101 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 100 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
102 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | |
103 UNUSED_PARAM(instanceTemplate); | |
104 UNUSED_PARAM(prototypeTemplate); | |
105 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa
cePython::legacyCallCustom); | 101 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa
cePython::legacyCallCustom); |
106 | 102 |
107 // Custom toString template | 103 // Custom toString template |
108 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 104 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
109 return functionTemplate; | 105 return functionTemplate; |
110 } | 106 } |
111 | 107 |
112 v8::Handle<v8::FunctionTemplate> V8TestInterfacePython::domTemplate(v8::Isolate*
isolate, WrapperWorldType currentWorldType) | 108 v8::Handle<v8::FunctionTemplate> V8TestInterfacePython::domTemplate(v8::Isolate*
isolate, WrapperWorldType currentWorldType) |
113 { | 109 { |
114 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 110 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 143 } |
148 | 144 |
149 template<> | 145 template<> |
150 v8::Handle<v8::Value> toV8NoInline(TestInterfacePythonImplementation* impl, v8::
Handle<v8::Object> creationContext, v8::Isolate* isolate) | 146 v8::Handle<v8::Value> toV8NoInline(TestInterfacePythonImplementation* impl, v8::
Handle<v8::Object> creationContext, v8::Isolate* isolate) |
151 { | 147 { |
152 return toV8(impl, creationContext, isolate); | 148 return toV8(impl, creationContext, isolate); |
153 } | 149 } |
154 | 150 |
155 } // namespace WebCore | 151 } // namespace WebCore |
156 #endif // ENABLE(CONDITION) | 152 #endif // ENABLE(CONDITION) |
OLD | NEW |