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