Diff
Modified: trunk/Source/WebCore/ChangeLog (124623 => 124624)
--- trunk/Source/WebCore/ChangeLog 2012-08-03 16:44:40 UTC (rev 124623)
+++ trunk/Source/WebCore/ChangeLog 2012-08-03 16:47:06 UTC (rev 124624)
@@ -1,3 +1,33 @@
+2012-08-03 Kentaro Hara <[email protected]>
+
+ [V8] Remove v8StringToAtomicWebCoreString()
+ https://bugs.webkit.org/show_bug.cgi?id=93086
+
+ Reviewed by Dimitri Glazkov.
+
+ There should be only one API that converts V8 String to
+ AtomicString. v8ValueToAtomicWebCoreString() does it.
+ We can remove v8StringToAtomicWebCoreString().
+
+ No tests. No change in behavior.
+
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::v8ValueToAtomicWebCoreString):
+ * bindings/v8/V8Binding.h:
+ (WebCore):
+ * 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):
+
2012-08-03 Ilya Tikhonovsky <[email protected]>
Web Inspector: eliminate visitBaseClass method from NMI. It introduces unnecessary complexity.
Modified: trunk/Source/WebCore/bindings/v8/V8Binding.cpp (124623 => 124624)
--- trunk/Source/WebCore/bindings/v8/V8Binding.cpp 2012-08-03 16:44:40 UTC (rev 124623)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.cpp 2012-08-03 16:47:06 UTC (rev 124624)
@@ -249,7 +249,7 @@
AtomicString v8ValueToAtomicWebCoreString(v8::Handle<v8::Value> value)
{
if (value->IsString())
- return v8StringToAtomicWebCoreString(v8::Handle<v8::String>::Cast(value));
+ return v8StringToWebCoreString<AtomicString>(v8::Handle<v8::String>::Cast(value), Externalize);
return v8NonStringValueToAtomicWebCoreString(value);
}
Modified: trunk/Source/WebCore/bindings/v8/V8Binding.h (124623 => 124624)
--- trunk/Source/WebCore/bindings/v8/V8Binding.h 2012-08-03 16:44:40 UTC (rev 124623)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.h 2012-08-03 16:47:06 UTC (rev 124624)
@@ -310,12 +310,8 @@
}
String v8ValueToWebCoreString(v8::Handle<v8::Value> value);
- // Convert v8 types to a WTF::AtomicString.
- inline AtomicString v8StringToAtomicWebCoreString(v8::Handle<v8::String> v8String)
- {
- return v8StringToWebCoreString<AtomicString>(v8String, Externalize);
- }
- AtomicString v8ValueToAtomicWebCoreString(v8::Handle<v8::Value> value);
+ // Convert a V8 value to a WTF::AtomicString.
+ AtomicString v8ValueToAtomicWebCoreString(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
Modified: trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp (124623 => 124624)
--- trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp 2012-08-03 16:44:40 UTC (rev 124623)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp 2012-08-03 16:47:06 UTC (rev 124624)
@@ -549,7 +549,7 @@
v8::Handle<v8::Value> getter(v8::Local<v8::String> property, const v8::AccessorInfo& info)
{
// FIXME(antonm): consider passing AtomicStringImpl directly.
- AtomicString name = v8StringToAtomicWebCoreString(property);
+ AtomicString name = v8ValueToAtomicWebCoreString(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 (124623 => 124624)
--- trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp 2012-08-03 16:44:40 UTC (rev 124623)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp 2012-08-03 16:47:06 UTC (rev 124624)
@@ -500,7 +500,7 @@
return v8::Handle<v8::Value>();
// Search sub-frames.
- AtomicString propName = v8StringToAtomicWebCoreString(name);
+ AtomicString propName = v8ValueToAtomicWebCoreString(name);
Frame* child = frame->tree()->scopedChild(propName);
if (child)
return toV8(child->domWindow(), info.GetIsolate());
Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp (124623 => 124624)
--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp 2012-08-03 16:44:40 UTC (rev 124623)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp 2012-08-03 16:47:06 UTC (rev 124624)
@@ -81,7 +81,7 @@
return v8::Handle<v8::Value>();
HTMLAllCollection* imp = V8HTMLAllCollection::toNative(info.Holder());
- return getNamedItems(imp, v8StringToAtomicWebCoreString(name), info.GetIsolate());
+ return getNamedItems(imp, v8ValueToAtomicWebCoreString(name), info.GetIsolate());
}
v8::Handle<v8::Value> V8HTMLAllCollection::itemCallback(const v8::Arguments& args)
Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp (124623 => 124624)
--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp 2012-08-03 16:44:40 UTC (rev 124623)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp 2012-08-03 16:47:06 UTC (rev 124624)
@@ -70,7 +70,7 @@
return v8::Handle<v8::Value>();
HTMLCollection* imp = V8HTMLCollection::toNative(info.Holder());
- return getNamedItems(imp, v8StringToAtomicWebCoreString(name), info.GetIsolate());
+ return getNamedItems(imp, v8ValueToAtomicWebCoreString(name), info.GetIsolate());
}
v8::Handle<v8::Value> V8HTMLCollection::namedItemCallback(const v8::Arguments& args)
Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp (124623 => 124624)
--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp 2012-08-03 16:44:40 UTC (rev 124623)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp 2012-08-03 16:47:06 UTC (rev 124624)
@@ -56,7 +56,7 @@
{
INC_STATS("DOM.HTMLFormElement.NamedPropertyGetter");
HTMLFormElement* imp = V8HTMLFormElement::toNative(info.Holder());
- AtomicString v = v8StringToAtomicWebCoreString(name);
+ AtomicString v = v8ValueToAtomicWebCoreString(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 (124623 => 124624)
--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp 2012-08-03 16:44:40 UTC (rev 124623)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp 2012-08-03 16:47:06 UTC (rev 124624)
@@ -49,7 +49,7 @@
{
INC_STATS("DOM.HTMLFrameSetElement.NamedPropertyGetter");
HTMLFrameSetElement* imp = V8HTMLFrameSetElement::toNative(info.Holder());
- Node* frameNode = imp->children()->namedItem(v8StringToAtomicWebCoreString(name));
+ Node* frameNode = imp->children()->namedItem(v8ValueToAtomicWebCoreString(name));
if (frameNode && frameNode->hasTagName(HTMLNames::frameTag)) {
Document* doc = static_cast<HTMLFrameElement*>(frameNode)->contentDocument();
if (!doc)