Cleanup some StringBuilder use
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Jul 2017 08:03:06 +0000 (08:03 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Jul 2017 08:03:06 +0000 (08:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174118

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-07-04
Reviewed by Andreas Kling.

Source/JavaScriptCore:

* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck):
* tools/FunctionOverrides.cpp:
(JSC::parseClause):
* wasm/WasmOMGPlan.cpp:
* wasm/WasmPlan.cpp:
* wasm/WasmValidate.cpp:

Source/WebCore:

* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::filterICECandidate):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::compileGlobalDisplayNoneStyleSheet):
* css/CSSFontStyleRangeValue.cpp:
(WebCore::CSSFontStyleRangeValue::customCSSText):
* css/CSSFontStyleValue.cpp:
(WebCore::CSSFontStyleValue::customCSSText):
* css/CSSGridAutoRepeatValue.cpp:
(WebCore::CSSGridAutoRepeatValue::customCSSText):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontFaceDescriptor):
* dom/Attr.cpp:
* html/canvas/WebGPURenderingContext.cpp:
* html/parser/HTMLParserIdioms.cpp:
* platform/network/ParsedContentType.cpp:
* platform/network/cocoa/CookieCocoa.mm:
* platform/text/mac/LocaleMac.mm:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::getAllResponseHeaders):

Source/WebKit2:

* NetworkProcess/capture/NetworkCaptureManager.cpp:
(WebKit::NetworkCapture::Manager::hashToPath):
* UIProcess/WebPageProxy.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219115 268f45cc-cd09-0410-ab3c-d52691b4dbfc

24 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/FunctionConstructor.cpp
Source/JavaScriptCore/tools/FunctionOverrides.cpp
Source/JavaScriptCore/wasm/WasmOMGPlan.cpp
Source/JavaScriptCore/wasm/WasmPlan.cpp
Source/JavaScriptCore/wasm/WasmValidate.cpp
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp
Source/WebCore/contentextensions/ContentExtension.cpp
Source/WebCore/css/CSSFontStyleRangeValue.cpp
Source/WebCore/css/CSSFontStyleValue.cpp
Source/WebCore/css/CSSGridAutoRepeatValue.cpp
Source/WebCore/css/parser/CSSParser.cpp
Source/WebCore/dom/Attr.cpp
Source/WebCore/html/canvas/WebGPURenderingContext.cpp
Source/WebCore/html/parser/HTMLParserIdioms.cpp
Source/WebCore/platform/network/ParsedContentType.cpp
Source/WebCore/platform/network/cocoa/CookieCocoa.mm
Source/WebCore/platform/text/mac/LocaleMac.mm
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/capture/NetworkCaptureManager.cpp
Source/WebKit2/UIProcess/WebPageProxy.cpp

index 929f8c8..ce1a18b 100644 (file)
@@ -1,3 +1,18 @@
+2017-07-04  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Cleanup some StringBuilder use
+        https://bugs.webkit.org/show_bug.cgi?id=174118
+
+        Reviewed by Andreas Kling.
+
+        * runtime/FunctionConstructor.cpp:
+        (JSC::constructFunctionSkippingEvalEnabledCheck):
+        * tools/FunctionOverrides.cpp:
+        (JSC::parseClause):
+        * wasm/WasmOMGPlan.cpp:
+        * wasm/WasmPlan.cpp:
+        * wasm/WasmValidate.cpp:
+
 2017-07-03  Saam Barati  <sbarati@apple.com>
 
         LayoutTest workers/bomb.html is a Crash
