Title: [234278] trunk
Revision
234278
Author
[email protected]
Date
2018-07-26 15:00:03 -0700 (Thu, 26 Jul 2018)

Log Message

String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
https://bugs.webkit.org/show_bug.cgi?id=187963

Reviewed by Alex Christensen.

Source/_javascript_Core:

* inspector/InspectorBackendDispatcher.cpp:
(Inspector::BackendDispatcher::dispatch):
* jsc.cpp:
(ModuleName::ModuleName):
(resolvePath):
* runtime/IntlObject.cpp:
(JSC::canonicalizeLanguageTag):
(JSC::removeUnicodeLocaleExtension):
Update split/splitAllowingEmptyEntries usage.

Source/WebCore:

* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::convert):
* Modules/cache/DOMCache.cpp:
(WebCore::hasResponseVaryStarHeaderValue):
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::queryCacheMatch):
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::filterICECandidate):
(WebCore::PeerConnectionBackend::filterSDP const):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::checkResponseHeaders):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::determineARIADropEffects):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineARIADropEffects):
* accessibility/AccessibilityRenderObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::shouldCancelDefaultAction):
* editing/markup.cpp:
(WebCore::fillContainerFromString):
(WebCore::createFragmentFromText):
* html/EmailInputType.cpp:
(WebCore::EmailInputType::typeMismatchFor const):
(WebCore::EmailInputType::sanitizeValue const):
* html/HTMLInputElement.cpp:
(WebCore::parseAcceptAttribute):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::setMessageDOMAndStartTimer):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::compileShader):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::nodeForPath):
* loader/FormSubmission.cpp:
(WebCore::encodingFromAcceptCharset):
* loader/ResourceTiming.cpp:
(WebCore::passesTimingAllowCheck):
* page/WindowFeatures.cpp:
(WebCore::parseDisabledAdaptations):
(WebCore::parseDialogFeaturesMap):
* platform/URL.cpp:
(WebCore::isIPv4Address):
(WebCore::isIPv6Address):
* platform/graphics/GLContext.cpp:
(WebCore::GLContext::version):
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::patternToFamilies):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::extractGStreamerOptionsFromCommandLine):
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
(WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::fillSelectionData):
* platform/gtk/SelectionData.cpp:
(WebCore::SelectionData::setURIList):
* platform/network/CacheValidation.cpp:
(WebCore::collectVaryingRequestHeaders):
* platform/network/HTTPParsers.cpp:
(WebCore::filenameFromHTTPContentDisposition):
(WebCore::parseXFrameOptionsHeader):
(WebCore::parseAccessControlExposeHeadersAllowList):
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::parseCookieHeader):
* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::loadResponseHeaders):
* platform/network/curl/CurlCacheManager.cpp:
(WebCore::CurlCacheManager::loadIndex):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::setCookiesFromDOM):
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::parseAttribute):
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::appendOS2Table):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::parseBeginOrEnd):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDM::sanitizeResponse const):
(WebCore::MockCDMInstance::updateLicense):
Update split/splitAllowingEmptyEntries usage.

Source/WebDriver:

* WebDriverService.cpp:
(WebDriver::WebDriverService::findCommand):
* glib/WebDriverServiceGLib.cpp:
(WebDriver::parseVersion):
Update split/splitAllowingEmptyEntries usage.

Source/WebKit:

* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::updateVaryInformation):
* NetworkProcess/capture/NetworkCaptureManager.cpp:
(WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::getPluginInfoFromPropertyLists):
(WebKit::PluginVersion::parse):
* Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
(WebKit::NetscapePluginModule::parseMIMEDescription):
* Shared/Plugins/unix/PluginSearchPath.cpp:
(WebKit::pluginsDirectories):
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::initializeSandbox):
* UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::fileCanBeAcceptedForUpload):
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
(WebKit::PluginProcessProxy::scanPlugin):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::isTransparentSilverlightBackgroundValue):
Update split/splitAllowingEmptyEntries usage.

Source/WebKitLegacy/win:

* Plugins/PluginPackageWin.cpp:
(WebCore::PluginPackage::fetchInfo):
Update split/splitAllowingEmptyEntries usage.

Source/WTF:

* wtf/Assertions.cpp:
Update split/splitAllowingEmptyEntries usage.

* wtf/text/StringView.h:
(WTF::StringView::splitAllowingEmptyEntries const):
* wtf/text/WTFString.cpp:
(WTF::String::splitInternal const):
(WTF::String::split const):
(WTF::String::splitAllowingEmptyEntries const):
* wtf/text/WTFString.h:
(WTF::String::split const):
Introduce splitAllowingEmptyEntries instead of boolean or enum parameter.

Tools:

* TestWebKitAPI/Tests/WTF/WTFString.cpp:
Add tests for String::split and String::splitAllowingEmptyEntries.

* TestWebKitAPI/Tests/WTF/StringView.cpp:
* WebKitTestRunner/TestController.cpp:
(WTR::updateTestOptionsFromTestHeader):
Update split/splitAllowingEmptyEntries usage.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (234277 => 234278)


--- trunk/Source/_javascript_Core/ChangeLog	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-07-26 22:00:03 UTC (rev 234278)
@@ -1,3 +1,20 @@
+2018-07-26  Ross Kirsling  <[email protected]>
+
+        String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
+        https://bugs.webkit.org/show_bug.cgi?id=187963
+
+        Reviewed by Alex Christensen.
+
+        * inspector/InspectorBackendDispatcher.cpp:
+        (Inspector::BackendDispatcher::dispatch):
+        * jsc.cpp:
+        (ModuleName::ModuleName):
+        (resolvePath):
+        * runtime/IntlObject.cpp:
+        (JSC::canonicalizeLanguageTag):
+        (JSC::removeUnicodeLocaleExtension):
+        Update split/splitAllowingEmptyEntries usage.
+
 2018-07-26  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r234181 and r234189.

Modified: trunk/Source/_javascript_Core/inspector/InspectorBackendDispatcher.cpp (234277 => 234278)


--- trunk/Source/_javascript_Core/inspector/InspectorBackendDispatcher.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/_javascript_Core/inspector/InspectorBackendDispatcher.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -161,8 +161,7 @@
             return;
         }
 
-        Vector<String> domainAndMethod;
-        methodString.split('.', true, domainAndMethod);
+        Vector<String> domainAndMethod = methodString.splitAllowingEmptyEntries('.');
         if (domainAndMethod.size() != 2 || !domainAndMethod[0].length() || !domainAndMethod[1].length()) {
             reportProtocolError(InvalidRequest, "The 'method' property was formatted incorrectly. It should be 'Domain.method'"_s);
             sendPendingErrors();

Modified: trunk/Source/_javascript_Core/jsc.cpp (234277 => 234278)


--- trunk/Source/_javascript_Core/jsc.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/_javascript_Core/jsc.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -687,7 +687,7 @@
 ModuleName::ModuleName(const String& moduleName)
 {
     // A module name given from code is represented as the UNIX style path. Like, `./A/B.js`.
-    moduleName.split('/', true, queries);
+    queries = moduleName.splitAllowingEmptyEntries('/');
 }
 
 static std::optional<DirectoryName> extractDirectoryName(const String& absolutePathToFile)
@@ -750,8 +750,7 @@
 
 static String resolvePath(const DirectoryName& directoryName, const ModuleName& moduleName)
 {
-    Vector<String> directoryPieces;
-    directoryName.queryName.split(pathSeparator(), false, directoryPieces);
+    Vector<String> directoryPieces = directoryName.queryName.split(pathSeparator());
 
     // Only first '/' is recognized as the path from the root.
     if (moduleName.startsWithRoot())

Modified: trunk/Source/_javascript_Core/runtime/IntlObject.cpp (234277 => 234278)


--- trunk/Source/_javascript_Core/runtime/IntlObject.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/_javascript_Core/runtime/IntlObject.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -484,8 +484,7 @@
     if (!grandfather.isNull())
         return grandfather;
 
-    Vector<String> parts;
-    locale.split('-', true, parts);
+    Vector<String> parts = locale.splitAllowingEmptyEntries('-');
     if (!parts.isEmpty()) {
         String langtag = canonicalLangTag(parts);
         if (!langtag.isNull())
@@ -623,8 +622,7 @@
 
 String removeUnicodeLocaleExtension(const String& locale)
 {
-    Vector<String> parts;
-    locale.split('-', parts);
+    Vector<String> parts = locale.split('-');
     StringBuilder builder;
     size_t partsSize = parts.size();
     bool atPrivate = false;

Modified: trunk/Source/WTF/ChangeLog (234277 => 234278)


--- trunk/Source/WTF/ChangeLog	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WTF/ChangeLog	2018-07-26 22:00:03 UTC (rev 234278)
@@ -1,3 +1,23 @@
+2018-07-26  Ross Kirsling  <[email protected]>
+
+        String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
+        https://bugs.webkit.org/show_bug.cgi?id=187963
+
+        Reviewed by Alex Christensen.
+
+        * wtf/Assertions.cpp:
+        Update split/splitAllowingEmptyEntries usage.
+
+        * wtf/text/StringView.h:
+        (WTF::StringView::splitAllowingEmptyEntries const):
+        * wtf/text/WTFString.cpp:
+        (WTF::String::splitInternal const):
+        (WTF::String::split const):
+        (WTF::String::splitAllowingEmptyEntries const):
+        * wtf/text/WTFString.h:
+        (WTF::String::split const):
+        Introduce splitAllowingEmptyEntries instead of boolean or enum parameter.
+
 2018-07-26  Sam Weinig  <[email protected]>
 
         Remove unused/undefined String::appendInternal

Modified: trunk/Source/WTF/wtf/Assertions.cpp (234277 => 234278)


--- trunk/Source/WTF/wtf/Assertions.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WTF/wtf/Assertions.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -504,13 +504,8 @@
     }
 #endif
 
-    String logLevelString = logLevel;
-    Vector<String> components;
-    logLevelString.split(',', components);
-
-    for (size_t i = 0; i < components.size(); ++i) {
-        Vector<String> componentInfo;
-        components[i].split('=', componentInfo);
+    for (auto& logLevelComponent : String(logLevel).split(',')) {
+        Vector<String> componentInfo = logLevelComponent.split('=');
         String component = componentInfo[0].stripWhiteSpace();
 
         WTFLogChannelState logChannelState = WTFLogChannelOn;

Modified: trunk/Source/WTF/wtf/text/StringView.h (234277 => 234278)


--- trunk/Source/WTF/wtf/text/StringView.h	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WTF/wtf/text/StringView.h	2018-07-26 22:00:03 UTC (rev 234278)
@@ -124,11 +124,9 @@
     template<typename MatchedCharacterPredicate>
     StringView stripLeadingAndTrailingMatchedCharacters(const MatchedCharacterPredicate&);
 
-    enum AllowEmptyEntriesTag { AllowEmptyEntries };
-
     class SplitResult;
     SplitResult split(UChar) const;
-    SplitResult split(UChar, AllowEmptyEntriesTag) const;
+    SplitResult splitAllowingEmptyEntries(UChar) const;
 
     size_t find(UChar, unsigned start = 0) const;
     size_t find(CodeUnitMatchFunction, unsigned start = 0) const;
@@ -905,7 +903,7 @@
     return SplitResult { *this, separator, false };
 }
 
-inline auto StringView::split(UChar separator, AllowEmptyEntriesTag) const -> SplitResult
+inline auto StringView::splitAllowingEmptyEntries(UChar separator) const -> SplitResult
 {
     return SplitResult { *this, separator, true };
 }

Modified: trunk/Source/WTF/wtf/text/WTFString.cpp (234277 => 234278)


--- trunk/Source/WTF/wtf/text/WTFString.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WTF/wtf/text/WTFString.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -705,9 +705,10 @@
     return isEmpty() || (m_impl->hasOneRef() && !m_impl->isAtomic());
 }
 
-void String::split(const String& separator, bool allowEmptyEntries, Vector<String>& result) const
+template<bool allowEmptyEntries>
+inline Vector<String> String::splitInternal(const String& separator) const
 {
-    result.clear();
+    Vector<String> result;
 
     unsigned startPos = 0;
     size_t endPos;
@@ -718,9 +719,12 @@
     }
     if (allowEmptyEntries || startPos != length())
         result.append(substring(startPos));
+
+    return result;
 }
 
-void String::split(UChar separator, bool allowEmptyEntries, const SplitFunctor& functor) const
+template<bool allowEmptyEntries>
+inline void String::splitInternal(UChar separator, const SplitFunctor& functor) const
 {
     StringView view(*this);
 
@@ -735,14 +739,47 @@
         functor(view.substring(startPos));
 }
 
-void String::split(UChar separator, bool allowEmptyEntries, Vector<String>& result) const
+template<bool allowEmptyEntries>
+inline Vector<String> String::splitInternal(UChar separator) const
 {
-    result.clear();
-    split(separator, allowEmptyEntries, [&result](StringView item) {
+    Vector<String> result;
+    splitInternal<allowEmptyEntries>(separator, [&result](StringView item) {
         result.append(item.toString());
     });
+
+    return result;
 }
 
+void String::split(UChar separator, const SplitFunctor& functor) const
+{
+    splitInternal<false>(separator, functor);
+}
+
+Vector<String> String::split(UChar separator) const
+{
+    return splitInternal<false>(separator);
+}
+
+Vector<String> String::split(const String& separator) const
+{
+    return splitInternal<false>(separator);
+}
+
+void String::splitAllowingEmptyEntries(UChar separator, const SplitFunctor& functor) const
+{
+    splitInternal<true>(separator, functor);
+}
+
+Vector<String> String::splitAllowingEmptyEntries(UChar separator) const
+{
+    return splitInternal<true>(separator);
+}
+
+Vector<String> String::splitAllowingEmptyEntries(const String& separator) const
+{
+    return splitInternal<true>(separator);
+}
+
 CString String::ascii() const
 {
     // Printable ASCII characters 32..127 and the null character are

Modified: trunk/Source/WTF/wtf/text/WTFString.h (234277 => 234278)


--- trunk/Source/WTF/wtf/text/WTFString.h	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WTF/wtf/text/WTFString.h	2018-07-26 22:00:03 UTC (rev 234278)
@@ -270,16 +270,16 @@
     static String createUninitialized(unsigned length, UChar*& data) { return StringImpl::createUninitialized(length, data); }
     static String createUninitialized(unsigned length, LChar*& data) { return StringImpl::createUninitialized(length, data); }
 
-    WTF_EXPORT_PRIVATE void split(const String& separator, bool allowEmptyEntries, Vector<String>& result) const;
-    void split(const String& separator, Vector<String>& result) const { split(separator, false, result); }
-
     using SplitFunctor = WTF::Function<void(const StringView&)>;
-    WTF_EXPORT_PRIVATE void split(UChar separator, bool allowEmptyEntries, const SplitFunctor&) const;
-    WTF_EXPORT_PRIVATE void split(UChar separator, bool allowEmptyEntries, Vector<String>& result) const;
-    void split(UChar separator, Vector<String>& result) const { split(separator, false, result); }
-    Vector<String> split(UChar separator) const;
-    Vector<String> split(const String& separator) const;
 
+    WTF_EXPORT_PRIVATE void split(UChar separator, const SplitFunctor&) const;
+    WTF_EXPORT_PRIVATE Vector<String> split(UChar separator) const;
+    WTF_EXPORT_PRIVATE Vector<String> split(const String& separator) const;
+
+    WTF_EXPORT_PRIVATE void splitAllowingEmptyEntries(UChar separator, const SplitFunctor&) const;
+    WTF_EXPORT_PRIVATE Vector<String> splitAllowingEmptyEntries(UChar separator) const;
+    WTF_EXPORT_PRIVATE Vector<String> splitAllowingEmptyEntries(const String& separator) const;
+
     WTF_EXPORT_PRIVATE int toIntStrict(bool* ok = nullptr, int base = 10) const;
     WTF_EXPORT_PRIVATE unsigned toUIntStrict(bool* ok = nullptr, int base = 10) const;
     WTF_EXPORT_PRIVATE int64_t toInt64Strict(bool* ok = nullptr, int base = 10) const;
@@ -369,6 +369,10 @@
 private:
     template<typename CharacterType> void removeInternal(const CharacterType*, unsigned, unsigned);
 
+    template<bool allowEmptyEntries> void splitInternal(UChar separator, const SplitFunctor&) const;
+    template<bool allowEmptyEntries> Vector<String> splitInternal(UChar separator) const;
+    template<bool allowEmptyEntries> Vector<String> splitInternal(const String& separator) const;
+
     RefPtr<StringImpl> m_impl;
 };
 
@@ -531,20 +535,6 @@
     return *this;
 }
 
-inline Vector<String> String::split(UChar separator) const
-{
-    Vector<String> result;
-    split(separator, false, result);
-    return result;
-}
-
-inline Vector<String> String::split(const String& separator) const
-{
-    Vector<String> result;
-    split(separator, false, result);
-    return result;
-}
-
 template<size_t inlineCapacity> inline String String::make8BitFrom16BitSource(const Vector<UChar, inlineCapacity>& buffer)
 {
     return make8BitFrom16BitSource(buffer.data(), buffer.size());

Modified: trunk/Source/WebCore/ChangeLog (234277 => 234278)


--- trunk/Source/WebCore/ChangeLog	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/ChangeLog	2018-07-26 22:00:03 UTC (rev 234278)
@@ -1,3 +1,92 @@
+2018-07-26  Ross Kirsling  <[email protected]>
+
+        String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
+        https://bugs.webkit.org/show_bug.cgi?id=187963
+
+        Reviewed by Alex Christensen.
+
+        * Modules/applepay/cocoa/PaymentContactCocoa.mm:
+        (WebCore::convert):
+        * Modules/cache/DOMCache.cpp:
+        (WebCore::hasResponseVaryStarHeaderValue):
+        * Modules/cache/DOMCacheEngine.cpp:
+        (WebCore::DOMCacheEngine::queryCacheMatch):
+        * Modules/mediastream/PeerConnectionBackend.cpp:
+        (WebCore::filterICECandidate):
+        (WebCore::PeerConnectionBackend::filterSDP const):
+        * Modules/websockets/WebSocketHandshake.cpp:
+        (WebCore::WebSocketHandshake::checkResponseHeaders):
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::determineARIADropEffects):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::determineARIADropEffects):
+        * accessibility/AccessibilityRenderObject.h:
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+        * editing/cocoa/DataDetection.mm:
+        (WebCore::DataDetection::shouldCancelDefaultAction):
+        * editing/markup.cpp:
+        (WebCore::fillContainerFromString):
+        (WebCore::createFragmentFromText):
+        * html/EmailInputType.cpp:
+        (WebCore::EmailInputType::typeMismatchFor const):
+        (WebCore::EmailInputType::sanitizeValue const):
+        * html/HTMLInputElement.cpp:
+        (WebCore::parseAcceptAttribute):
+        * html/ValidationMessage.cpp:
+        (WebCore::ValidationMessage::setMessageDOMAndStartTimer):
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::compileShader):
+        * inspector/agents/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::nodeForPath):
+        * loader/FormSubmission.cpp:
+        (WebCore::encodingFromAcceptCharset):
+        * loader/ResourceTiming.cpp:
+        (WebCore::passesTimingAllowCheck):
+        * page/WindowFeatures.cpp:
+        (WebCore::parseDisabledAdaptations):
+        (WebCore::parseDialogFeaturesMap):
+        * platform/URL.cpp:
+        (WebCore::isIPv4Address):
+        (WebCore::isIPv6Address):
+        * platform/graphics/GLContext.cpp:
+        (WebCore::GLContext::version):
+        * platform/graphics/freetype/FontCacheFreeType.cpp:
+        (WebCore::patternToFamilies):
+        * platform/graphics/gstreamer/GStreamerCommon.cpp:
+        (WebCore::extractGStreamerOptionsFromCommandLine):
+        * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
+        (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
+        (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
+        * platform/gtk/PasteboardHelper.cpp:
+        (WebCore::PasteboardHelper::fillSelectionData):
+        * platform/gtk/SelectionData.cpp:
+        (WebCore::SelectionData::setURIList):
+        * platform/network/CacheValidation.cpp:
+        (WebCore::collectVaryingRequestHeaders):
+        * platform/network/HTTPParsers.cpp:
+        (WebCore::filenameFromHTTPContentDisposition):
+        (WebCore::parseXFrameOptionsHeader):
+        (WebCore::parseAccessControlExposeHeadersAllowList):
+        * platform/network/curl/CookieUtil.cpp:
+        (WebCore::CookieUtil::parseCookieHeader):
+        * platform/network/curl/CurlCacheEntry.cpp:
+        (WebCore::CurlCacheEntry::loadResponseHeaders):
+        * platform/network/curl/CurlCacheManager.cpp:
+        (WebCore::CurlCacheManager::loadIndex):
+        * platform/network/soup/CookieJarSoup.cpp:
+        (WebCore::setCookiesFromDOM):
+        * svg/SVGAnimationElement.cpp:
+        (WebCore::SVGAnimationElement::parseAttribute):
+        * svg/SVGToOTFFontConversion.cpp:
+        (WebCore::SVGToOTFFontConverter::appendOS2Table):
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::SVGSMILElement::parseBeginOrEnd):
+        * testing/MockCDMFactory.cpp:
+        (WebCore::MockCDM::sanitizeResponse const):
+        (WebCore::MockCDMInstance::updateLicense):
+        Update split/splitAllowingEmptyEntries usage.
+
 2018-07-26  Nan Wang  <[email protected]>
 
         AX: nothing returned for various previous text marker APIs from one div/p node to another

Modified: trunk/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm (234277 => 234278)


--- trunk/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm	2018-07-26 22:00:03 UTC (rev 234278)
@@ -202,8 +202,7 @@
 
     CNPostalAddress *postalAddress = contact.postalAddress;
     if (postalAddress.street.length) {
-        Vector<String> addressLines;
-        String(postalAddress.street).split("\n", addressLines);
+        Vector<String> addressLines = String(postalAddress.street).split('\n');
         result.addressLines = WTFMove(addressLines);
     }
     result.subLocality = subLocality(postalAddress);

Modified: trunk/Source/WebCore/Modules/cache/DOMCache.cpp (234277 => 234278)


--- trunk/Source/WebCore/Modules/cache/DOMCache.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/Modules/cache/DOMCache.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -145,7 +145,7 @@
 {
     auto varyValue = response.headers().internalHeaders().get(WebCore::HTTPHeaderName::Vary);
     bool hasStar = false;
-    varyValue.split(',', false, [&](StringView view) {
+    varyValue.split(',', [&](StringView view) {
         if (!hasStar && stripLeadingAndTrailingHTTPSpaces(view) == "*")
             hasStar = true;
     });

Modified: trunk/Source/WebCore/Modules/cache/DOMCacheEngine.cpp (234277 => 234278)


--- trunk/Source/WebCore/Modules/cache/DOMCacheEngine.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/Modules/cache/DOMCacheEngine.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -88,7 +88,7 @@
         return true;
 
     bool isVarying = false;
-    varyValue.split(',', false, [&](StringView view) {
+    varyValue.split(',', [&](StringView view) {
         if (isVarying)
             return;
         auto nameView = stripLeadingAndTrailingHTTPSpaces(view);

Modified: trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp (234277 => 234278)


--- trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -382,7 +382,7 @@
     bool skipNextItem = false;
     bool isFirst = true;
     StringBuilder filteredSDP;
-    sdp.split(' ', false, [&](StringView item) {
+    sdp.split(' ', [&](StringView item) {
         if (skipNextItem) {
             skipNextItem = false;
             return;
@@ -412,7 +412,7 @@
         return WTFMove(sdp);
 
     StringBuilder filteredSDP;
-    sdp.split('\n', false, [&filteredSDP](StringView line) {
+    sdp.split('\n', [&filteredSDP](StringView line) {
         if (!line.startsWith("a=candidate"))
             filteredSDP.append(line);
         else if (line.find(" host ", 11) == notFound)

Modified: trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp (234277 => 234278)


--- trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -605,8 +605,7 @@
             m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-Protocol mismatch"_s;
             return false;
         }
-        Vector<String> result;
-        m_clientProtocol.split(WebSocket::subprotocolSeparator(), result);
+        Vector<String> result = m_clientProtocol.split(WebSocket::subprotocolSeparator());
         if (!result.contains(serverWebSocketProtocol)) {
             m_failureReason = "Error during WebSocket handshake: Sec-WebSocket-Protocol mismatch"_s;
             return false;

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (234277 => 234278)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.h	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h	2018-07-26 22:00:03 UTC (rev 234278)
@@ -731,7 +731,7 @@
     virtual bool supportsARIADragging() const { return false; }
     virtual bool isARIAGrabbed() { return false; }
     virtual void setARIAGrabbed(bool) { }
-    virtual void determineARIADropEffects(Vector<String>&) { }
+    virtual Vector<String> determineARIADropEffects() { return { }; }
     
     // Called on the root AX object to return the deepest available element.
     virtual AccessibilityObject* accessibilityHitTest(const IntPoint&) const { return nullptr; }

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (234277 => 234278)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -1029,17 +1029,16 @@
     return elementAttributeValue(aria_grabbedAttr);
 }
 
-void AccessibilityRenderObject::determineARIADropEffects(Vector<String>& effects)
+Vector<String> AccessibilityRenderObject::determineARIADropEffects()
 {
     const AtomicString& dropEffects = getAttribute(aria_dropeffectAttr);
     if (dropEffects.isEmpty()) {
-        effects.clear();
-        return;
+        return { };
     }
     
     String dropEffectsString = dropEffects.string();
     dropEffectsString.replace('\n', ' ');
-    dropEffectsString.split(' ', effects);
+    return dropEffectsString.split(' ');
 }
     
 bool AccessibilityRenderObject::exposesTitleUIElement() const

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h (234277 => 234278)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h	2018-07-26 22:00:03 UTC (rev 234278)
@@ -176,7 +176,7 @@
     bool supportsARIADropping() const override;
     bool supportsARIADragging() const override;
     bool isARIAGrabbed() override;
-    void determineARIADropEffects(Vector<String>&) override;
+    Vector<String> determineARIADropEffects() override;
     
     VisiblePosition visiblePositionForPoint(const IntPoint&) const override;
     VisiblePosition visiblePositionForIndex(unsigned indexValue, bool lastIndexOK) const override;

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (234277 => 234278)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2018-07-26 22:00:03 UTC (rev 234278)
@@ -3093,8 +3093,7 @@
         return [NSNumber numberWithBool:m_object->isARIAGrabbed()];
     
     if ([attributeName isEqualToString:NSAccessibilityDropEffectsAttribute]) {
-        Vector<String> dropEffects;
-        m_object->determineARIADropEffects(dropEffects);
+        Vector<String> dropEffects = m_object->determineARIADropEffects();
         return convertStringsToNSArray(dropEffects);
     }
     

Modified: trunk/Source/WebCore/editing/cocoa/DataDetection.mm (234277 => 234278)


--- trunk/Source/WebCore/editing/cocoa/DataDetection.mm	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/editing/cocoa/DataDetection.mm	2018-07-26 22:00:03 UTC (rev 234278)
@@ -202,8 +202,7 @@
     NSArray *results = element.document().frame()->dataDetectionResults();
     if (!results)
         return false;
-    Vector<String> resultIndices;
-    resultAttribute.string().split('/', resultIndices);
+    Vector<String> resultIndices = resultAttribute.string().split('/');
     DDResultRef result = [[results objectAtIndex:resultIndices[0].toInt()] coreResult];
     // Handle the case of a signature block, where we need to check the correct subresult.
     for (size_t i = 1; i < resultIndices.size(); i++) {

Modified: trunk/Source/WebCore/editing/markup.cpp (234277 => 234278)


--- trunk/Source/WebCore/editing/markup.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/editing/markup.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -933,8 +933,7 @@
 
     ASSERT(string.find('\n') == notFound);
 
-    Vector<String> tabList;
-    string.split('\t', true, tabList);
+    Vector<String> tabList = string.splitAllowingEmptyEntries('\t');
     String tabText = emptyString();
     bool first = true;
     size_t numEntries = tabList.size();
@@ -1034,8 +1033,7 @@
         && block != editableRootForPosition(context.startPosition());
     bool useLineBreak = enclosingTextFormControl(context.startPosition());
 
-    Vector<String> list;
-    string.split('\n', true, list); // true gets us empty strings in the list
+    Vector<String> list = string.splitAllowingEmptyEntries('\n');
     size_t numLines = list.size();
     for (size_t i = 0; i < numLines; ++i) {
         const String& s = list[i];

Modified: trunk/Source/WebCore/html/EmailInputType.cpp (234277 => 234278)


--- trunk/Source/WebCore/html/EmailInputType.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/html/EmailInputType.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -64,9 +64,7 @@
         return false;
     if (!element()->multiple())
         return !isValidEmailAddress(value);
-    Vector<String> addresses;
-    value.split(',', true, addresses);
-    for (auto& address : addresses) {
+    for (auto& address : value.splitAllowingEmptyEntries(',')) {
         if (!isValidEmailAddress(stripLeadingAndTrailingHTMLSpaces(address)))
             return true;
     }
@@ -101,8 +99,7 @@
     ASSERT(element());
     if (!element()->multiple())
         return stripLeadingAndTrailingHTMLSpaces(noLineBreakValue);
-    Vector<String> addresses;
-    noLineBreakValue.split(',', true, addresses);
+    Vector<String> addresses = noLineBreakValue.splitAllowingEmptyEntries(',');
     StringBuilder strippedValue;
     for (unsigned i = 0; i < addresses.size(); ++i) {
         if (i > 0)

Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (234277 => 234278)


--- trunk/Source/WebCore/html/HTMLInputElement.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -1278,9 +1278,7 @@
     if (acceptString.isEmpty())
         return types;
 
-    Vector<String> splitTypes;
-    acceptString.split(',', false, splitTypes);
-    for (auto& splitType : splitTypes) {
+    for (auto& splitType : acceptString.split(',')) {
         String trimmedType = stripLeadingAndTrailingHTMLSpaces(splitType);
         if (trimmedType.isEmpty())
             continue;

Modified: trunk/Source/WebCore/html/ValidationMessage.cpp (234277 => 234278)


--- trunk/Source/WebCore/html/ValidationMessage.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/html/ValidationMessage.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -127,8 +127,7 @@
     ASSERT(m_messageBody);
     m_messageHeading->removeChildren();
     m_messageBody->removeChildren();
-    Vector<String> lines;
-    m_message.split('\n', lines);
+    Vector<String> lines = m_message.split('\n');
     Document& document = m_messageHeading->document();
     for (unsigned i = 0; i < lines.size(); ++i) {
         if (i) {

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (234277 => 234278)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -1536,9 +1536,7 @@
     if (canvas && m_synthesizedErrorsToConsole && !value) {
         Ref<Inspector::ScriptCallStack> stackTrace = Inspector::createScriptCallStack(JSMainThreadExecState::currentState());
 
-        Vector<String> errors;
-        getShaderInfoLog(shader).split("\n", errors);
-        for (String& error : errors)
+        for (auto& error : getShaderInfoLog(shader).split('\n'))
             canvas->document().addConsoleMessage(std::make_unique<Inspector::ConsoleMessage>(MessageSource::Rendering, MessageType::Log, MessageLevel::Error, "WebGL: " + error, stackTrace.copyRef()));
     }
 }

Modified: trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp (234277 => 234278)


--- trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -2295,8 +2295,7 @@
         return nullptr;
 
     Node* node = m_document.get();
-    Vector<String> pathTokens;
-    path.split(',', false, pathTokens);
+    Vector<String> pathTokens = path.split(',');
     if (!pathTokens.size())
         return nullptr;
 

Modified: trunk/Source/WebCore/loader/FormSubmission.cpp (234277 => 234278)


--- trunk/Source/WebCore/loader/FormSubmission.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/loader/FormSubmission.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -133,10 +133,7 @@
     String normalizedAcceptCharset = acceptCharset;
     normalizedAcceptCharset.replace(',', ' ');
 
-    Vector<String> charsets;
-    normalizedAcceptCharset.split(' ', charsets);
-
-    for (auto& charset : charsets) {
+    for (auto& charset : normalizedAcceptCharset.split(' ')) {
         TextEncoding encoding(charset);
         if (encoding.isValid())
             return encoding;

Modified: trunk/Source/WebCore/loader/ResourceTiming.cpp (234277 => 234278)


--- trunk/Source/WebCore/loader/ResourceTiming.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/loader/ResourceTiming.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -47,9 +47,7 @@
         return true;
 
     const String& securityOrigin = initiatorSecurityOrigin.toString();
-    Vector<String> timingAllowOrigins;
-    timingAllowOriginString.split(',', timingAllowOrigins);
-    for (auto& origin : timingAllowOrigins) {
+    for (auto& origin : timingAllowOriginString.split(',')) {
         if (origin.stripWhiteSpace() == securityOrigin)
             return true;
     }

Modified: trunk/Source/WebCore/page/WindowFeatures.cpp (234277 => 234278)


--- trunk/Source/WebCore/page/WindowFeatures.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/page/WindowFeatures.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -117,9 +117,7 @@
 OptionSet<DisabledAdaptations> parseDisabledAdaptations(const String& disabledAdaptationsString)
 {
     OptionSet<DisabledAdaptations> disabledAdaptations;
-    Vector<String> disabledAdaptationNames;
-    disabledAdaptationsString.split(',', false, disabledAdaptationNames);
-    for (auto& name : disabledAdaptationNames) {
+    for (auto& name : disabledAdaptationsString.split(',')) {
         auto normalizedName = name.stripWhiteSpace().convertToASCIILowercase();
         if (normalizedName == watchAdaptationName())
             disabledAdaptations |= DisabledAdaptations::Watch;
@@ -248,10 +246,7 @@
 
     DialogFeaturesMap features;
 
-    Vector<String> vector;
-    string.split(';', vector);
-
-    for (auto& featureString : vector) {
+    for (auto& featureString : string.split(';')) {
         size_t separatorPosition = featureString.find('=');
         size_t colonPosition = featureString.find(':');
         if (separatorPosition != notFound && colonPosition != notFound)

Modified: trunk/Source/WebCore/platform/URL.cpp (234277 => 234278)


--- trunk/Source/WebCore/platform/URL.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/platform/URL.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -1066,7 +1066,7 @@
 {
     auto count = 0;
 
-    for (const auto octet : string.split('.', StringView::AllowEmptyEntries)) {
+    for (const auto octet : string.splitAllowingEmptyEntries('.')) {
         if (count >= 4)
             return false;
 
@@ -1100,7 +1100,7 @@
     auto skipState = None;
     auto count = 0;
 
-    for (const auto hextet : string.split(':', StringView::AllowEmptyEntries)) {
+    for (const auto hextet : string.splitAllowingEmptyEntries(':')) {
         if (count >= 8 || skipState == Final)
             return false;
 

Modified: trunk/Source/WebCore/platform/graphics/GLContext.cpp (234277 => 234278)


--- trunk/Source/WebCore/platform/graphics/GLContext.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/platform/graphics/GLContext.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -173,8 +173,7 @@
         // Version string can start with the version number (all versions except GLES 1 and 2) or with
         // "OpenGL". Different fields inside the version string are separated by spaces.
         String versionString = String(reinterpret_cast<const char*>(::glGetString(GL_VERSION)));
-        Vector<String> versionStringComponents;
-        versionString.split(' ', versionStringComponents);
+        Vector<String> versionStringComponents = versionString.split(' ');
 
         Vector<String> versionDigits;
         if (versionStringComponents[0] == "OpenGL") {
@@ -181,11 +180,11 @@
             // If the version string starts with "OpenGL" it can be GLES 1 or 2. In GLES1 version string starts
             // with "OpenGL ES-<profile> major.minor" and in GLES2 with "OpenGL ES major.minor". Version is the
             // third component in both cases.
-            versionStringComponents[2].split('.', versionDigits);
+            versionDigits = versionStringComponents[2].split('.');
         } else {
             // Version is the first component. The version number is always "major.minor" or
             // "major.minor.release". Ignore the release number.
-            versionStringComponents[0].split('.', versionDigits);
+            versionDigits = versionStringComponents[0].split('.');
         }
 
         m_version = versionDigits[0].toUInt() * 100 + versionDigits[1].toUInt() * 10;

Modified: trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp (234277 => 234278)


--- trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -115,9 +115,7 @@
     String patternString = String::fromUTF8(patternChars);
     free(patternChars);
 
-    Vector<String> results;
-    patternString.split(',', results);
-    return results;
+    return patternString.split(',');
 }
 
 Vector<String> FontCache::systemFontFamilies()

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp (234277 => 234278)


--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -246,7 +246,7 @@
 
     Vector<String> options;
     auto optionsString = String::fromUTF8(contents.get(), length);
-    optionsString.split('\0', false, [&options](StringView item) {
+    optionsString.split('\0', [&options](StringView item) {
         if (item.startsWith("--gst"))
             options.append(item.toString());
     });

Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp (234277 => 234278)


--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -78,8 +78,7 @@
     m_vendor = String(reinterpret_cast<const char*>(::glGetString(GL_VENDOR)));
     m_renderer = String(reinterpret_cast<const char*>(::glGetString(GL_RENDERER)));
 
-    Vector<String> vendorComponents;
-    m_vendor.convertToASCIILowercase().split(' ', vendorComponents);
+    Vector<String> vendorComponents = m_vendor.convertToASCIILowercase().split(' ');
     if (vendorComponents.contains("nvidia"))
         m_isNVIDIA = true;
     if (vendorComponents.contains("ati") || vendorComponents.contains("amd"))
@@ -235,10 +234,8 @@
 #endif
     {
         String extensionsString = getExtensions();
-        Vector<String> availableExtensions;
-        extensionsString.split(' ', availableExtensions);
-        for (size_t i = 0; i < availableExtensions.size(); ++i)
-            m_availableExtensions.add(availableExtensions[i]);
+        for (auto& extension : extensionsString.split(' '))
+            m_availableExtensions.add(extension);
     }
     m_initializedAvailableExtensions = true;
 }

Modified: trunk/Source/WebCore/platform/gtk/PasteboardHelper.cpp (234277 => 234278)


--- trunk/Source/WebCore/platform/gtk/PasteboardHelper.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/platform/gtk/PasteboardHelper.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -225,8 +225,7 @@
         selection.setURIList(selectionDataToUTF8String(data));
     } else if (target == netscapeURLAtom) {
         String urlWithLabel(selectionDataToUTF8String(data));
-        Vector<String> pieces;
-        urlWithLabel.split('\n', pieces);
+        Vector<String> pieces = urlWithLabel.split('\n');
 
         // Give preference to text/uri-list here, as it can hold more
         // than one URI but still take  the label if there is one.

Modified: trunk/Source/WebCore/platform/gtk/SelectionData.cpp (234277 => 234278)


--- trunk/Source/WebCore/platform/gtk/SelectionData.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/platform/gtk/SelectionData.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -47,8 +47,6 @@
 
     // Line separator is \r\n per RFC 2483 - however, for compatibility
     // reasons we also allow just \n here.
-    Vector<String> uriList;
-    uriListString.split('\n', uriList);
 
     // Process the input and copy the first valid URL into the url member.
     // In case no URLs can be found, subsequent calls to getData("URL")
@@ -56,8 +54,7 @@
     // "The DragEvent and DataTransfer interfaces"). Also extract all filenames
     // from the URI list.
     bool setURL = false;
-    for (size_t i = 0; i < uriList.size(); ++i) {
-        String& line = uriList[i];
+    for (auto& line : uriListString.split('\n')) {
         line = line.stripWhiteSpace();
         if (line.isEmpty())
             continue;

Modified: trunk/Source/WebCore/platform/network/CacheValidation.cpp (234277 => 234278)


--- trunk/Source/WebCore/platform/network/CacheValidation.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/platform/network/CacheValidation.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -350,8 +350,7 @@
     String varyValue = response.httpHeaderField(WebCore::HTTPHeaderName::Vary);
     if (varyValue.isEmpty())
         return { };
-    Vector<String> varyingHeaderNames;
-    varyValue.split(',', varyingHeaderNames);
+    Vector<String> varyingHeaderNames = varyValue.split(',');
     Vector<std::pair<String, String>> varyingRequestHeaders;
     varyingRequestHeaders.reserveCapacity(varyingHeaderNames.size());
     for (auto& varyHeaderName : varyingHeaderNames) {

Modified: trunk/Source/WebCore/platform/network/HTTPParsers.cpp (234277 => 234278)


--- trunk/Source/WebCore/platform/network/HTTPParsers.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/platform/network/HTTPParsers.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -277,21 +277,17 @@
 // in a case-sensitive manner. (There are likely other bugs as well.)
 String filenameFromHTTPContentDisposition(const String& value)
 {
-    Vector<String> keyValuePairs;
-    value.split(';', keyValuePairs);
-
-    unsigned length = keyValuePairs.size();
-    for (unsigned i = 0; i < length; i++) {
-        size_t valueStartPos = keyValuePairs[i].find('=');
+    for (auto& keyValuePair : value.split(';')) {
+        size_t valueStartPos = keyValuePair.find('=');
         if (valueStartPos == notFound)
             continue;
 
-        String key = keyValuePairs[i].left(valueStartPos).stripWhiteSpace();
+        String key = keyValuePair.left(valueStartPos).stripWhiteSpace();
 
         if (key.isEmpty() || key != "filename")
             continue;
         
-        String value = keyValuePairs[i].substring(valueStartPos + 1).stripWhiteSpace();
+        String value = keyValuePair.substring(valueStartPos + 1).stripWhiteSpace();
 
         // Remove quotes if there are any
         if (value[0] == '\"')
@@ -507,11 +503,8 @@
     if (header.isEmpty())
         return result;
 
-    Vector<String> headers;
-    header.split(',', headers);
-
-    for (size_t i = 0; i < headers.size(); i++) {
-        String currentHeader = headers[i].stripWhiteSpace();
+    for (auto& currentHeader : header.split(',')) {
+        currentHeader = currentHeader.stripWhiteSpace();
         XFrameOptionsDisposition currentValue = XFrameOptionsNone;
         if (equalLettersIgnoringASCIICase(currentHeader, "deny"))
             currentValue = XFrameOptionsDeny;
@@ -777,9 +770,7 @@
 
 void parseAccessControlExposeHeadersAllowList(const String& headerValue, HTTPHeaderSet& headerSet)
 {
-    Vector<String> headers;
-    headerValue.split(',', false, headers);
-    for (auto& header : headers) {
+    for (auto& header : headerValue.split(',')) {
         String strippedHeader = header.stripWhiteSpace();
         if (!strippedHeader.isEmpty())
             headerSet.add(strippedHeader);

Modified: trunk/Source/WebCore/platform/network/curl/CookieUtil.cpp (234277 => 234278)


--- trunk/Source/WebCore/platform/network/curl/CookieUtil.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/platform/network/curl/CookieUtil.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -171,9 +171,7 @@
     bool hasMaxAge = false;
     result.session = true;
 
-    Vector<String> cookieAttributes;
-    cookieLine.split(';', true, cookieAttributes);
-    for (auto attribute : cookieAttributes)
+    for (auto attribute : cookieLine.splitAllowingEmptyEntries(';'))
         parseCookieAttributes(attribute, domain, hasMaxAge, result);
 
     return true;

Modified: trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp (234277 => 234278)


--- trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -155,8 +155,7 @@
         return false;
 
     String headerContent = String(buffer.data(), buffer.size());
-    Vector<String> headerFields;
-    headerContent.split('\n', headerFields);
+    Vector<String> headerFields = headerContent.split('\n');
 
     Vector<String>::const_iterator it = headerFields.begin();
     Vector<String>::const_iterator end = headerFields.end();

Modified: trunk/Source/WebCore/platform/network/curl/CurlCacheManager.cpp (234277 => 234278)


--- trunk/Source/WebCore/platform/network/curl/CurlCacheManager.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/platform/network/curl/CurlCacheManager.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -131,8 +131,7 @@
 
     // Create strings from buffer
     String headerContent = String(buffer.data(), buffer.size());
-    Vector<String> indexURLs;
-    headerContent.split('\n', indexURLs);
+    Vector<String> indexURLs = headerContent.split('\n');
     buffer.clear();
 
     // Add entries to index

Modified: trunk/Source/WebCore/platform/network/soup/CookieJarSoup.cpp (234277 => 234278)


--- trunk/Source/WebCore/platform/network/soup/CookieJarSoup.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/platform/network/soup/CookieJarSoup.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -67,11 +67,8 @@
     SoupCookieJar* jar = session.cookieStorage();
     GSList* existingCookies = soup_cookie_jar_get_cookie_list(jar, origin.get(), TRUE);
 
-    Vector<String> cookies;
-    value.split('\n', cookies);
-    const size_t cookiesCount = cookies.size();
-    for (size_t i = 0; i < cookiesCount; ++i) {
-        GUniquePtr<SoupCookie> cookie(soup_cookie_parse(cookies[i].utf8().data(), origin.get()));
+    for (auto& cookieString : value.split('\n')) {
+        GUniquePtr<SoupCookie> cookie(soup_cookie_parse(cookieString.utf8().data(), origin.get()));
         if (!cookie)
             continue;
 

Modified: trunk/Source/WebCore/svg/SVGAnimationElement.cpp (234277 => 234278)


--- trunk/Source/WebCore/svg/SVGAnimationElement.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/svg/SVGAnimationElement.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -166,7 +166,7 @@
         // Per the SMIL specification, leading and trailing white space,
         // and white space before and after semicolon separators, is allowed and will be ignored.
         // http://www.w3.org/TR/SVG11/animate.html#ValuesAttribute
-        value.string().split(';', m_values);
+        m_values = value.string().split(';');
         for (auto& value : m_values)
             value = value.stripWhiteSpace();
 

Modified: trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp (234277 => 234278)


--- trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -519,8 +519,7 @@
     const unsigned panoseSize = 10;
     char panoseBytes[panoseSize];
     if (m_fontFaceElement) {
-        Vector<String> segments;
-        m_fontFaceElement->attributeWithoutSynchronization(SVGNames::panose_1Attr).string().split(' ', segments);
+        Vector<String> segments = m_fontFaceElement->attributeWithoutSynchronization(SVGNames::panose_1Attr).string().split(' ');
         if (segments.size() == panoseSize) {
             for (auto& segment : segments) {
                 bool ok;

Modified: trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp (234277 => 234278)


--- trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -446,9 +446,7 @@
     HashSet<double> existing;
     for (auto& time : timeList)
         existing.add(time.time().value());
-    Vector<String> splitString;
-    parseString.split(';', splitString);
-    for (auto& string : splitString) {
+    for (auto& string : parseString.split(';')) {
         SMILTime value = parseClockValue(string);
         if (value.isUnresolved())
             parseCondition(string, beginOrEnd);

Modified: trunk/Source/WebCore/testing/MockCDMFactory.cpp (234277 => 234278)


--- trunk/Source/WebCore/testing/MockCDMFactory.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebCore/testing/MockCDMFactory.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -198,8 +198,7 @@
     if (!charactersAreAllASCII(reinterpret_cast<const LChar*>(response.data()), response.size()))
         return nullptr;
 
-    Vector<String> responseArray;
-    String(response.data(), response.size()).split(" "_s, responseArray);
+    Vector<String> responseArray = String(response.data(), response.size()).split(' ');
 
     if (!responseArray.contains(String("valid-response"_s)))
         return nullptr;
@@ -304,8 +303,7 @@
         return;
     }
 
-    Vector<String> responseVector;
-    String(response.data(), response.size()).split(" "_s, responseVector);
+    Vector<String> responseVector = String(response.data(), response.size()).split(' ');
 
     if (responseVector.contains(String("invalid-format"_s))) {
         callback(false, std::nullopt, std::nullopt, std::nullopt, SuccessValue::Failed);

Modified: trunk/Source/WebDriver/ChangeLog (234277 => 234278)


--- trunk/Source/WebDriver/ChangeLog	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebDriver/ChangeLog	2018-07-26 22:00:03 UTC (rev 234278)
@@ -1,3 +1,16 @@
+2018-07-26  Ross Kirsling  <[email protected]>
+
+        String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
+        https://bugs.webkit.org/show_bug.cgi?id=187963
+
+        Reviewed by Alex Christensen.
+
+        * WebDriverService.cpp:
+        (WebDriver::WebDriverService::findCommand):
+        * glib/WebDriverServiceGLib.cpp:
+        (WebDriver::parseVersion):
+        Update split/splitAllowingEmptyEntries usage.
+
 2018-07-05  Carlos Garcia Campos  <[email protected]>
 
         [GTK][WPE] Add --host option to WebDriver process

Modified: trunk/Source/WebDriver/WebDriverService.cpp (234277 => 234278)


--- trunk/Source/WebDriver/WebDriverService.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebDriver/WebDriverService.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -197,10 +197,8 @@
         if (s_commands[i].method != method)
             continue;
 
-        Vector<String> pathTokens;
-        path.split("/", pathTokens);
-        Vector<String> commandTokens;
-        String::fromUTF8(s_commands[i].uriTemplate).split("/", commandTokens);
+        Vector<String> pathTokens = path.split('/');
+        Vector<String> commandTokens = String::fromUTF8(s_commands[i].uriTemplate).split('/');
         if (pathTokens.size() != commandTokens.size())
             continue;
 

Modified: trunk/Source/WebDriver/glib/WebDriverServiceGLib.cpp (234277 => 234278)


--- trunk/Source/WebDriver/glib/WebDriverServiceGLib.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebDriver/glib/WebDriverServiceGLib.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -32,8 +32,7 @@
 {
     major = minor = micro = 0;
 
-    Vector<String> tokens;
-    version.split(".", false, tokens);
+    Vector<String> tokens = version.split('.');
     bool ok;
     switch (tokens.size()) {
     case 3:

Modified: trunk/Source/WebKit/ChangeLog (234277 => 234278)


--- trunk/Source/WebKit/ChangeLog	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebKit/ChangeLog	2018-07-26 22:00:03 UTC (rev 234278)
@@ -1,3 +1,36 @@
+2018-07-26  Ross Kirsling  <[email protected]>
+
+        String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
+        https://bugs.webkit.org/show_bug.cgi?id=187963
+
+        Reviewed by Alex Christensen.
+
+        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
+        (WebKit::CacheStorage::updateVaryInformation):
+        * NetworkProcess/capture/NetworkCaptureManager.cpp:
+        (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
+        * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
+        (WebKit::getPluginInfoFromPropertyLists):
+        (WebKit::PluginVersion::parse):
+        * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
+        (WebKit::NetscapePluginModule::parseMIMEDescription):
+        * Shared/Plugins/unix/PluginSearchPath.cpp:
+        (WebKit::pluginsDirectories):
+        * Shared/mac/ChildProcessMac.mm:
+        (WebKit::ChildProcess::initializeSandbox):
+        * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
+        * UIProcess/Automation/WebAutomationSession.cpp:
+        (WebKit::fileCanBeAcceptedForUpload):
+        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
+        (WebKit::ProcessLauncher::launchProcess):
+        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+        (WebKit::ProcessLauncher::launchProcess):
+        * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
+        (WebKit::PluginProcessProxy::scanPlugin):
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::isTransparentSilverlightBackgroundValue):
+        Update split/splitAllowingEmptyEntries usage.
+
 2018-07-26  Alex Christensen  <[email protected]>
 
         Fix assertions introduced in r234210

Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp (234277 => 234278)


--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -85,7 +85,7 @@
         return;
     }
 
-    varyValue.split(',', false, [&](StringView view) {
+    varyValue.split(',', [&](StringView view) {
         if (!recordInformation.hasVaryStar && stripLeadingAndTrailingHTTPSpaces(view) == "*")
             recordInformation.hasVaryStar = true;
         String headerName = view.toString();

Modified: trunk/Source/WebKit/NetworkProcess/capture/NetworkCaptureManager.cpp (234277 => 234278)


--- trunk/Source/WebKit/NetworkProcess/capture/NetworkCaptureManager.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebKit/NetworkProcess/capture/NetworkCaptureManager.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -216,9 +216,8 @@
     const auto& requestPath = requestURL.path();
     const auto& resourcePath = resourceURL.path();
 
-    Vector<String> requestPathComponents, resourcePathComponents;
-    requestPath.split('/', requestPathComponents);
-    resourcePath.split('/', resourcePathComponents);
+    Vector<String> requestPathComponents = requestPath.split('/');
+    Vector<String> resourcePathComponents = resourcePath.split('/');
 
     auto updatedIterators = std::mismatch(
         std::begin(requestPathComponents), std::end(requestPathComponents),

Modified: trunk/Source/WebKit/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm (234277 => 234278)


--- trunk/Source/WebKit/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebKit/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm	2018-07-26 22:00:03 UTC (rev 234278)
@@ -149,8 +149,7 @@
             // The DivX plug-in lists multiple extensions in a comma separated string instead of using
             // multiple array elements in the property list. Work around this here by splitting the
             // extension string into components.
-            Vector<String> extensionComponents;
-            String(extension).convertToASCIILowercase().split(',', extensionComponents);
+            Vector<String> extensionComponents = String(extension).convertToASCIILowercase().split(',');
 
             for (auto& component : extensionComponents)
                 mimeClassInfo.extensions.append(component);
@@ -237,8 +236,7 @@
 {
     PluginVersion version;
 
-    Vector<String> versionStringComponents;
-    versionString.split('.', versionStringComponents);
+    Vector<String> versionStringComponents = versionString.split('.');
     for (size_t i = 0; i < versionStringComponents.size(); ++i) {
         bool successfullyParsed = false;
         unsigned versionComponent = versionStringComponents[i].toUInt(&successfullyParsed);

Modified: trunk/Source/WebKit/Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp (234277 => 234278)


--- trunk/Source/WebKit/Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebKit/Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -74,14 +74,12 @@
 {
     ASSERT_ARG(result, result.isEmpty());
 
-    Vector<String> types;
-    mimeDescription.convertToASCIILowercase().split(UChar(';'), false, types);
+    Vector<String> types = mimeDescription.convertToASCIILowercase().split(';');
     result.reserveInitialCapacity(types.size());
 
     size_t mimeInfoCount = 0;
     for (size_t i = 0; i < types.size(); ++i) {
-        Vector<String> mimeTypeParts;
-        types[i].split(UChar(':'), true, mimeTypeParts);
+        Vector<String> mimeTypeParts = types[i].splitAllowingEmptyEntries(':');
         if (mimeTypeParts.size() <= 0)
             continue;
 
@@ -90,7 +88,7 @@
         mimeInfo.type = mimeTypeParts[0];
 
         if (mimeTypeParts.size() > 1)
-            mimeTypeParts[1].split(UChar(','), false, mimeInfo.extensions);
+            mimeInfo.extensions = mimeTypeParts[1].split(',');
 
         if (mimeTypeParts.size() > 2)
             mimeInfo.desc = mimeTypeParts[2];

Modified: trunk/Source/WebKit/Shared/Plugins/unix/PluginSearchPath.cpp (234277 => 234278)


--- trunk/Source/WebKit/Shared/Plugins/unix/PluginSearchPath.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebKit/Shared/Plugins/unix/PluginSearchPath.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -38,8 +38,7 @@
 #if ENABLE(NETSCAPE_PLUGIN_API)
     String mozillaPaths(getenv("MOZ_PLUGIN_PATH"));
     if (!mozillaPaths.isEmpty()) {
-        Vector<String> paths;
-        mozillaPaths.split(UChar(':'), /* allowEmptyEntries */ false, paths);
+        Vector<String> paths = mozillaPaths.split(':');
         result.appendVector(paths);
     }
 

Modified: trunk/Source/WebKit/Shared/mac/ChildProcessMac.mm (234277 => 234278)


--- trunk/Source/WebKit/Shared/mac/ChildProcessMac.mm	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebKit/Shared/mac/ChildProcessMac.mm	2018-07-26 22:00:03 UTC (rev 234278)
@@ -134,9 +134,8 @@
         }
     }
 
-    Vector<String> osVersionParts;
     String osSystemMarketingVersion = systemMarketingVersion();
-    osSystemMarketingVersion.split('.', false, osVersionParts);
+    Vector<String> osVersionParts = osSystemMarketingVersion.split('.');
     if (osVersionParts.size() < 2) {
         WTFLogAlways("%s: Couldn't find OS Version\n", getprogname());
         exit(EX_NOPERM);

Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp (234277 => 234278)


--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -44,8 +44,7 @@
     void didPostMessage(WebPageProxy& page, const FrameInfoData&, WebCore::SerializedScriptValue& serializedScriptValue) override
     {
         String message = serializedScriptValue.toString();
-        Vector<String> tokens;
-        message.split(":", tokens);
+        Vector<String> tokens = message.split(':');
         if (tokens.size() != 2)
             return;
 

Modified: trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp (234277 => 234278)


--- trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -806,8 +806,7 @@
         return true;
 
     // Fall back to checking for a MIME type wildcard if an exact match is not found.
-    Vector<String> components;
-    mappedMIMEType.split('/', false, components);
+    Vector<String> components = mappedMIMEType.split('/');
     if (components.size() != 2)
         return false;
 

Modified: trunk/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp (234277 => 234278)


--- trunk/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -114,9 +114,7 @@
 #if ENABLE(DEVELOPER_MODE)
     Vector<CString> prefixArgs;
     if (!m_launchOptions.processCmdPrefix.isNull()) {
-        Vector<String> splitArgs;
-        m_launchOptions.processCmdPrefix.split(' ', splitArgs);
-        for (auto& arg : splitArgs)
+        for (auto& arg : m_launchOptions.processCmdPrefix.split(' '))
             prefixArgs.append(arg.utf8());
         nargs += prefixArgs.size();
     }

Modified: trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm (234277 => 234278)


--- trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2018-07-26 22:00:03 UTC (rev 234278)
@@ -128,9 +128,7 @@
     auto languagesIterator = m_launchOptions.extraInitializationData.find("OverrideLanguages");
     if (languagesIterator != m_launchOptions.extraInitializationData.end()) {
         auto languages = adoptOSObject(xpc_array_create(nullptr, 0));
-        Vector<String> languageVector;
-        languagesIterator->value.split(",", false, languageVector);
-        for (auto& language : languageVector)
+        for (auto& language : languagesIterator->value.split(','))
             xpc_array_set_string(languages.get(), XPC_ARRAY_APPEND, language.utf8().data());
         xpc_dictionary_set_value(initializationMessage.get(), "OverrideLanguages", languages.get());
     }

Modified: trunk/Source/WebKit/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp (234277 => 234278)


--- trunk/Source/WebKit/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebKit/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -137,8 +137,7 @@
         return false;
     }
 
-    Vector<String> lines;
-    String::fromUTF8(stdOut.get()).split(UChar('\n'), true, lines);
+    Vector<String> lines = String::fromUTF8(stdOut.get()).splitAllowingEmptyEntries('\n');
 
     if (lines.size() < 3) {
         WTFLogAlways("Error scanning plugin %s, too few lines of output provided", argv[2]);

Modified: trunk/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp (234277 => 234278)


--- trunk/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -601,8 +601,7 @@
             return true;
         }
     } else if (lowercaseBackgroundValue.startsWith("sc#")) {
-        Vector<String> components;
-        lowercaseBackgroundValue.substring(3).split(',', components);
+        Vector<String> components = lowercaseBackgroundValue.substring(3).split(',');
 
         // An ScRGB value with alpha transparency, in the form sc#A,R,G,B.
         if (components.size() == 4) {

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (234277 => 234278)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2018-07-26 22:00:03 UTC (rev 234278)
@@ -1,3 +1,14 @@
+2018-07-26  Ross Kirsling  <[email protected]>
+
+        String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
+        https://bugs.webkit.org/show_bug.cgi?id=187963
+
+        Reviewed by Alex Christensen.
+
+        * Plugins/PluginPackageWin.cpp:
+        (WebCore::PluginPackage::fetchInfo):
+        Update split/splitAllowingEmptyEntries usage.
+
 2018-07-18  Antoine Quint  <[email protected]>
 
         [Web Animations] Interpolation between font-styles with a keyword value should be discrete

Modified: trunk/Source/WebKitLegacy/win/Plugins/PluginPackageWin.cpp (234277 => 234278)


--- trunk/Source/WebKitLegacy/win/Plugins/PluginPackageWin.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Source/WebKitLegacy/win/Plugins/PluginPackageWin.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -190,12 +190,9 @@
     if (isPluginBlacklisted())
         return false;
 
-    Vector<String> types;
-    getVersionInfo(versionInfoData.data(), "MIMEType").split('|', types);
-    Vector<String> extensionLists;
-    getVersionInfo(versionInfoData.data(), "FileExtents").split('|', extensionLists);
-    Vector<String> descriptions;
-    getVersionInfo(versionInfoData.data(), "FileOpenName").split('|', descriptions);
+    Vector<String> types = getVersionInfo(versionInfoData.data(), "MIMEType").split('|');
+    Vector<String> extensionLists = getVersionInfo(versionInfoData.data(), "FileExtents").split('|');
+    Vector<String> descriptions = getVersionInfo(versionInfoData.data(), "FileOpenName").split('|');
 
     for (unsigned i = 0; i < types.size(); i++) {
         String type = types[i].convertToASCIILowercase();
@@ -202,8 +199,7 @@
         String description = i < descriptions.size() ? descriptions[i] : "";
         String extensionList = i < extensionLists.size() ? extensionLists[i] : "";
 
-        Vector<String> extensionsVector;
-        extensionList.split(',', extensionsVector);
+        Vector<String> extensionsVector = extensionList.split(',');
 
         // Get rid of the extension list that may be at the end of the description string.
         int pos = description.find("(*");

Modified: trunk/Tools/ChangeLog (234277 => 234278)


--- trunk/Tools/ChangeLog	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Tools/ChangeLog	2018-07-26 22:00:03 UTC (rev 234278)
@@ -1,3 +1,18 @@
+2018-07-26  Ross Kirsling  <[email protected]>
+
+        String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
+        https://bugs.webkit.org/show_bug.cgi?id=187963
+
+        Reviewed by Alex Christensen.
+
+        * TestWebKitAPI/Tests/WTF/WTFString.cpp:
+        Add tests for String::split and String::splitAllowingEmptyEntries.
+
+        * TestWebKitAPI/Tests/WTF/StringView.cpp:
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::updateTestOptionsFromTestHeader):
+        Update split/splitAllowingEmptyEntries usage.
+
 2018-07-26  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r234181 and r234189.

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/StringView.cpp (234277 => 234278)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/StringView.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/StringView.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -297,7 +297,7 @@
     for (size_t i = 0; i < actual.size(); ++i)
         EXPECT_STREQ(expected[i].utf8().data(), actual[i].utf8().data()) << "Vectors differ at index " << i;
 
-    actual = vectorFromSplitResult(a.split(' ', StringView::AllowEmptyEntries));
+    actual = vectorFromSplitResult(a.splitAllowingEmptyEntries(' '));
     expected = { "", "This", "", "", "", "", "is", "", "a", "", "", "", "", "", "", "sentence.", "" };
     ASSERT_EQ(expected.size(), actual.size());
     for (size_t i = 0; i < actual.size(); ++i)

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp (234277 => 234278)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -499,4 +499,21 @@
     testWithFormatAndArguments("hello -17890.5 world", "%s %.1f %s", "hello", -17890.5, "world");
 }
 
+TEST(WTF, StringSplitWithConsecutiveSeparators)
+{
+    String string { " This     is  a       sentence. " };
+
+    Vector<String> actual = string.split(' ');
+    Vector<String> expected { "This", "is", "a", "sentence." };
+    ASSERT_EQ(expected.size(), actual.size());
+    for (auto i = 0u; i < actual.size(); ++i)
+        EXPECT_STREQ(expected[i].utf8().data(), actual[i].utf8().data()) << "Vectors differ at index " << i;
+
+    actual = string.splitAllowingEmptyEntries(' ');
+    expected = { "", "This", "", "", "", "", "is", "", "a", "", "", "", "", "", "", "sentence.", "" };
+    ASSERT_EQ(expected.size(), actual.size());
+    for (auto i = 0u; i < actual.size(); ++i)
+        EXPECT_STREQ(expected[i].utf8().data(), actual[i].utf8().data()) << "Vectors differ at index " << i;
+}
+
 } // namespace TestWebKitAPI

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (234277 => 234278)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2018-07-26 21:50:02 UTC (rev 234277)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2018-07-26 22:00:03 UTC (rev 234278)
@@ -1088,7 +1088,7 @@
         auto key = pairString.substr(pairStart, equalsLocation - pairStart);
         auto value = pairString.substr(equalsLocation + 1, pairEnd - (equalsLocation + 1));
         if (key == "language")
-            String(value.c_str()).split(",", false, testOptions.overrideLanguages);
+            testOptions.overrideLanguages = String(value.c_str()).split(',');
         else if (key == "useThreadedScrolling")
             testOptions.useThreadedScrolling = parseBooleanTestHeaderValue(value);
         else if (key == "useAcceleratedDrawing")
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to