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