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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 #include "core/css/MediaQueryListListener.h" | 74 #include "core/css/MediaQueryListListener.h" |
75 #include "core/dom/ContextFeatures.h" | 75 #include "core/dom/ContextFeatures.h" |
76 #include "core/dom/Document.h" | 76 #include "core/dom/Document.h" |
77 #include "core/dom/custom/CustomElementCallbackDispatcher.h" | 77 #include "core/dom/custom/CustomElementCallbackDispatcher.h" |
78 #include "core/frame/DOMWindow.h" | 78 #include "core/frame/DOMWindow.h" |
79 #include "core/frame/UseCounter.h" | 79 #include "core/frame/UseCounter.h" |
80 #include "core/inspector/ScriptArguments.h" | 80 #include "core/inspector/ScriptArguments.h" |
81 #include "platform/TraceEvent.h" | 81 #include "platform/TraceEvent.h" |
82 #include "wtf/GetPtr.h" | 82 #include "wtf/GetPtr.h" |
83 #include "wtf/RefPtr.h" | 83 #include "wtf/RefPtr.h" |
84 #include "wtf/UnusedParam.h" | |
85 | 84 |
86 namespace WebCore { | 85 namespace WebCore { |
87 | 86 |
88 static void initializeScriptWrappableForInterface(TestObjectPython* object) | 87 static void initializeScriptWrappableForInterface(TestObjectPython* object) |
89 { | 88 { |
90 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 89 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
91 ScriptWrappable::setTypeInfoInObject(object, &V8TestObjectPython::wrappe
rTypeInfo); | 90 ScriptWrappable::setTypeInfoInObject(object, &V8TestObjectPython::wrappe
rTypeInfo); |
92 else | 91 else |
93 ASSERT_NOT_REACHED(); | 92 ASSERT_NOT_REACHED(); |
94 } | 93 } |
(...skipping 6165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6260 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestObjectPythonTemplate(v8::
Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorl
dType currentWorldType) | 6259 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestObjectPythonTemplate(v8::
Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorl
dType currentWorldType) |
6261 { | 6260 { |
6262 functionTemplate->ReadOnlyPrototype(); | 6261 functionTemplate->ReadOnlyPrototype(); |
6263 | 6262 |
6264 v8::Local<v8::Signature> defaultSignature; | 6263 v8::Local<v8::Signature> defaultSignature; |
6265 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestObjectPython", v8::Local<v8::FunctionTemplate>(), V8TestObjectPython::
internalFieldCount, | 6264 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestObjectPython", v8::Local<v8::FunctionTemplate>(), V8TestObjectPython::
internalFieldCount, |
6266 V8TestObjectPythonAttributes, WTF_ARRAY_LENGTH(V8TestObjectPythonAttribu
tes), | 6265 V8TestObjectPythonAttributes, WTF_ARRAY_LENGTH(V8TestObjectPythonAttribu
tes), |
6267 V8TestObjectPythonAccessors, WTF_ARRAY_LENGTH(V8TestObjectPythonAccessor
s), | 6266 V8TestObjectPythonAccessors, WTF_ARRAY_LENGTH(V8TestObjectPythonAccessor
s), |
6268 V8TestObjectPythonMethods, WTF_ARRAY_LENGTH(V8TestObjectPythonMethods), | 6267 V8TestObjectPythonMethods, WTF_ARRAY_LENGTH(V8TestObjectPythonMethods), |
6269 isolate, currentWorldType); | 6268 isolate, currentWorldType); |
6270 UNUSED_PARAM(defaultSignature); | 6269 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
6271 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 6270 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
6272 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | |
6273 UNUSED_PARAM(instanceTemplate); | |
6274 UNUSED_PARAM(prototypeTemplate); | |
6275 if (RuntimeEnabledFeatures::featureNameEnabled()) { | 6271 if (RuntimeEnabledFeatures::featureNameEnabled()) { |
6276 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 6272 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
6277 {"runtimeEnabledLongAttribute", TestObjectPythonV8Internal::runtimeEnabl
edLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::runtimeEnabl
edLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(
v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}
; | 6273 {"runtimeEnabledLongAttribute", TestObjectPythonV8Internal::runtimeEnabl
edLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::runtimeEnabl
edLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(
v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}
; |
6278 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate, currentWorldType); | 6274 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate, currentWorldType); |
6279 } | 6275 } |
6280 #if ENABLE(CONDITION) | 6276 #if ENABLE(CONDITION) |
6281 if (RuntimeEnabledFeatures::featureNameEnabled()) { | 6277 if (RuntimeEnabledFeatures::featureNameEnabled()) { |
6282 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 6278 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
6283 {"conditionalRuntimeEnabledLongAttribute", TestObjectPythonV8Internal::c
onditionalRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectPythonV8
Internal::conditionalRuntimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0
, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute
>(v8::None), 0 /* on instance */}; | 6279 {"conditionalRuntimeEnabledLongAttribute", TestObjectPythonV8Internal::c
onditionalRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectPythonV8
Internal::conditionalRuntimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0
, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute
>(v8::None), 0 /* on instance */}; |
6284 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate, currentWorldType); | 6280 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate, currentWorldType); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6497 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instan
ceTemplate->GetPrototype()); | 6493 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instan
ceTemplate->GetPrototype()); |
6498 if (ContextFeatures::featureNameEnabled(impl->document())) { | 6494 if (ContextFeatures::featureNameEnabled(impl->document())) { |
6499 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 6495 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
6500 {"perContextEnabledLongAttribute", TestObjectPythonV8Internal::perContex
tEnabledLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::perCon
textEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::Access
Control>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on ins
tance */}; | 6496 {"perContextEnabledLongAttribute", TestObjectPythonV8Internal::perContex
tEnabledLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::perCon
textEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::Access
Control>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on ins
tance */}; |
6501 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | 6497 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); |
6502 } | 6498 } |
6503 } | 6499 } |
6504 | 6500 |
6505 void V8TestObjectPython::installPerContextEnabledMethods(v8::Handle<v8::Object>
prototypeTemplate, v8::Isolate* isolate) | 6501 void V8TestObjectPython::installPerContextEnabledMethods(v8::Handle<v8::Object>
prototypeTemplate, v8::Isolate* isolate) |
6506 { | 6502 { |
6507 UNUSED_PARAM(prototypeTemplate); | |
6508 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT
emplate(isolate, worldType(isolate))); | 6503 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT
emplate(isolate, worldType(isolate))); |
6509 UNUSED_PARAM(defaultSignature); | |
6510 | 6504 |
6511 ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationCo
ntext()); | 6505 ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationCo
ntext()); |
6512 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(
toDocument(context))) | 6506 if (context && context->isDocument() && ContextFeatures::featureNameEnabled(
toDocument(context))) |
6513 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "perContextEnabl
edVoidMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isola
te, TestObjectPythonV8Internal::perContextEnabledVoidMethodMethodCallback, v8Und
efined(), defaultSignature, 0)->GetFunction()); | 6507 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "perContextEnabl
edVoidMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isola
te, TestObjectPythonV8Internal::perContextEnabledVoidMethodMethodCallback, v8Und
efined(), defaultSignature, 0)->GetFunction()); |
6514 } | 6508 } |
6515 | 6509 |
6516 v8::Handle<v8::Object> V8TestObjectPython::createWrapper(PassRefPtr<TestObjectPy
thon> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 6510 v8::Handle<v8::Object> V8TestObjectPython::createWrapper(PassRefPtr<TestObjectPy
thon> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
6517 { | 6511 { |
6518 ASSERT(impl); | 6512 ASSERT(impl); |
6519 ASSERT(!DOMDataStore::containsWrapper<V8TestObjectPython>(impl.get(), isolat
e)); | 6513 ASSERT(!DOMDataStore::containsWrapper<V8TestObjectPython>(impl.get(), isolat
e)); |
(...skipping 18 matching lines...) Expand all Loading... |
6538 fromInternalPointer(object)->deref(); | 6532 fromInternalPointer(object)->deref(); |
6539 } | 6533 } |
6540 | 6534 |
6541 template<> | 6535 template<> |
6542 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object
> creationContext, v8::Isolate* isolate) | 6536 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object
> creationContext, v8::Isolate* isolate) |
6543 { | 6537 { |
6544 return toV8(impl, creationContext, isolate); | 6538 return toV8(impl, creationContext, isolate); |
6545 } | 6539 } |
6546 | 6540 |
6547 } // namespace WebCore | 6541 } // namespace WebCore |
OLD | NEW |