Improve idiom used for string building in a few places
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Mar 2014 07:13:59 +0000 (07:13 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Mar 2014 07:13:59 +0000 (07:13 +0000)
commit2504be66c813a2e179d68bf7251283382141d83c
treead71fb5ee94e9da94263f0974ae0312f6bbfe634
parent6aa2d451ed71afe110955c1b69e232a7075c1fa5
Improve idiom used for string building in a few places
https://bugs.webkit.org/show_bug.cgi?id=130561

Reviewed by Andreas Kling.

Source/WebCore:

* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::loggingString): Use a StringBuilder, and get rid of
an an unnecessary additional string allocation.

* Modules/websockets/ThreadableWebSocketChannel.cpp:
(WebCore::ThreadableWebSocketChannel::create): Use StringBuilder.

* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::createTDForFilename): Do a more efficient
string concatenation.
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::updateValidationMessage): Ditto.

* inspector/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource):
Use a StringBuilder.

* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::shorthandValue): Use a StringBuilder.

* inspector/InspectorStyleTextEditor.cpp:
(WebCore::InspectorStyleTextEditor::insertProperty): Use a more efficient idiom
for string concatenation.
(WebCore::InspectorStyleTextEditor::internalReplaceProperty): Ditto.
* loader/FormSubmission.cpp:
(WebCore::appendMailtoPostFormDataToURL): Ditto.

* page/Frame.cpp:
(WebCore::createRegExpForLabels): Use a StringBuilder.

* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processCueAttributes): Use a more efficient
idiom for string concatenation.

* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::getUnmangledInfoLog): Use a StringBuilder.

* platform/network/MIMEHeader.cpp:
(WebCore::MIMEHeader::parseHeader): Use a more efficient idiom for string
concatenation.
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::addHTTPHeaderField): Ditto.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText): Ditto.

* rendering/RenderText.cpp:
(WebCore::RenderText::secureText): Create a new string with the substring
function rather than with the append function.

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::setRequestHeaderInternal): Use a more efficient idiom
for string concatenation.

Source/WebKit/mac:

* WebView/WebHTMLRepresentation.mm:
(regExpForLabels): Use StringBuilder.

Source/WebKit2:

* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::initializeSandbox): Use a more efficient idiom for string
concatenation.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::createInspectorPage): Use a StringBuilder.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166047 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBKeyData.cpp
Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp
Source/WebCore/html/FTPDirectoryDocument.cpp
Source/WebCore/html/ValidationMessage.cpp
Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp
Source/WebCore/inspector/InspectorStyleSheet.cpp
Source/WebCore/inspector/InspectorStyleTextEditor.cpp
Source/WebCore/loader/FormSubmission.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
Source/WebCore/platform/network/MIMEHeader.cpp
Source/WebCore/platform/network/ResourceResponseBase.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderText.cpp
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebHTMLRepresentation.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/mac/ChildProcessMac.mm
Source/WebKit2/UIProcess/WebInspectorProxy.cpp