Title: [140665] trunk/Source/WebCore
- Revision
- 140665
- Author
- [email protected]
- Date
- 2013-01-24 01:07:36 -0800 (Thu, 24 Jan 2013)
Log Message
Refactoring: Use AtomicString for an InputType::create argument
https://bugs.webkit.org/show_bug.cgi?id=107791
Reviewed by Kentaro Hara.
A string passed to InputType::create is a 'type' attribute value, which
is an AtomicString. Also, InputTypeFactoryMap is created with members of
InputTypeName, which are AtomicStrings. We had better use AtomicStrings
for them.
No new tests. This is just a refactoring.
* html/InputType.cpp:
Change the key type of InputTypeFactoryMap from String to AtomicString.
(WebCore::InputType::create):
Change an argument type from const String& to const AtomicString&.
* html/InputType.h:
(InputType): Ditto.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (140664 => 140665)
--- trunk/Source/WebCore/ChangeLog 2013-01-24 09:00:59 UTC (rev 140664)
+++ trunk/Source/WebCore/ChangeLog 2013-01-24 09:07:36 UTC (rev 140665)
@@ -1,3 +1,24 @@
+2013-01-24 Kent Tamura <[email protected]>
+
+ Refactoring: Use AtomicString for an InputType::create argument
+ https://bugs.webkit.org/show_bug.cgi?id=107791
+
+ Reviewed by Kentaro Hara.
+
+ A string passed to InputType::create is a 'type' attribute value, which
+ is an AtomicString. Also, InputTypeFactoryMap is created with members of
+ InputTypeName, which are AtomicStrings. We had better use AtomicStrings
+ for them.
+
+ No new tests. This is just a refactoring.
+
+ * html/InputType.cpp:
+ Change the key type of InputTypeFactoryMap from String to AtomicString.
+ (WebCore::InputType::create):
+ Change an argument type from const String& to const AtomicString&.
+ * html/InputType.h:
+ (InputType): Ditto.
+
2013-01-24 Kentaro Hara <[email protected]>
Unreviewed. Build fix.
Modified: trunk/Source/WebCore/html/InputType.cpp (140664 => 140665)
--- trunk/Source/WebCore/html/InputType.cpp 2013-01-24 09:00:59 UTC (rev 140664)
+++ trunk/Source/WebCore/html/InputType.cpp 2013-01-24 09:07:36 UTC (rev 140665)
@@ -85,7 +85,7 @@
using namespace std;
typedef PassOwnPtr<InputType> (*InputTypeFactoryFunction)(HTMLInputElement*);
-typedef HashMap<String, InputTypeFactoryFunction, CaseFoldingHash> InputTypeFactoryMap;
+typedef HashMap<AtomicString, InputTypeFactoryFunction, CaseFoldingHash> InputTypeFactoryMap;
static PassOwnPtr<InputTypeFactoryMap> createInputTypeFactoryMap()
{
@@ -136,7 +136,7 @@
return map.release();
}
-PassOwnPtr<InputType> InputType::create(HTMLInputElement* element, const String& typeName)
+PassOwnPtr<InputType> InputType::create(HTMLInputElement* element, const AtomicString& typeName)
{
static const InputTypeFactoryMap* factoryMap = createInputTypeFactoryMap().leakPtr();
PassOwnPtr<InputType> (*factory)(HTMLInputElement*) = typeName.isEmpty() ? 0 : factoryMap->get(typeName);
Modified: trunk/Source/WebCore/html/InputType.h (140664 => 140665)
--- trunk/Source/WebCore/html/InputType.h 2013-01-24 09:00:59 UTC (rev 140664)
+++ trunk/Source/WebCore/html/InputType.h 2013-01-24 09:07:36 UTC (rev 140665)
@@ -82,7 +82,7 @@
WTF_MAKE_FAST_ALLOCATED;
public:
- static PassOwnPtr<InputType> create(HTMLInputElement*, const String&);
+ static PassOwnPtr<InputType> create(HTMLInputElement*, const AtomicString&);
static PassOwnPtr<InputType> createText(HTMLInputElement*);
virtual ~InputType();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes