Diff
Modified: trunk/Source/WebCore/ChangeLog (203249 => 203250)
--- trunk/Source/WebCore/ChangeLog 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/ChangeLog 2016-07-14 23:17:51 UTC (rev 203250)
@@ -1,3 +1,47 @@
+2016-07-14 Chris Dumez <[email protected]>
+
+ Use emptyString() instead of "" when possible
+ https://bugs.webkit.org/show_bug.cgi?id=159789
+
+ Reviewed by Alex Christensen.
+
+ Use emptyString() instead of "" when possible to reduce String allocations.
+
+ * Modules/webdatabase/Database.cpp:
+ (WebCore::Database::performOpenAndVerify):
+ * css/CSSSelector.h:
+ * css/StyleProperties.cpp:
+ (WebCore::MutableStyleProperties::removeProperty):
+ (WebCore::MutableStyleProperties::removeCustomProperty):
+ * editing/TextCheckingHelper.cpp:
+ (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
+ (WebCore::TextCheckingHelper::findFirstBadGrammar):
+ * editing/TypingCommand.h:
+ (WebCore::TypingCommand::create):
+ * fileapi/FileReaderLoader.cpp:
+ (WebCore::FileReaderLoader::cleanup):
+ * inspector/InspectorStyleSheet.cpp:
+ (WebCore::fillMediaListChain):
+ * page/UserContentURLPattern.cpp:
+ (WebCore::UserContentURLPattern::parse):
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::MediaPlayer::load):
+ * platform/gtk/DataObjectGtk.h:
+ (WebCore::DataObjectGtk::clearURIList):
+ * platform/network/curl/ResourceHandleCurl.cpp:
+ (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
+ * platform/network/curl/ResourceHandleManager.h:
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::layerTreeAsText):
+ * rendering/RenderListMarker.cpp:
+ (WebCore::RenderListMarker::updateContent):
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::noneDashboardRegions):
+ * rendering/svg/SVGTextMetrics.cpp:
+ (WebCore::SVGTextMetrics::SVGTextMetrics):
+ * xml/XPathParser.cpp:
+ (WebCore::XPath::Parser::lexString):
+
2016-07-14 Brent Fulgham <[email protected]>
editing/spelling/spellcheck-async.html sometimes crashes with GuardMalloc
Modified: trunk/Source/WebCore/Modules/webdatabase/Database.cpp (203249 => 203250)
--- trunk/Source/WebCore/Modules/webdatabase/Database.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/Modules/webdatabase/Database.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -440,7 +440,7 @@
if (currentVersion.isNull()) {
LOG(StorageAPI, "Database %s does not have its version set", databaseDebugName().ascii().data());
- currentVersion = "";
+ currentVersion = emptyString();
}
// If the expected version isn't the empty string, ensure that the current database version we have matches that version. Otherwise, set an exception.
@@ -463,7 +463,7 @@
onExitCaller.setOpenSucceeded();
if (m_new && !shouldSetVersionInNewDatabase)
- m_expectedVersion = ""; // The caller provided a creationCallback which will set the expected version.
+ m_expectedVersion = emptyString(); // The caller provided a creationCallback which will set the expected version.
if (databaseContext()->databaseThread())
databaseContext()->databaseThread()->recordDatabaseOpen(this);
Modified: trunk/Source/WebCore/css/CSSSelector.h (203249 => 203250)
--- trunk/Source/WebCore/css/CSSSelector.h 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/css/CSSSelector.h 2016-07-14 23:17:51 UTC (rev 203250)
@@ -48,7 +48,7 @@
/**
* Re-create selector text from selector's data
*/
- String selectorText(const String& = "") const;
+ String selectorText(const String& = emptyString()) const;
// checks if the 2 selectors (including sub selectors) agree.
bool operator==(const CSSSelector&) const;
Modified: trunk/Source/WebCore/css/StyleProperties.cpp (203249 => 203250)
--- trunk/Source/WebCore/css/StyleProperties.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/css/StyleProperties.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -656,7 +656,7 @@
if (removeShorthandProperty(propertyID)) {
// FIXME: Return an equivalent shorthand when possible.
if (returnText)
- *returnText = "";
+ *returnText = emptyString();
return true;
}
@@ -663,7 +663,7 @@
int foundPropertyIndex = findPropertyIndex(propertyID);
if (foundPropertyIndex == -1) {
if (returnText)
- *returnText = "";
+ *returnText = emptyString();
return false;
}
@@ -682,7 +682,7 @@
int foundPropertyIndex = findCustomPropertyIndex(propertyName);
if (foundPropertyIndex == -1) {
if (returnText)
- *returnText = "";
+ *returnText = emptyString();
return false;
}
Modified: trunk/Source/WebCore/editing/TextCheckingHelper.cpp (203249 => 203250)
--- trunk/Source/WebCore/editing/TextCheckingHelper.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/editing/TextCheckingHelper.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -313,7 +313,7 @@
outGrammarDetail.location = -1;
outGrammarDetail.length = 0;
outGrammarDetail.guesses.clear();
- outGrammarDetail.userDescription = "";
+ outGrammarDetail.userDescription = emptyString();
// Expand the search range to encompass entire paragraphs, since text checking needs that much context.
// Determine the character offset from the start of the paragraph to the start of the original search range,
@@ -471,7 +471,7 @@
outGrammarDetail.location = -1;
outGrammarDetail.length = 0;
outGrammarDetail.guesses.clear();
- outGrammarDetail.userDescription = "";
+ outGrammarDetail.userDescription = emptyString();
outGrammarPhraseOffset = 0;
String firstBadGrammarPhrase;
Modified: trunk/Source/WebCore/editing/TypingCommand.h (203249 => 203250)
--- trunk/Source/WebCore/editing/TypingCommand.h 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/editing/TypingCommand.h 2016-07-14 23:17:51 UTC (rev 203250)
@@ -85,7 +85,7 @@
#endif
private:
- static Ref<TypingCommand> create(Document& document, ETypingCommand command, const String& text = "", Options options = 0, TextGranularity granularity = CharacterGranularity)
+ static Ref<TypingCommand> create(Document& document, ETypingCommand command, const String& text = emptyString(), Options options = 0, TextGranularity granularity = CharacterGranularity)
{
return adoptRef(*new TypingCommand(document, command, text, options, granularity, TextCompositionNone));
}
Modified: trunk/Source/WebCore/fileapi/FileReaderLoader.cpp (203249 => 203250)
--- trunk/Source/WebCore/fileapi/FileReaderLoader.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/fileapi/FileReaderLoader.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -121,7 +121,7 @@
// If we get any error, we do not need to keep a buffer around.
if (m_errorCode) {
m_rawData = nullptr;
- m_stringResult = "";
+ m_stringResult = emptyString();
}
}
Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp (203249 => 203250)
--- trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -246,7 +246,7 @@
if (sourceURL.isEmpty())
sourceURL = InspectorDOMAgent::documentURLString(parentStyleSheet->ownerDocument());
} else
- sourceURL = "";
+ sourceURL = emptyString();
if (mediaList && mediaList->length())
mediaArray.addItem(buildMediaObject(mediaList, isMediaRule ? MediaListSourceMediaRule : MediaListSourceImportRule, sourceURL));
@@ -264,7 +264,7 @@
else if (!styleSheet->contents().baseURL().isEmpty())
sourceURL = styleSheet->contents().baseURL();
else
- sourceURL = "";
+ sourceURL = emptyString();
mediaArray.addItem(buildMediaObject(mediaList, styleSheet->ownerNode() ? MediaListSourceLinkedSheet : MediaListSourceInlineSheet, sourceURL));
}
parentRule = styleSheet->ownerRule();
Modified: trunk/Source/WebCore/page/UserContentURLPattern.cpp (203249 => 203250)
--- trunk/Source/WebCore/page/UserContentURLPattern.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/page/UserContentURLPattern.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -89,7 +89,7 @@
if (m_host == "*") {
// The pattern can be just '*', which means match all domains.
- m_host = "";
+ m_host = emptyString();
m_matchSubdomains = true;
} else if (m_host.startsWith("*.")) {
// The first component can be '*', which means to match all subdomains.
Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (203249 => 203250)
--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -396,7 +396,7 @@
m_contentMIMEType = contentType.type().convertToASCIILowercase();
m_contentTypeCodecs = contentType.parameter(codecs());
m_url = url;
- m_keySystem = "";
+ m_keySystem = emptyString();
m_contentMIMETypeWasInferredFromExtension = false;
loadWithNextMediaEngine(0);
return m_currentMediaEngine;
@@ -410,8 +410,8 @@
ASSERT(mediaStream);
m_mediaStream = mediaStream;
- m_keySystem = "";
- m_contentMIMEType = "";
+ m_keySystem = emptyString();
+ m_contentMIMEType = emptyString();
m_contentMIMETypeWasInferredFromExtension = false;
loadWithNextMediaEngine(0);
return m_currentMediaEngine;
Modified: trunk/Source/WebCore/platform/gtk/DataObjectGtk.h (203249 => 203250)
--- trunk/Source/WebCore/platform/gtk/DataObjectGtk.h 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/platform/gtk/DataObjectGtk.h 2016-07-14 23:17:51 UTC (rev 203250)
@@ -47,7 +47,7 @@
bool hasURL() const { return !m_url.isEmpty() && m_url.isValid(); }
bool hasFilenames() const { return !m_filenames.isEmpty(); }
bool hasImage() const { return m_image; }
- void clearURIList() { m_uriList = ""; }
+ void clearURIList() { m_uriList = emptyString(); }
void clearURL() { m_url = URL(); }
void clearImage() { m_image = nullptr; }
Modified: trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp (203249 => 203250)
--- trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -249,7 +249,7 @@
if (challenge != d->m_currentWebChallenge)
return;
- String userpass = "";
+ String userpass = emptyString();
curl_easy_setopt(d->m_handle, CURLOPT_USERPWD, userpass.utf8().data());
clearAuthentication();
Modified: trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.h (203249 => 203250)
--- trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.h 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.h 2016-07-14 23:17:51 UTC (rev 203250)
@@ -67,11 +67,7 @@
void setupPOST(ResourceHandle*, struct curl_slist**);
void setupPUT(ResourceHandle*, struct curl_slist**);
- void setProxyInfo(const String& host = "",
- unsigned long port = 0,
- ProxyType type = HTTP,
- const String& username = "",
- const String& password = "");
+ void setProxyInfo(const String& host = emptyString(), unsigned long port = 0, ProxyType = HTTP, const String& username = emptyString(), const String& password = emptyString());
private:
ResourceHandleManager();
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (203249 => 203250)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -1847,7 +1847,7 @@
// Dump an empty layer tree only if the only composited layer is the main frame's tiled backing,
// so that tests expecting us to drop out of accelerated compositing when there are no layers succeed.
if (!hasAnyAdditionalCompositedLayers(rootRenderLayer()) && documentUsesTiledBacking() && !(layerTreeBehavior & LayerTreeAsTextIncludeTileCaches))
- layerTreeText = "";
+ layerTreeText = emptyString();
// The true root layer is not included in the dump, so if we want to report
// its repaint rects, they must be included here.
Modified: trunk/Source/WebCore/rendering/RenderListMarker.cpp (203249 => 203250)
--- trunk/Source/WebCore/rendering/RenderListMarker.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/rendering/RenderListMarker.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -1418,7 +1418,7 @@
if (!preferredLogicalWidthsDirty())
return;
- m_text = "";
+ m_text = emptyString();
if (isImage()) {
// FIXME: This is a somewhat arbitrary width. Generated images for markers really won't become particularly useful
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (203249 => 203250)
--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -1343,7 +1343,7 @@
if (!noneListInitialized) {
StyleDashboardRegion region;
- region.label = "";
+ region.label = emptyString();
region.offset.top() = Length();
region.offset.right() = Length();
region.offset.bottom() = Length();
Modified: trunk/Source/WebCore/rendering/svg/SVGTextMetrics.cpp (203249 => 203250)
--- trunk/Source/WebCore/rendering/svg/SVGTextMetrics.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/rendering/svg/SVGTextMetrics.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -50,7 +50,7 @@
// Calculate width/height using the scaled font, divide this result by the scalingFactor afterwards.
m_width = scaledFont.width(run) / scalingFactor;
length = run.length();
- m_glyph.name = "";
+ m_glyph.name = emptyString();
m_height = scaledFont.fontMetrics().floatHeight() / scalingFactor;
m_glyph.unicodeString = run.is8Bit() ? String(run.characters8(), length) : String(run.characters16(), length);
Modified: trunk/Source/WebCore/xml/XPathParser.cpp (203249 => 203250)
--- trunk/Source/WebCore/xml/XPathParser.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebCore/xml/XPathParser.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -188,7 +188,7 @@
if (m_data[m_nextPos] == delimiter) {
String value = m_data.substring(startPos, m_nextPos - startPos);
if (value.isNull())
- value = "";
+ value = emptyString();
++m_nextPos; // Consume the char.
return Token(LITERAL, value);
}
Modified: trunk/Source/WebKit/cf/ChangeLog (203249 => 203250)
--- trunk/Source/WebKit/cf/ChangeLog 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebKit/cf/ChangeLog 2016-07-14 23:17:51 UTC (rev 203250)
@@ -1,3 +1,15 @@
+2016-07-14 Chris Dumez <[email protected]>
+
+ Use emptyString() instead of "" when possible
+ https://bugs.webkit.org/show_bug.cgi?id=159789
+
+ Reviewed by Alex Christensen.
+
+ Use emptyString() instead of "" when possible to reduce String allocations.
+
+ * WebCoreSupport/WebInspectorClientCF.cpp:
+ (populateSetting):
+
2015-05-01 Martin Robinson <[email protected]>
USE(...) macro should expect unprefixed variables
Modified: trunk/Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp (203249 => 203250)
--- trunk/Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -82,7 +82,7 @@
else if (type == CFBooleanGetTypeID())
*setting = static_cast<bool>(CFBooleanGetValue(static_cast<CFBooleanRef>(value.get()))) ? "true" : "false";
else
- *setting = "";
+ *setting = emptyString();
}
static void storeSetting(const String& key, const String& setting)
Modified: trunk/Source/WebKit/win/ChangeLog (203249 => 203250)
--- trunk/Source/WebKit/win/ChangeLog 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebKit/win/ChangeLog 2016-07-14 23:17:51 UTC (rev 203250)
@@ -1,3 +1,15 @@
+2016-07-14 Chris Dumez <[email protected]>
+
+ Use emptyString() instead of "" when possible
+ https://bugs.webkit.org/show_bug.cgi?id=159789
+
+ Reviewed by Alex Christensen.
+
+ Use emptyString() instead of "" when possible to reduce String allocations.
+
+ * Plugins/PluginView.cpp:
+ (WebCore::parseRFC822HeaderFields):
+
2016-07-14 Alex Christensen <[email protected]>
Use SocketProvider to create SocketStreamHandles
Modified: trunk/Source/WebKit/win/Plugins/PluginView.cpp (203249 => 203250)
--- trunk/Source/WebKit/win/Plugins/PluginView.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebKit/win/Plugins/PluginView.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -1020,7 +1020,7 @@
break;
}
if (colon == eol)
- value = "";
+ value = emptyString();
else
value = String(colon, eol - colon);
Modified: trunk/Source/WebKit2/ChangeLog (203249 => 203250)
--- trunk/Source/WebKit2/ChangeLog 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebKit2/ChangeLog 2016-07-14 23:17:51 UTC (rev 203250)
@@ -1,3 +1,18 @@
+2016-07-14 Chris Dumez <[email protected]>
+
+ Use emptyString() instead of "" when possible
+ https://bugs.webkit.org/show_bug.cgi?id=159789
+
+ Reviewed by Alex Christensen.
+
+ Use emptyString() instead of "" when possible to reduce String allocations.
+
+ * UIProcess/Cocoa/WebViewImpl.mm:
+ (WebKit::WebViewImpl::pasteboardChangedOwner):
+ * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
+ (WebKit::parseRFC822HeaderFields):
+ (WebKit::NPN_Status):
+
2016-07-14 Alex Christensen <[email protected]>
Use more Refs with WorkQueues
Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm (203249 => 203250)
--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm 2016-07-14 23:17:51 UTC (rev 203250)
@@ -3004,8 +3004,8 @@
void WebViewImpl::pasteboardChangedOwner(NSPasteboard *pasteboard)
{
m_promisedImage = nullptr;
- m_promisedFilename = "";
- m_promisedURL = "";
+ m_promisedFilename = emptyString();
+ m_promisedURL = emptyString();
}
void WebViewImpl::provideDataForPasteboard(NSPasteboard *pasteboard, NSString *type)
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp (203249 => 203250)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp 2016-07-14 23:15:20 UTC (rev 203249)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp 2016-07-14 23:17:51 UTC (rev 203250)
@@ -205,7 +205,7 @@
break;
}
if (colon == endOfLine)
- value = "";
+ value = emptyString();
else
value = String(colon, endOfLine - colon);
@@ -340,7 +340,7 @@
{
String statusbarText;
if (!message)
- statusbarText = "";
+ statusbarText = emptyString();
else
statusbarText = String::fromUTF8WithLatin1Fallback(message, strlen(message));