Diff
Modified: trunk/Source/WebCore/ChangeLog (116907 => 116908)
--- trunk/Source/WebCore/ChangeLog 2012-05-13 23:42:24 UTC (rev 116907)
+++ trunk/Source/WebCore/ChangeLog 2012-05-13 23:47:02 UTC (rev 116908)
@@ -1,3 +1,34 @@
+2012-05-13 Rob Buis <[email protected]>
+
+ Use emptyString instead of String("")
+ https://bugs.webkit.org/show_bug.cgi?id=86305
+
+ Reviewed by Darin Adler.
+
+ Use emptyString() instead of String("") because it is better style and faster.
+
+ No new tests. No change in behavior.
+
+ * Modules/webdatabase/AbstractDatabase.cpp:
+ (WebCore::AbstractDatabase::performOpenAndVerify):
+ * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
+ (WebCore::ThreadableWebSocketChannelClientWrapper::subprotocol):
+ (WebCore::ThreadableWebSocketChannelClientWrapper::extensions):
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::setValueFromRenderer):
+ * platform/SharedBufferChunkReader.cpp:
+ (WebCore::SharedBufferChunkReader::nextChunkAsUTF8StringWithLatin1Fallback):
+ * platform/network/curl/ResourceHandleManager.cpp:
+ (WebCore::ResourceHandleManager::setProxyInfo):
+ * platform/text/LocaleICU.cpp:
+ (WebCore::LocaleICU::initializeLocalizedDateFormatText):
+ * rendering/RenderQuote.cpp:
+ (WebCore::RenderQuote::originalText):
+ * storage/StorageNamespaceImpl.cpp:
+ (WebCore::StorageNamespaceImpl::localStorageNamespace):
+ * svg/SVGStringList.cpp:
+ (WebCore::SVGStringList::reset):
+
2012-05-13 Darin Adler <[email protected]>
Image::initPlatformData is always an empty function so we can remove it
Modified: trunk/Source/WebCore/Modules/webdatabase/AbstractDatabase.cpp (116907 => 116908)
--- trunk/Source/WebCore/Modules/webdatabase/AbstractDatabase.cpp 2012-05-13 23:42:24 UTC (rev 116907)
+++ trunk/Source/WebCore/Modules/webdatabase/AbstractDatabase.cpp 2012-05-13 23:47:02 UTC (rev 116908)
@@ -282,7 +282,7 @@
GuidVersionMap::iterator entry = guidToVersionMap().find(m_guid);
if (entry != guidToVersionMap().end()) {
// Map null string to empty string (see updateGuidVersionMap()).
- currentVersion = entry->second.isNull() ? String("") : entry->second.isolatedCopy();
+ currentVersion = entry->second.isNull() ? emptyString() : entry->second.isolatedCopy();
LOG(StorageAPI, "Current cached version for guid %i is %s", m_guid, currentVersion.ascii().data());
#if PLATFORM(CHROMIUM)
Modified: trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp (116907 => 116908)
--- trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp 2012-05-13 23:42:24 UTC (rev 116907)
+++ trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp 2012-05-13 23:47:02 UTC (rev 116908)
@@ -109,7 +109,7 @@
String ThreadableWebSocketChannelClientWrapper::subprotocol() const
{
if (m_subprotocol.isEmpty())
- return String("");
+ return emptyString();
return String(m_subprotocol);
}
@@ -124,7 +124,7 @@
String ThreadableWebSocketChannelClientWrapper::extensions() const
{
if (m_extensions.isEmpty())
- return String("");
+ return emptyString();
return String(m_extensions);
}
Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (116907 => 116908)
--- trunk/Source/WebCore/html/HTMLInputElement.cpp 2012-05-13 23:42:24 UTC (rev 116907)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp 2012-05-13 23:47:02 UTC (rev 116908)
@@ -991,7 +991,7 @@
// Workaround for bug where trailing \n is included in the result of textContent.
// The assert macro above may also be simplified to: value == constrainValue(value)
// http://bugs.webkit.org/show_bug.cgi?id=9661
- m_valueIfDirty = value == "\n" ? String("") : value;
+ m_valueIfDirty = value == "\n" ? emptyString() : value;
setFormControlValueMatchesRenderer(true);
m_wasModifiedByUser = true;
Modified: trunk/Source/WebCore/platform/SharedBufferChunkReader.cpp (116907 => 116908)
--- trunk/Source/WebCore/platform/SharedBufferChunkReader.cpp 2012-05-13 23:42:24 UTC (rev 116907)
+++ trunk/Source/WebCore/platform/SharedBufferChunkReader.cpp 2012-05-13 23:47:02 UTC (rev 116908)
@@ -118,7 +118,7 @@
if (!nextChunk(data, includeSeparator))
return String();
- return data.size() ? String::fromUTF8WithLatin1Fallback(data.data(), data.size()) : String("");
+ return data.size() ? String::fromUTF8WithLatin1Fallback(data.data(), data.size()) : emptyString();
}
size_t SharedBufferChunkReader::peek(Vector<char>& data, size_t requestedSize)
Modified: trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp (116907 => 116908)
--- trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp 2012-05-13 23:42:24 UTC (rev 116907)
+++ trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp 2012-05-13 23:47:02 UTC (rev 116908)
@@ -426,7 +426,7 @@
m_proxyType = type;
if (!host.length()) {
- m_proxy = String("");
+ m_proxy = emptyString();
} else {
String userPass;
if (username.length() || password.length())
Modified: trunk/Source/WebCore/platform/text/LocaleICU.cpp (116907 => 116908)
--- trunk/Source/WebCore/platform/text/LocaleICU.cpp 2012-05-13 23:42:24 UTC (rev 116907)
+++ trunk/Source/WebCore/platform/text/LocaleICU.cpp 2012-05-13 23:47:02 UTC (rev 116908)
@@ -371,7 +371,7 @@
{
if (!m_localizedDateFormatText.isNull())
return;
- m_localizedDateFormatText = String("");
+ m_localizedDateFormatText = emptyString();
if (!initializeShortDateFormat())
return;
UErrorCode status = U_ZERO_ERROR;
Modified: trunk/Source/WebCore/rendering/RenderQuote.cpp (116907 => 116908)
--- trunk/Source/WebCore/rendering/RenderQuote.cpp 2012-05-13 23:42:24 UTC (rev 116907)
+++ trunk/Source/WebCore/rendering/RenderQuote.cpp 2012-05-13 23:47:02 UTC (rev 116908)
@@ -250,7 +250,7 @@
switch (m_type) {
case NO_OPEN_QUOTE:
case NO_CLOSE_QUOTE:
- return String("").impl();
+ return emptyString().impl();
case CLOSE_QUOTE:
if (index)
--index;
Modified: trunk/Source/WebCore/storage/StorageNamespaceImpl.cpp (116907 => 116908)
--- trunk/Source/WebCore/storage/StorageNamespaceImpl.cpp 2012-05-13 23:42:24 UTC (rev 116907)
+++ trunk/Source/WebCore/storage/StorageNamespaceImpl.cpp 2012-05-13 23:47:02 UTC (rev 116908)
@@ -47,7 +47,7 @@
PassRefPtr<StorageNamespace> StorageNamespaceImpl::localStorageNamespace(const String& path, unsigned quota)
{
- const String lookupPath = path.isNull() ? String("") : path;
+ const String lookupPath = path.isNull() ? emptyString() : path;
LocalStorageNamespaceMap::iterator it = localStorageNamespaceMap().find(lookupPath);
if (it == localStorageNamespaceMap().end()) {
RefPtr<StorageNamespace> storageNamespace = adoptRef(new StorageNamespaceImpl(LocalStorage, lookupPath, quota));
Modified: trunk/Source/WebCore/svg/SVGStringList.cpp (116907 => 116908)
--- trunk/Source/WebCore/svg/SVGStringList.cpp 2012-05-13 23:42:24 UTC (rev 116907)
+++ trunk/Source/WebCore/svg/SVGStringList.cpp 2012-05-13 23:47:02 UTC (rev 116908)
@@ -42,7 +42,7 @@
// Add empty string, if list is empty.
if (isEmpty())
- append(String(""));
+ append(emptyString());
}
void SVGStringList::parse(const String& data, UChar delimiter)