index 5189d57..7c4f29b 100644 (file)
@@ -137,7 +137,7 @@ JSObject* constructFunctionSkippingEvalEnabledCheck(
         program = makeString("{", prefix, functionName.string(), "() {\n", body, "\n}}");
     } else {
         StringBuilder builder;
-        builder.append("{");
+        builder.append('{');
         builder.append(prefix);
         builder.append(functionName.string());
         builder.append('(');
index 3a54e55..e83b6ee 100644 (file)
@@ -203,7 +203,7 @@ static String parseClause(const char* keyword, size_t keywordLength, FILE* file,
         FAIL_WITH_ERROR(SYNTAX_ERROR, ("Delimiter '", delimiter, "' cannot have '{', '}', or whitespace:\n", line, "\n"));
     
     String terminatorString;
-    terminatorString.append("}");
+    terminatorString.append('}');
     terminatorString.append(delimiter);
 
     CString terminatorCString = terminatorString.ascii();
index 9576c98..5918f92 100644 (file)
@@ -44,7 +44,6 @@
 #include <wtf/MonotonicTime.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/ThreadMessage.h>
-#include <wtf/text/StringBuilder.h>
 
 namespace JSC { namespace Wasm {
 
index 0202fa2..1483ac7 100644 (file)
@@ -44,7 +44,6 @@
 #include <wtf/MonotonicTime.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/SystemTracing.h>
-#include <wtf/text/StringBuilder.h>
 
 namespace JSC { namespace Wasm {
 
index dd283ea..1a46f5c 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "WasmFunctionParser.h"
 #include <wtf/CommaPrinter.h>
-#include <wtf/text/StringBuilder.h>
 
 namespace JSC { namespace Wasm {
 
index 8a99152..46c6287 100644 (file)
@@ -1,3 +1,32 @@
+2017-07-04  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Cleanup some StringBuilder use
+        https://bugs.webkit.org/show_bug.cgi?id=174118
+
+        Reviewed by Andreas Kling.
+
+        * Modules/mediastream/PeerConnectionBackend.cpp:
+        (WebCore::filterICECandidate):
+        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
+        * contentextensions/ContentExtension.cpp:
+        (WebCore::ContentExtensions::ContentExtension::compileGlobalDisplayNoneStyleSheet):
+        * css/CSSFontStyleRangeValue.cpp:
+        (WebCore::CSSFontStyleRangeValue::customCSSText):
+        * css/CSSFontStyleValue.cpp:
+        (WebCore::CSSFontStyleValue::customCSSText):
+        * css/CSSGridAutoRepeatValue.cpp:
+        (WebCore::CSSGridAutoRepeatValue::customCSSText):
+        * css/parser/CSSParser.cpp:
+        (WebCore::CSSParser::parseFontFaceDescriptor):
+        * dom/Attr.cpp:
+        * html/canvas/WebGPURenderingContext.cpp:
+        * html/parser/HTMLParserIdioms.cpp:
+        * platform/network/ParsedContentType.cpp:
+        * platform/network/cocoa/CookieCocoa.mm:
+        * platform/text/mac/LocaleMac.mm:
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::getAllResponseHeaders):
+
 2017-07-03  Andreas Kling  <akling@apple.com>
 
         Null RenderLayer* deref in FrameView::adjustTiledBackingCoverage()
index 53238d7..773e7e8 100644 (file)
@@ -323,7 +323,7 @@ static String filterICECandidate(String&& sdp)
         if (isFirst)
             isFirst = false;
         else
-            filteredSDP.append(" ");
+            filteredSDP.append(' ');
         filteredSDP.append(item);
     });
     return filteredSDP.toString();
index 60d48e2..738877b 100644 (file)
@@ -41,7 +41,6 @@
 #include "RTCSessionDescription.h"
 #include "RealtimeIncomingAudioSource.h"
 #include "RealtimeIncomingVideoSource.h"
-#include <wtf/text/StringBuilder.h>
 
 namespace WebCore {
 
index 951a11b..86b6b62 100644 (file)
@@ -103,9 +103,9 @@ void ContentExtension::compileGlobalDisplayNoneStyleSheet()
     }
     if (css.isEmpty())
         return;
-    css.append("{");
+    css.append('{');
     css.append(ContentExtensionsBackend::displayNoneCSSRule());
-    css.append("}");
+    css.append('}');
 
     m_globalDisplayNoneStyleSheet = StyleSheetContents::create();
     m_globalDisplayNoneStyleSheet->setIsUserStyleSheet(true);
index 847f57c..0cdcdbf 100644 (file)
@@ -37,7 +37,7 @@ String CSSFontStyleRangeValue::customCSSText() const
 
     StringBuilder builder;
     builder.append(fontStyleValue->cssText());
-    builder.append(" ");
+    builder.append(' ');
     builder.append(obliqueValues->cssText());
     return builder.toString();
 }
index 237cd1f..51cfa56 100644 (file)
@@ -37,7 +37,7 @@ String CSSFontStyleValue::customCSSText() const
 
     StringBuilder builder;
     builder.append(fontStyleValue->cssText());
-    builder.append(" ");
+    builder.append(' ');
     builder.append(obliqueValue->cssText());
     return builder.toString();
 }
index 1b5fc1a..d5bc449 100644 (file)
@@ -42,7 +42,7 @@ String CSSGridAutoRepeatValue::customCSSText() const
     result.append(getValueName(autoRepeatID()));
     result.append(", ");
     result.append(CSSValueList::customCSSText());
-    result.append(")");
+    result.append(')');
     return result.toString();
 }
 
index 3d3346c..bd629f9 100644 (file)
@@ -287,11 +287,11 @@ std::unique_ptr<Vector<double>> CSSParser::parseKeyframeKeyList(const String& se
 RefPtr<CSSValue> CSSParser::parseFontFaceDescriptor(CSSPropertyID propertyID, const String& propertyValue, const CSSParserContext& context)
 {
     StringBuilder builder;
-    builder.append("@font-face { ");
+    builder.appendLiteral("@font-face { ");
     builder.append(getPropertyNameString(propertyID));
-    builder.append(" : ");
+    builder.appendLiteral(" : ");
     builder.append(propertyValue);
-    builder.append("; }");
+    builder.appendLiteral("; }");
     RefPtr<StyleRuleBase> rule = parseRule(context, nullptr, builder.toString());
     if (!rule || !rule->isFontFaceRule())
         return nullptr;
index 2e1e64e..d458c16 100644 (file)
@@ -33,7 +33,6 @@
 #include "TextNodeTraversal.h"
 #include "XMLNSNames.h"
 #include <wtf/text/AtomicString.h>
-#include <wtf/text/StringBuilder.h>
 
 namespace WebCore {
 
index 6db1da4..49c7960 100644 (file)
@@ -52,7 +52,6 @@
 #include <runtime/Uint32Array.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/text/CString.h>
-#include <wtf/text/StringBuilder.h>
 
 namespace {
 
index 6283122..8b3ad08 100644 (file)
@@ -32,7 +32,6 @@
 #include <wtf/MathExtras.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/dtoa.h>
-#include <wtf/text/StringBuilder.h>
 
 namespace WebCore {
 
index 3095e96..2d553f8 100644 (file)
@@ -33,7 +33,6 @@
 #include "ParsedContentType.h"
 
 #include <wtf/text/CString.h>
-#include <wtf/text/StringBuilder.h>
 
 namespace WebCore {
 
index 4458fcc..4f99f06 100644 (file)
@@ -26,8 +26,6 @@
 #import "config.h"
 #import "Cookie.h"
 
-#import <wtf/text/StringBuilder.h>
-
 namespace WebCore {
 
 static Vector<uint16_t> portVectorFromList(NSArray<NSNumber *> *portList)
index bda2be1..d155905 100644 (file)
@@ -37,7 +37,6 @@
 #include "LocalizedStrings.h"
 #include <wtf/DateMath.h>
 #include <wtf/RetainPtr.h>
-#include <wtf/text/StringBuilder.h>
 
 #if PLATFORM(IOS)
 #import "LocalizedDateCache.h"
index da4b458..deb16b5 100644 (file)
@@ -938,9 +938,9 @@ String XMLHttpRequest::getAllResponseHeaders() const
         for (auto& header : m_response.httpHeaderFields()) {
             StringBuilder stringBuilder;
             stringBuilder.append(header.key.convertToASCIILowercase());
-            stringBuilder.append(": ");
+            stringBuilder.appendLiteral(": ");
             stringBuilder.append(header.value);
-            stringBuilder.append("\r\n");
+            stringBuilder.appendLiteral("\r\n");
             headers.uncheckedAppend(stringBuilder.toString());
         }
         std::sort(headers.begin(), headers.end(), WTF::codePointCompareLessThan);
index 8bcad39..8204bcb 100644 (file)
@@ -1,3 +1,14 @@
+2017-07-04  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Cleanup some StringBuilder use
+        https://bugs.webkit.org/show_bug.cgi?id=174118
+
+        Reviewed by Andreas Kling.
+
+        * NetworkProcess/capture/NetworkCaptureManager.cpp:
+        (WebKit::NetworkCapture::Manager::hashToPath):
+        * UIProcess/WebPageProxy.cpp:
+
 2017-07-03  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [iOS DnD] [WK2] Callout bar should reappear after dragging ends for a text selection
index 6ed4fb3..9567b8c 100644 (file)
@@ -409,7 +409,7 @@ String Manager::hashToPath(const String& hash)
 
     StringBuilder fileName;
     fileName.append(hashTail);
-    fileName.append(".data");
+    fileName.appendLiteral(".data");
 
     auto path = WebCore::pathByAppendingComponent(m_recordReplayCacheLocation, kDirNameResources);
     path = WebCore::pathByAppendingComponent(path, hashHead);
index d3f670c..44856ab 100644 (file)
 #include <stdio.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/SystemTracing.h>
-#include <wtf/text/StringBuilder.h>
 #include <wtf/text/StringView.h>
 
 #if ENABLE(ASYNC_SCROLLING)