Diff
Modified: trunk/Source/WebCore/ChangeLog (125481 => 125482)
--- trunk/Source/WebCore/ChangeLog 2012-08-14 00:49:48 UTC (rev 125481)
+++ trunk/Source/WebCore/ChangeLog 2012-08-14 00:51:31 UTC (rev 125482)
@@ -1,5 +1,50 @@
2012-08-13 Kentaro Hara <[email protected]>
+ [V8] Rename v8ValueToAtomicWebCoreString() to toWebCoreAtomicString()
+ https://bugs.webkit.org/show_bug.cgi?id=93824
+
+ Reviewed by Adam Barth.
+
+ For naming consistency with toWebCoreString(), we can rename
+ v8ValueToAtomicWebCoreString() to toWebCoreAtomicString().
+ Also we can rename v8ValueToAtomicWebCoreStringWithNullCheck()
+ to toWebCoreAtomicStringWithNullCheck().
+
+ No tests. No change in behavior.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateNormalAttrSetter):
+ (GenerateEventListenerCallback):
+ * bindings/scripts/test/V8/V8TestEventTarget.cpp:
+ (WebCore::TestEventTargetV8Internal::addEventListenerCallback):
+ (WebCore::TestEventTargetV8Internal::removeEventListenerCallback):
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::TestObjV8Internal::addEventListenerCallback):
+ (WebCore::TestObjV8Internal::removeEventListenerCallback):
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::toWebCoreAtomicString):
+ * bindings/v8/V8Binding.h:
+ (WebCore::toWebCoreStringWithNullOrUndefinedCheck):
+ (WebCore::toWebCoreAtomicStringWithNullCheck):
+ * bindings/v8/V8Collection.h:
+ (WebCore::getNamedPropertyOfCollection):
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::getter):
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::V8DOMWindow::namedPropertyGetter):
+ * bindings/v8/custom/V8HTMLAllCollectionCustom.cpp:
+ (WebCore::V8HTMLAllCollection::namedPropertyGetter):
+ * bindings/v8/custom/V8HTMLCollectionCustom.cpp:
+ (WebCore::V8HTMLCollection::namedPropertyGetter):
+ * bindings/v8/custom/V8HTMLFormElementCustom.cpp:
+ (WebCore::V8HTMLFormElement::namedPropertyGetter):
+ * bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp:
+ (WebCore::V8HTMLFrameSetElement::namedPropertyGetter):
+ * bindings/v8/custom/V8NodeListCustom.cpp:
+ (WebCore::V8NodeList::namedPropertyGetter):
+
+2012-08-13 Kentaro Hara <[email protected]>
+
[V8] Remove v8ValueToWebCoreString()
https://bugs.webkit.org/show_bug.cgi?id=93822
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (125481 => 125482)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-08-14 00:49:48 UTC (rev 125481)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-08-14 00:51:31 UTC (rev 125482)
@@ -1183,7 +1183,7 @@
my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
AddToImplIncludes("${namespace}.h");
push(@implContentDecls, " Element* imp = V8Element::toNative(info.Holder());\n");
- push(@implContentDecls, " AtomicString v = toAtomicWebCoreStringWithNullCheck(value);\n");
+ push(@implContentDecls, " AtomicString v = toWebCoreAtomicStringWithNullCheck(value);\n");
push(@implContentDecls, " imp->setAttribute(${namespace}::${contentAttributeName}Attr, v);\n");
push(@implContentDecls, "}\n\n");
push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditionalString;
@@ -1345,7 +1345,7 @@
INC_STATS("DOM.${implClassName}.${functionName}EventListener()");
RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFind${lookupType});
if (listener) {
- V8${implClassName}::toNative(args.Holder())->${functionName}EventListener(v8ValueToAtomicWebCoreString(args[0]), listener${passRefPtrHandling}, args[2]->BooleanValue());
+ V8${implClassName}::toNative(args.Holder())->${functionName}EventListener(toWebCoreAtomicString(args[0]), listener${passRefPtrHandling}, args[2]->BooleanValue());
END
if ($requiresHiddenDependency) {
push(@implContentDecls, <<END);
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp (125481 => 125482)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp 2012-08-14 00:49:48 UTC (rev 125481)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp 2012-08-14 00:51:31 UTC (rev 125482)
@@ -66,7 +66,7 @@
INC_STATS("DOM.TestEventTarget.addEventListener()");
RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOrCreate);
if (listener) {
- V8TestEventTarget::toNative(args.Holder())->addEventListener(v8ValueToAtomicWebCoreString(args[0]), listener, args[2]->BooleanValue());
+ V8TestEventTarget::toNative(args.Holder())->addEventListener(toWebCoreAtomicString(args[0]), listener, args[2]->BooleanValue());
createHiddenDependency(args.Holder(), args[1], V8TestEventTarget::eventListenerCacheIndex);
}
return v8Undefined();
@@ -77,7 +77,7 @@
INC_STATS("DOM.TestEventTarget.removeEventListener()");
RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOnly);
if (listener) {
- V8TestEventTarget::toNative(args.Holder())->removeEventListener(v8ValueToAtomicWebCoreString(args[0]), listener.get(), args[2]->BooleanValue());
+ V8TestEventTarget::toNative(args.Holder())->removeEventListener(toWebCoreAtomicString(args[0]), listener.get(), args[2]->BooleanValue());
removeHiddenDependency(args.Holder(), args[1], V8TestEventTarget::eventListenerCacheIndex);
}
return v8Undefined();
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp (125481 => 125482)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp 2012-08-14 00:49:48 UTC (rev 125481)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp 2012-08-14 00:51:31 UTC (rev 125482)
@@ -1232,7 +1232,7 @@
INC_STATS("DOM.TestObj.addEventListener()");
RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOrCreate);
if (listener) {
- V8TestObj::toNative(args.Holder())->addEventListener(v8ValueToAtomicWebCoreString(args[0]), listener, args[2]->BooleanValue());
+ V8TestObj::toNative(args.Holder())->addEventListener(toWebCoreAtomicString(args[0]), listener, args[2]->BooleanValue());
createHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerCacheIndex);
}
return v8Undefined();
@@ -1243,7 +1243,7 @@
INC_STATS("DOM.TestObj.removeEventListener()");
RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOnly);
if (listener) {
- V8TestObj::toNative(args.Holder())->removeEventListener(v8ValueToAtomicWebCoreString(args[0]), listener.get(), args[2]->BooleanValue());
+ V8TestObj::toNative(args.Holder())->removeEventListener(toWebCoreAtomicString(args[0]), listener.get(), args[2]->BooleanValue());
removeHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerCacheIndex);
}
return v8Undefined();
Modified: trunk/Source/WebCore/bindings/v8/V8Binding.cpp (125481 => 125482)
--- trunk/Source/WebCore/bindings/v8/V8Binding.cpp 2012-08-14 00:49:48 UTC (rev 125481)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.cpp 2012-08-14 00:51:31 UTC (rev 125482)
@@ -88,7 +88,7 @@
return v8NonStringValueToWebCoreString(value);
}
-AtomicString v8ValueToAtomicWebCoreString(v8::Handle<v8::Value> value)
+AtomicString toWebCoreAtomicString(v8::Handle<v8::Value> value)
{
if (value->IsString())
return v8StringToWebCoreString<AtomicString>(v8::Handle<v8::String>::Cast(value), Externalize);
Modified: trunk/Source/WebCore/bindings/v8/V8Binding.h (125481 => 125482)
--- trunk/Source/WebCore/bindings/v8/V8Binding.h 2012-08-14 00:49:48 UTC (rev 125481)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.h 2012-08-14 00:51:31 UTC (rev 125482)
@@ -97,7 +97,7 @@
String toWebCoreString(v8::Handle<v8::Value>);
// Convert a V8 value to a WTF::AtomicString.
- AtomicString v8ValueToAtomicWebCoreString(v8::Handle<v8::Value>);
+ AtomicString toWebCoreAtomicString(v8::Handle<v8::Value>);
// Return a V8 external string that shares the underlying buffer with the given
// WebCore string. The reference counting mechanism is used to keep the
@@ -341,14 +341,14 @@
return value->IsNull() ? String() : toWebCoreString(value);
}
- inline AtomicString toAtomicWebCoreStringWithNullCheck(v8::Handle<v8::Value> value)
+ inline String toWebCoreStringWithNullOrUndefinedCheck(v8::Handle<v8::Value> value)
{
- return value->IsNull() ? AtomicString() : v8ValueToAtomicWebCoreString(value);
+ return (value->IsNull() || value->IsUndefined()) ? String() : toWebCoreString(value);
}
- inline String toWebCoreStringWithNullOrUndefinedCheck(v8::Handle<v8::Value> value)
+ inline AtomicString toWebCoreAtomicStringWithNullCheck(v8::Handle<v8::Value> value)
{
- return (value->IsNull() || value->IsUndefined()) ? String() : toWebCoreString(value);
+ return value->IsNull() ? AtomicString() : toWebCoreAtomicString(value);
}
inline v8::Handle<v8::String> v8UndetectableString(const String& str)
Modified: trunk/Source/WebCore/bindings/v8/V8Collection.h (125481 => 125482)
--- trunk/Source/WebCore/bindings/v8/V8Collection.h 2012-08-14 00:49:48 UTC (rev 125481)
+++ trunk/Source/WebCore/bindings/v8/V8Collection.h 2012-08-14 00:51:31 UTC (rev 125482)
@@ -66,7 +66,7 @@
ASSERT(V8DOMWrapper::maybeDOMWrapper(object));
ASSERT(V8DOMWrapper::domWrapperType(object) != &V8Node::info);
Collection* collection = toNativeCollection<Collection>(object);
- AtomicString propertyName = toAtomicWebCoreStringWithNullCheck(name);
+ AtomicString propertyName = toWebCoreAtomicStringWithNullCheck(name);
return getV8Object<ItemType>(collection->namedItem(propertyName), isolate);
}
Modified: trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp (125481 => 125482)
--- trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp 2012-08-14 00:49:48 UTC (rev 125481)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp 2012-08-14 00:51:31 UTC (rev 125482)
@@ -556,7 +556,7 @@
v8::Handle<v8::Value> getter(v8::Local<v8::String> property, const v8::AccessorInfo& info)
{
// FIXME(antonm): consider passing AtomicStringImpl directly.
- AtomicString name = v8ValueToAtomicWebCoreString(property);
+ AtomicString name = toWebCoreAtomicString(property);
HTMLDocument* htmlDocument = V8HTMLDocument::toNative(info.Holder());
ASSERT(htmlDocument);
v8::Handle<v8::Value> result = V8HTMLDocument::GetNamedProperty(htmlDocument, name, info.GetIsolate());
Modified: trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp (125481 => 125482)
--- trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp 2012-08-14 00:49:48 UTC (rev 125481)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp 2012-08-14 00:51:31 UTC (rev 125482)
@@ -499,7 +499,7 @@
return v8Undefined();
// Search sub-frames.
- AtomicString propName = v8ValueToAtomicWebCoreString(name);
+ AtomicString propName = toWebCoreAtomicString(name);
Frame* child = frame->tree()->scopedChild(propName);
if (child)
return toV8(child->domWindow(), info.GetIsolate());
Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp (125481 => 125482)
--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp 2012-08-14 00:49:48 UTC (rev 125481)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp 2012-08-14 00:51:31 UTC (rev 125482)
@@ -81,7 +81,7 @@
return v8Undefined();
HTMLAllCollection* imp = V8HTMLAllCollection::toNative(info.Holder());
- return getNamedItems(imp, v8ValueToAtomicWebCoreString(name), info.GetIsolate());
+ return getNamedItems(imp, toWebCoreAtomicString(name), info.GetIsolate());
}
v8::Handle<v8::Value> V8HTMLAllCollection::itemCallback(const v8::Arguments& args)
Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp (125481 => 125482)
--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp 2012-08-14 00:49:48 UTC (rev 125481)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp 2012-08-14 00:51:31 UTC (rev 125482)
@@ -70,7 +70,7 @@
return v8Undefined();
HTMLCollection* imp = V8HTMLCollection::toNative(info.Holder());
- return getNamedItems(imp, v8ValueToAtomicWebCoreString(name), info.GetIsolate());
+ return getNamedItems(imp, toWebCoreAtomicString(name), info.GetIsolate());
}
v8::Handle<v8::Value> V8HTMLCollection::namedItemCallback(const v8::Arguments& args)
Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp (125481 => 125482)
--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp 2012-08-14 00:49:48 UTC (rev 125481)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp 2012-08-14 00:51:31 UTC (rev 125482)
@@ -56,7 +56,7 @@
{
INC_STATS("DOM.HTMLFormElement.NamedPropertyGetter");
HTMLFormElement* imp = V8HTMLFormElement::toNative(info.Holder());
- AtomicString v = v8ValueToAtomicWebCoreString(name);
+ AtomicString v = toWebCoreAtomicString(name);
// Call getNamedElements twice, first time check if it has a value
// and let HTMLFormElement update its cache.
Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp (125481 => 125482)
--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp 2012-08-14 00:49:48 UTC (rev 125481)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp 2012-08-14 00:51:31 UTC (rev 125482)
@@ -49,7 +49,7 @@
{
INC_STATS("DOM.HTMLFrameSetElement.NamedPropertyGetter");
HTMLFrameSetElement* imp = V8HTMLFrameSetElement::toNative(info.Holder());
- Node* frameNode = imp->children()->namedItem(v8ValueToAtomicWebCoreString(name));
+ Node* frameNode = imp->children()->namedItem(toWebCoreAtomicString(name));
if (frameNode && frameNode->hasTagName(HTMLNames::frameTag)) {
Document* doc = static_cast<HTMLFrameElement*>(frameNode)->contentDocument();
if (!doc)
Modified: trunk/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp (125481 => 125482)
--- trunk/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp 2012-08-14 00:49:48 UTC (rev 125481)
+++ trunk/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp 2012-08-14 00:51:31 UTC (rev 125482)
@@ -46,7 +46,7 @@
{
INC_STATS("DOM.NodeList.NamedPropertyGetter");
NodeList* list = V8NodeList::toNative(info.Holder());
- AtomicString key = v8ValueToAtomicWebCoreString(name);
+ AtomicString key = toWebCoreAtomicString(name);
// Length property cannot be overridden.
DEFINE_STATIC_LOCAL(const AtomicString, length, ("length"));