WebKit Bugzilla
Attachment 345832 Details for
Bug 187963
: String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-187963-20180725234505.patch (text/plain), 74.26 KB, created by
Ross Kirsling
on 2018-07-25 23:45:06 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Ross Kirsling
Created:
2018-07-25 23:45:06 PDT
Size:
74.26 KB
patch
obsolete
>Subversion Revision: 234226 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 5ea0082297f8986aa07438cd69c3da66a3f0527e..66965891a742c10cbc58c82fd0eac60711b54702 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-07-25 Ross Kirsling <ross.kirsling@sony.com> >+ >+ String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter >+ https://bugs.webkit.org/show_bug.cgi?id=187963 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/InspectorBackendDispatcher.cpp: >+ (Inspector::BackendDispatcher::dispatch): >+ * jsc.cpp: >+ (ModuleName::ModuleName): >+ (resolvePath): >+ * runtime/IntlObject.cpp: >+ (JSC::canonicalizeLanguageTag): >+ (JSC::removeUnicodeLocaleExtension): >+ Update split/splitAllowingEmptyEntries usage. >+ > 2018-07-25 Andy VanWagoner <andy@vanwagoner.family> > > [INTL] Call Typed Array elements toLocaleString with locale and options >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 52ada99d91168683a2742f4ead1d1df42aaa74d3..60dd43b7ba71c8d138f5a034fdd3d65490b19b10 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,23 @@ >+2018-07-25 Ross Kirsling <ross.kirsling@sony.com> >+ >+ String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter >+ https://bugs.webkit.org/show_bug.cgi?id=187963 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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-25 Tomas Popela <tpopela@redhat.com> > > Correctly close the variable argument list >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e16c2a630fba747f0f52ebd07183f6e7cca57d3f..9d117a14232944b543a8c3bc43eeb7595e83fdad 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,92 @@ >+2018-07-25 Ross Kirsling <ross.kirsling@sony.com> >+ >+ String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter >+ https://bugs.webkit.org/show_bug.cgi?id=187963 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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-25 Chris Dumez <cdumez@apple.com> > > Allow ActiveDOMObject's canSuspend / suspend / resume overrides to destroy ActiveDOMObjects >diff --git a/Source/WebDriver/ChangeLog b/Source/WebDriver/ChangeLog >index fa28db2ad4e808238415a277393950bdfea15596..604e7446c6dbcc469e63c63d13086a47c27420a3 100644 >--- a/Source/WebDriver/ChangeLog >+++ b/Source/WebDriver/ChangeLog >@@ -1,3 +1,16 @@ >+2018-07-25 Ross Kirsling <ross.kirsling@sony.com> >+ >+ String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter >+ https://bugs.webkit.org/show_bug.cgi?id=187963 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebDriverService.cpp: >+ (WebDriver::WebDriverService::findCommand): >+ * glib/WebDriverServiceGLib.cpp: >+ (WebDriver::parseVersion): >+ Update split/splitAllowingEmptyEntries usage. >+ > 2018-07-05 Carlos Garcia Campos <cgarcia@igalia.com> > > [GTK][WPE] Add --host option to WebDriver process >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index a7252eee19ddc7797b3329ecbf95d0aaaedea73c..011c15a5cfac9515afc45b0dbf5457ca35abee14 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,36 @@ >+2018-07-25 Ross Kirsling <ross.kirsling@sony.com> >+ >+ String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter >+ https://bugs.webkit.org/show_bug.cgi?id=187963 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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-25 Brent Fulgham <bfulgham@apple.com> > > [macOS] Update sandboxes for revised OpenCL calls and streaming media >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index 49e1ef5064664d66a0d3b203f3a84a5fcb61e322..146604cfb75847f31f3ff339e8878f3069746860 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,14 @@ >+2018-07-25 Ross Kirsling <ross.kirsling@sony.com> >+ >+ String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter >+ https://bugs.webkit.org/show_bug.cgi?id=187963 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Plugins/PluginPackageWin.cpp: >+ (WebCore::PluginPackage::fetchInfo): >+ Update split/splitAllowingEmptyEntries usage. >+ > 2018-07-18 Antoine Quint <graouts@apple.com> > > [Web Animations] Interpolation between font-styles with a keyword value should be discrete >diff --git a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp >index 99ec27a03f8dd048117392b72c668dbb5ebcfe9b..aa4eb4e3d9ebff006c4874457b53d60de416020a 100644 >--- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp >+++ b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp >@@ -161,8 +161,7 @@ void BackendDispatcher::dispatch(const String& message) > 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(); >diff --git a/Source/JavaScriptCore/jsc.cpp b/Source/JavaScriptCore/jsc.cpp >index da2e71c0a96f8c8e3ede34ef66253ffc4b4c3eb8..c49baacdd469bd61e574981fc9d41d8fe47dc90b 100644 >--- a/Source/JavaScriptCore/jsc.cpp >+++ b/Source/JavaScriptCore/jsc.cpp >@@ -687,7 +687,7 @@ struct ModuleName { > 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 std::optional<DirectoryName> currentWorkingDirectory() > > 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()) >diff --git a/Source/JavaScriptCore/runtime/IntlObject.cpp b/Source/JavaScriptCore/runtime/IntlObject.cpp >index 170f8dd68f37ee8230f8e9a6bf704c6f88bb19b5..b1ecd938209daf7eb8006f2e730496bba8b8ecbf 100644 >--- a/Source/JavaScriptCore/runtime/IntlObject.cpp >+++ b/Source/JavaScriptCore/runtime/IntlObject.cpp >@@ -474,8 +474,7 @@ static String canonicalizeLanguageTag(const String& locale) > 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()) >@@ -608,8 +607,7 @@ String defaultLocale(ExecState& state) > > 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; >diff --git a/Source/WTF/wtf/Assertions.cpp b/Source/WTF/wtf/Assertions.cpp >index 13b7093150ee6551e46deda7ae265feed700d38b..9700e05fa6f9362baa9635621617e09344657fe8 100644 >--- a/Source/WTF/wtf/Assertions.cpp >+++ b/Source/WTF/wtf/Assertions.cpp >@@ -504,13 +504,8 @@ void WTFInitializeLogChannelStatesFromString(WTFLogChannel* channels[], size_t c > } > #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; >diff --git a/Source/WTF/wtf/text/StringView.h b/Source/WTF/wtf/text/StringView.h >index 02ed753729922a72e5c168b3c04ac57d74d9474b..c6c68832ee5231561c259eac4b50203c3689eb01 100644 >--- a/Source/WTF/wtf/text/StringView.h >+++ b/Source/WTF/wtf/text/StringView.h >@@ -124,11 +124,9 @@ public: > 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 @@ inline auto StringView::split(UChar separator) const -> SplitResult > 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 }; > } >diff --git a/Source/WTF/wtf/text/WTFString.cpp b/Source/WTF/wtf/text/WTFString.cpp >index 57bf1f8d06acd98ef62b80b1697042f4dde6bc03..1781133df13c858541eed5d0ef324cb590e3dab3 100644 >--- a/Source/WTF/wtf/text/WTFString.cpp >+++ b/Source/WTF/wtf/text/WTFString.cpp >@@ -705,9 +705,10 @@ bool String::isSafeToSendToAnotherThread() const > 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 @@ void String::split(const String& separator, bool allowEmptyEntries, Vector<Strin > } > 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,12 +739,45 @@ void String::split(UChar separator, bool allowEmptyEntries, const SplitFunctor& > 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 >diff --git a/Source/WTF/wtf/text/WTFString.h b/Source/WTF/wtf/text/WTFString.h >index 43545f2c2f7b3e6158da89b92ddce7a065f47891..e79f15ec8b6ebd976ef4364146e6754ab40d2d7f 100644 >--- a/Source/WTF/wtf/text/WTFString.h >+++ b/Source/WTF/wtf/text/WTFString.h >@@ -270,15 +270,15 @@ public: > 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; >@@ -370,6 +370,10 @@ private: > template<typename CharacterType> void removeInternal(const CharacterType*, unsigned, unsigned); > template<typename CharacterType> void appendInternal(CharacterType); > >+ 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; > }; > >@@ -532,20 +536,6 @@ template<unsigned characterCount> ALWAYS_INLINE String& String::replaceWithLiter > 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()); >diff --git a/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm b/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm >index 3be621050f98c5ad5ef877703b3c819dd66ac26f..bbaa4ef4fecc0ae7f3aa35bb00bb62205d717c87 100644 >--- a/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm >+++ b/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm >@@ -202,8 +202,7 @@ static ApplePayPaymentContact convert(unsigned version, PKContact *contact) > > 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); >diff --git a/Source/WebCore/Modules/cache/DOMCache.cpp b/Source/WebCore/Modules/cache/DOMCache.cpp >index 23135c1a186111deeddaf5f4c5b329037fd5ea48..38d5a6608bd5f4d48888126f9b58f202d970213e 100644 >--- a/Source/WebCore/Modules/cache/DOMCache.cpp >+++ b/Source/WebCore/Modules/cache/DOMCache.cpp >@@ -145,7 +145,7 @@ static inline bool hasResponseVaryStarHeaderValue(const FetchResponse& response) > { > 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; > }); >diff --git a/Source/WebCore/Modules/cache/DOMCacheEngine.cpp b/Source/WebCore/Modules/cache/DOMCacheEngine.cpp >index 49128c64e98731148e3512eb916950fcd38f4f07..1bfbda74c67376f17eaec2145c8b8b67917bdf36 100644 >--- a/Source/WebCore/Modules/cache/DOMCacheEngine.cpp >+++ b/Source/WebCore/Modules/cache/DOMCacheEngine.cpp >@@ -88,7 +88,7 @@ bool queryCacheMatch(const ResourceRequest& request, const ResourceRequest& cach > return true; > > bool isVarying = false; >- varyValue.split(',', false, [&](StringView view) { >+ varyValue.split(',', [&](StringView view) { > if (isVarying) > return; > auto nameView = stripLeadingAndTrailingHTTPSpaces(view); >diff --git a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp >index 213daf08a2001fd6e9bef6e75d77fe148b72d7f7..f5e99313d828c718c5f593b9bbd19f0a039a0120 100644 >--- a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp >+++ b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp >@@ -382,7 +382,7 @@ static String filterICECandidate(String&& sdp) > 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 @@ String PeerConnectionBackend::filterSDP(String&& sdp) const > 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) >diff --git a/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp b/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp >index 2701adb9699c3facddb3e5c60fa54eddcdce41b2..7427bb557075eda88fbd66121e7d90a3f19cdd34 100644 >--- a/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp >+++ b/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp >@@ -605,8 +605,7 @@ bool WebSocketHandshake::checkResponseHeaders() > 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; >diff --git a/Source/WebCore/accessibility/AccessibilityObject.h b/Source/WebCore/accessibility/AccessibilityObject.h >index 47d5da7ede03f1b65501730f9a63501207c7813f..39335075f68c5d931ab96bbed9cb565990e13e96 100644 >--- a/Source/WebCore/accessibility/AccessibilityObject.h >+++ b/Source/WebCore/accessibility/AccessibilityObject.h >@@ -731,7 +731,7 @@ public: > 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; } >diff --git a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp >index aed3ec9536e49c0de33aa204c398bd3b8494c7a7..730cbb5c642d6e3dfd2c5c22e1f2992cd8ea874b 100644 >--- a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp >+++ b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp >@@ -1029,17 +1029,16 @@ bool AccessibilityRenderObject::isARIAGrabbed() > 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 >diff --git a/Source/WebCore/accessibility/AccessibilityRenderObject.h b/Source/WebCore/accessibility/AccessibilityRenderObject.h >index 48af65ad0d14d9886de83b4e6b354e165f6ca32e..003f183277dce7758eb5985de54b8ecbca2071ba 100644 >--- a/Source/WebCore/accessibility/AccessibilityRenderObject.h >+++ b/Source/WebCore/accessibility/AccessibilityRenderObject.h >@@ -176,7 +176,7 @@ public: > 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; >diff --git a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm >index e3369372002690bd83b36a18723290b5c739b47f..241141c0bc03a8a71c7f1166832f96066bf538b1 100644 >--- a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm >+++ b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm >@@ -3093,8 +3093,7 @@ - (id)accessibilityAttributeValue:(NSString*)attributeName > 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); > } > >diff --git a/Source/WebCore/editing/cocoa/DataDetection.mm b/Source/WebCore/editing/cocoa/DataDetection.mm >index b4f53f975bb7eee695e424614ee601d45127051e..5bcc3a8ea47651788286873ec769f06697a9067b 100644 >--- a/Source/WebCore/editing/cocoa/DataDetection.mm >+++ b/Source/WebCore/editing/cocoa/DataDetection.mm >@@ -202,8 +202,7 @@ bool DataDetection::shouldCancelDefaultAction(Element& element) > 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++) { >diff --git a/Source/WebCore/editing/markup.cpp b/Source/WebCore/editing/markup.cpp >index 0e183fd117f71cc6978a0aaa376dc53f06147cc6..d1ec58976e632e9b732a9f0923bd67120480b725 100644 >--- a/Source/WebCore/editing/markup.cpp >+++ b/Source/WebCore/editing/markup.cpp >@@ -933,8 +933,7 @@ static void fillContainerFromString(ContainerNode& paragraph, const String& stri > > 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 @@ Ref<DocumentFragment> createFragmentFromText(Range& context, const String& text) > && 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]; >diff --git a/Source/WebCore/html/EmailInputType.cpp b/Source/WebCore/html/EmailInputType.cpp >index 0a843395a0d69cec7368025acca7a7a0ad3107d0..42553693988b93dd1b5903f321181df9921293ae 100644 >--- a/Source/WebCore/html/EmailInputType.cpp >+++ b/Source/WebCore/html/EmailInputType.cpp >@@ -64,9 +64,7 @@ bool EmailInputType::typeMismatchFor(const String& value) const > 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 @@ String EmailInputType::sanitizeValue(const String& proposedValue) const > 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) >diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp >index 8e584d985509290bbcb72e82607f9c30e813fd8d..b1ff12d96a59fdb4d13d01144245a32c8113cebb 100644 >--- a/Source/WebCore/html/HTMLInputElement.cpp >+++ b/Source/WebCore/html/HTMLInputElement.cpp >@@ -1278,9 +1278,7 @@ static Vector<String> parseAcceptAttribute(const String& acceptString, bool (*pr > 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; >diff --git a/Source/WebCore/html/ValidationMessage.cpp b/Source/WebCore/html/ValidationMessage.cpp >index 470eaedc3a76686d5c401a0537e807fa38f505e4..4cc00bc1624142e1b414db2db27e8be079c187d1 100644 >--- a/Source/WebCore/html/ValidationMessage.cpp >+++ b/Source/WebCore/html/ValidationMessage.cpp >@@ -127,8 +127,7 @@ void ValidationMessage::setMessageDOMAndStartTimer() > 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) { >diff --git a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >index d559428818ffc1ee9f2bc19dc7673ee6ab12bf04..19181e44c1335c8e28baaa3f089b71bfd24eee3f 100644 >--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >+++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >@@ -1536,9 +1536,7 @@ void WebGLRenderingContextBase::compileShader(WebGLShader* shader) > 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())); > } > } >diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp >index 472298bf34bd192c138e2c18a5ad06e41464b0e3..9869b63871aa14d097a49ebf7e06c955715d39f1 100644 >--- a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp >@@ -2295,8 +2295,7 @@ Node* InspectorDOMAgent::nodeForPath(const String& path) > return nullptr; > > Node* node = m_document.get(); >- Vector<String> pathTokens; >- path.split(',', false, pathTokens); >+ Vector<String> pathTokens = path.split(','); > if (!pathTokens.size()) > return nullptr; > >diff --git a/Source/WebCore/loader/FormSubmission.cpp b/Source/WebCore/loader/FormSubmission.cpp >index fe427876159a1c780e00e13d524cd771b90433a7..336dcc1914179a601f93a98c527b43cf21bc8317 100644 >--- a/Source/WebCore/loader/FormSubmission.cpp >+++ b/Source/WebCore/loader/FormSubmission.cpp >@@ -133,10 +133,7 @@ static TextEncoding encodingFromAcceptCharset(const String& acceptCharset, Docum > 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; >diff --git a/Source/WebCore/loader/ResourceTiming.cpp b/Source/WebCore/loader/ResourceTiming.cpp >index dcc47b361dddf8758993fd54ee407e12c12b7194..a6ab6802761c7256ea9a08677323936acdb4271c 100644 >--- a/Source/WebCore/loader/ResourceTiming.cpp >+++ b/Source/WebCore/loader/ResourceTiming.cpp >@@ -47,9 +47,7 @@ static bool passesTimingAllowCheck(const ResourceResponse& response, const Secur > 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; > } >diff --git a/Source/WebCore/page/WindowFeatures.cpp b/Source/WebCore/page/WindowFeatures.cpp >index c3fc993fd225b8c67f6df9140ee70c6592a91093..cf90107b4fc0dc868682de4d4cad519e98c976c5 100644 >--- a/Source/WebCore/page/WindowFeatures.cpp >+++ b/Source/WebCore/page/WindowFeatures.cpp >@@ -117,9 +117,7 @@ void processFeaturesString(StringView features, FeatureMode mode, const WTF::Fun > 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 @@ static DialogFeaturesMap parseDialogFeaturesMap(const String& string) > > 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) >diff --git a/Source/WebCore/platform/URL.cpp b/Source/WebCore/platform/URL.cpp >index c99de10f5e47254e743d36ee96a0378934e6f25f..e90849713fc9dcf9b197d6a17a926d8c1261a241 100644 >--- a/Source/WebCore/platform/URL.cpp >+++ b/Source/WebCore/platform/URL.cpp >@@ -1066,7 +1066,7 @@ static bool isIPv4Address(StringView string) > { > 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 @@ static bool isIPv6Address(StringView string) > 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; > >diff --git a/Source/WebCore/platform/graphics/GLContext.cpp b/Source/WebCore/platform/graphics/GLContext.cpp >index 28d9b3bddac9b4b213187f02a1ea3027df2b0bc3..f6d30db58e52bd97b7077521714a601a1263f510 100644 >--- a/Source/WebCore/platform/graphics/GLContext.cpp >+++ b/Source/WebCore/platform/graphics/GLContext.cpp >@@ -173,19 +173,18 @@ unsigned GLContext::version() > // 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") { > // 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; >diff --git a/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp b/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp >index e975cc69e6f97ff262d5fcdf33d5f6a6748029b6..eea2d17f146515567cd83abbd98bf15f8bdddc10 100644 >--- a/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp >+++ b/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp >@@ -115,9 +115,7 @@ static Vector<String> patternToFamilies(FcPattern& pattern) > String patternString = String::fromUTF8(patternChars); > free(patternChars); > >- Vector<String> results; >- patternString.split(',', results); >- return results; >+ return patternString.split(','); > } > > Vector<String> FontCache::systemFontFamilies() >diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp >index f668e7733b151f2781ea6c893bbbdccce642242d..62353e4f3e6847f9f0ced35de246b051a82dd963 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp >@@ -246,7 +246,7 @@ Vector<String> extractGStreamerOptionsFromCommandLine() > > 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()); > }); >diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp >index 74ac4dc172f131970e3e7b83e3ec453635c0c0ca..d3f00e600be55a663af3beafc4803760867f6122 100644 >--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp >+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp >@@ -78,8 +78,7 @@ Extensions3DOpenGLCommon::Extensions3DOpenGLCommon(GraphicsContext3D* context, b > 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 @@ void Extensions3DOpenGLCommon::initializeAvailableExtensions() > #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; > } >diff --git a/Source/WebCore/platform/gtk/PasteboardHelper.cpp b/Source/WebCore/platform/gtk/PasteboardHelper.cpp >index 1cdcd51b4fdfe554628d581231724723954698b2..c15ad061cb1d5c11ab3f9cd573b4f0a6131fe815 100644 >--- a/Source/WebCore/platform/gtk/PasteboardHelper.cpp >+++ b/Source/WebCore/platform/gtk/PasteboardHelper.cpp >@@ -225,8 +225,7 @@ void PasteboardHelper::fillSelectionData(GtkSelectionData* data, unsigned /* inf > 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. >diff --git a/Source/WebCore/platform/gtk/SelectionData.cpp b/Source/WebCore/platform/gtk/SelectionData.cpp >index 1e2799ba5ccc2568de81e4b50c9ea25aea64a6cc..82fe471a59c1fbc65febbce05b3439217bd34d7c 100644 >--- a/Source/WebCore/platform/gtk/SelectionData.cpp >+++ b/Source/WebCore/platform/gtk/SelectionData.cpp >@@ -47,8 +47,6 @@ void SelectionData::setURIList(const String& uriListString) > > // 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 @@ void SelectionData::setURIList(const String& uriListString) > // "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; >diff --git a/Source/WebCore/platform/network/CacheValidation.cpp b/Source/WebCore/platform/network/CacheValidation.cpp >index f4c0a644c0ee51f88a5f2f88ed21d8580edb70a2..302a8d6789b0c98a960e233ba4282cd2e782673e 100644 >--- a/Source/WebCore/platform/network/CacheValidation.cpp >+++ b/Source/WebCore/platform/network/CacheValidation.cpp >@@ -350,8 +350,7 @@ Vector<std::pair<String, String>> collectVaryingRequestHeaders(const WebCore::Re > 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) { >diff --git a/Source/WebCore/platform/network/HTTPParsers.cpp b/Source/WebCore/platform/network/HTTPParsers.cpp >index 71f176fd730c4da91e851cea3b014b252c06944c..97843984893f32a2e23ff943880fb679ef27f2a8 100644 >--- a/Source/WebCore/platform/network/HTTPParsers.cpp >+++ b/Source/WebCore/platform/network/HTTPParsers.cpp >@@ -277,21 +277,17 @@ std::optional<WallTime> parseHTTPDate(const String& value) > // 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 @@ XFrameOptionsDisposition parseXFrameOptionsHeader(const String& header) > 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 @@ size_t parseHTTPRequestBody(const char* data, size_t length, Vector<unsigned cha > > 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); >diff --git a/Source/WebCore/platform/network/curl/CookieUtil.cpp b/Source/WebCore/platform/network/curl/CookieUtil.cpp >index d62fdbd89ce95cf2691ab40f73c58df31c8fcc08..949526520563e4c7204b270dc22afcd79896073c 100644 >--- a/Source/WebCore/platform/network/curl/CookieUtil.cpp >+++ b/Source/WebCore/platform/network/curl/CookieUtil.cpp >@@ -171,9 +171,7 @@ bool parseCookieHeader(const String& cookieLine, const String& domain, Cookie& r > 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; >diff --git a/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp b/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp >index f418bc9070499449df93faeb98de4868dd562677..5518e3556a6ce2c53441af3d46a2bd5354a83316 100644 >--- a/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp >+++ b/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp >@@ -155,8 +155,7 @@ bool CurlCacheEntry::loadResponseHeaders() > 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(); >diff --git a/Source/WebCore/platform/network/curl/CurlCacheManager.cpp b/Source/WebCore/platform/network/curl/CurlCacheManager.cpp >index a8deb988e1aec1932d15a7e6e9e66ec57c7a9c03..43bc2e7bfff4f9bd6f710285d6d3d8631bb7783a 100644 >--- a/Source/WebCore/platform/network/curl/CurlCacheManager.cpp >+++ b/Source/WebCore/platform/network/curl/CurlCacheManager.cpp >@@ -131,8 +131,7 @@ void CurlCacheManager::loadIndex() > > // 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 >diff --git a/Source/WebCore/platform/network/soup/CookieJarSoup.cpp b/Source/WebCore/platform/network/soup/CookieJarSoup.cpp >index f49409a7f3b871cd7be776fe0138a1d11d79c34a..5ee8761f65b15ab09a24edb90edaa85233d531c7 100644 >--- a/Source/WebCore/platform/network/soup/CookieJarSoup.cpp >+++ b/Source/WebCore/platform/network/soup/CookieJarSoup.cpp >@@ -67,11 +67,8 @@ void setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstPar > 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; > >diff --git a/Source/WebCore/svg/SVGAnimationElement.cpp b/Source/WebCore/svg/SVGAnimationElement.cpp >index 4efb8f1b8ff3eeebdf4ba8715973c262bf9dae5a..0f91cd2e7933142fa3f51e32e2a036556f86ab22 100644 >--- a/Source/WebCore/svg/SVGAnimationElement.cpp >+++ b/Source/WebCore/svg/SVGAnimationElement.cpp >@@ -166,7 +166,7 @@ void SVGAnimationElement::parseAttribute(const QualifiedName& name, const Atomic > // 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(); > >diff --git a/Source/WebCore/svg/SVGToOTFFontConversion.cpp b/Source/WebCore/svg/SVGToOTFFontConversion.cpp >index 0cf5591d2d20f0776471bcf9c15c0266c05249bf..2322791d2ebd9a37620c9ee99b05e1f8aad69e4c 100644 >--- a/Source/WebCore/svg/SVGToOTFFontConversion.cpp >+++ b/Source/WebCore/svg/SVGToOTFFontConversion.cpp >@@ -519,8 +519,7 @@ void SVGToOTFFontConverter::appendOS2Table() > 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; >diff --git a/Source/WebCore/svg/animation/SVGSMILElement.cpp b/Source/WebCore/svg/animation/SVGSMILElement.cpp >index fc5ef2e28dbd3d128b8de6869ce8dbaa1831c9fa..0601e5c335525bc045aebbb9d39b4bd86f76e421 100644 >--- a/Source/WebCore/svg/animation/SVGSMILElement.cpp >+++ b/Source/WebCore/svg/animation/SVGSMILElement.cpp >@@ -446,9 +446,7 @@ void SVGSMILElement::parseBeginOrEnd(const String& parseString, BeginOrEnd begin > 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); >diff --git a/Source/WebCore/testing/MockCDMFactory.cpp b/Source/WebCore/testing/MockCDMFactory.cpp >index 9f2b23f4af41b0b7e5c79e36fd44aacbaacfd172..a7433c6cf8225c758dbdf22a12363924008c3b22 100644 >--- a/Source/WebCore/testing/MockCDMFactory.cpp >+++ b/Source/WebCore/testing/MockCDMFactory.cpp >@@ -198,8 +198,7 @@ RefPtr<SharedBuffer> MockCDM::sanitizeResponse(const SharedBuffer& response) con > 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 @@ void MockCDMInstance::updateLicense(const String& sessionID, LicenseType, const > 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); >diff --git a/Source/WebDriver/WebDriverService.cpp b/Source/WebDriver/WebDriverService.cpp >index b04e0cf9e7b659a245ee1a50db0607e61300f91e..c33646f1115269ede4ef99df3528512620f80b80 100644 >--- a/Source/WebDriver/WebDriverService.cpp >+++ b/Source/WebDriver/WebDriverService.cpp >@@ -197,10 +197,8 @@ bool WebDriverService::findCommand(HTTPMethod method, const String& path, Comman > 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; > >diff --git a/Source/WebDriver/glib/WebDriverServiceGLib.cpp b/Source/WebDriver/glib/WebDriverServiceGLib.cpp >index 971caf1c66454577239902fd8becb5301b388143..595d3438e661a543ddf2d435c2e9d89b571c48a5 100644 >--- a/Source/WebDriver/glib/WebDriverServiceGLib.cpp >+++ b/Source/WebDriver/glib/WebDriverServiceGLib.cpp >@@ -32,8 +32,7 @@ static bool parseVersion(const String& version, uint64_t& major, uint64_t& minor > { > major = minor = micro = 0; > >- Vector<String> tokens; >- version.split(".", false, tokens); >+ Vector<String> tokens = version.split('.'); > bool ok; > switch (tokens.size()) { > case 3: >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp >index ac8bbc2dbe4a8fef822a55cef9ec834fb522e8ee..69155ff209331e6b1d5e3fd225ffb0e4b507b5d0 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp >@@ -85,7 +85,7 @@ static inline void updateVaryInformation(RecordInformation& recordInformation, c > return; > } > >- varyValue.split(',', false, [&](StringView view) { >+ varyValue.split(',', [&](StringView view) { > if (!recordInformation.hasVaryStar && stripLeadingAndTrailingHTTPSpaces(view) == "*") > recordInformation.hasVaryStar = true; > String headerName = view.toString(); >diff --git a/Source/WebKit/NetworkProcess/capture/NetworkCaptureManager.cpp b/Source/WebKit/NetworkProcess/capture/NetworkCaptureManager.cpp >index 5613be882fd6cde9eded10427c52f4af534b1764..d679cd356641663bac475bd9536ca0505a439996 100644 >--- a/Source/WebKit/NetworkProcess/capture/NetworkCaptureManager.cpp >+++ b/Source/WebKit/NetworkProcess/capture/NetworkCaptureManager.cpp >@@ -216,9 +216,8 @@ int Manager::fuzzyMatchURLs(const WebCore::URL& requestURL, const WebCore::URLPa > 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), >diff --git a/Source/WebKit/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm b/Source/WebKit/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm >index feea1ef7ebf971b7b28b03d77e1a87c209a1940f..68d7c6adf36275131296356286f11e849c14c2c0 100644 >--- a/Source/WebKit/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm >+++ b/Source/WebKit/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm >@@ -149,8 +149,7 @@ static bool getPluginInfoFromPropertyLists(CFBundleRef bundle, PluginModuleInfo& > // 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 PluginVersion::parse(const String& versionString) > { > 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); >diff --git a/Source/WebKit/Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp b/Source/WebKit/Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp >index f9eb06e1617c5c54896de0b8357a5dc93e440126..fb1d9dc926fd676793f454a74fa551aee570c8e5 100644 >--- a/Source/WebKit/Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp >+++ b/Source/WebKit/Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp >@@ -74,14 +74,12 @@ void NetscapePluginModule::parseMIMEDescription(const String& mimeDescription, V > { > 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 @@ void NetscapePluginModule::parseMIMEDescription(const String& mimeDescription, V > 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]; >diff --git a/Source/WebKit/Shared/Plugins/unix/PluginSearchPath.cpp b/Source/WebKit/Shared/Plugins/unix/PluginSearchPath.cpp >index 34205ad31c829807a69d5c02e5aec55805b2d296..e8af9604ce5595a444fe8ca5045d3a617ab2364a 100644 >--- a/Source/WebKit/Shared/Plugins/unix/PluginSearchPath.cpp >+++ b/Source/WebKit/Shared/Plugins/unix/PluginSearchPath.cpp >@@ -38,8 +38,7 @@ Vector<String> pluginsDirectories() > #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); > } > >diff --git a/Source/WebKit/Shared/mac/ChildProcessMac.mm b/Source/WebKit/Shared/mac/ChildProcessMac.mm >index b085ff92a57c57a7b24bfddce56976a3a301c362..88636a8d26340532d4e16fde3bdff41bf1e0d567 100644 >--- a/Source/WebKit/Shared/mac/ChildProcessMac.mm >+++ b/Source/WebKit/Shared/mac/ChildProcessMac.mm >@@ -134,9 +134,8 @@ void ChildProcess::initializeSandbox(const ChildProcessInitializationParameters& > } > } > >- 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); >diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp b/Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp >index 1917c19f2df4944b8c99e81dec9afcb73f64992a..b266a95bb57cc8d4ebd9bec6096dad0202043c13 100644 >--- a/Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp >+++ b/Source/WebKit/UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp >@@ -44,8 +44,7 @@ public: > 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; > >diff --git a/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp b/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >index 77878aaa73f982ac2a0d292c01c5f5d2d26fa4d7..c36f3cd0d9eb6944b714d76c8d1bb17c056e6cea 100644 >--- a/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >+++ b/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >@@ -806,8 +806,7 @@ static bool fileCanBeAcceptedForUpload(const String& filename, const HashSet<Str > 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; > >diff --git a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp >index ead3d1b6a7a64e795dfc43ad9ddb566bd5b6b89c..52916971526da9935e3ff8ba653e733a2aa25a9c 100644 >--- a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp >+++ b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp >@@ -114,9 +114,7 @@ void ProcessLauncher::launchProcess() > #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(); > } >diff --git a/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm b/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm >index 5e40f26e6c244831e449426c21c2de398683dfc2..b47f7d014c594bafa8db5522c6bb492de72a00f1 100644 >--- a/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm >+++ b/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm >@@ -128,9 +128,7 @@ void ProcessLauncher::launchProcess() > 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()); > } >diff --git a/Source/WebKit/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp b/Source/WebKit/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp >index af0341c02ad019f22bfdb268b92578d7f1f1732e..f9ef2ca912da46b68d9ef9f0300b0650b891d524 100644 >--- a/Source/WebKit/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp >+++ b/Source/WebKit/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp >@@ -137,8 +137,7 @@ bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData& > 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]); >diff --git a/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp b/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp >index d1c3684b38f0e2558257109b53ffbf9cbac60ec8..68fb71a5c4aa13309a7090e756ecf0f473a0af17 100644 >--- a/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp >+++ b/Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp >@@ -601,8 +601,7 @@ static bool isTransparentSilverlightBackgroundValue(const String& lowercaseBackg > 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) { >diff --git a/Source/WebKitLegacy/win/Plugins/PluginPackageWin.cpp b/Source/WebKitLegacy/win/Plugins/PluginPackageWin.cpp >index eb57273f531518722c8e9100134a49ad7ffe38eb..94bba6a9e7b66548a68b367b3875895efe9b5265 100644 >--- a/Source/WebKitLegacy/win/Plugins/PluginPackageWin.cpp >+++ b/Source/WebKitLegacy/win/Plugins/PluginPackageWin.cpp >@@ -190,20 +190,16 @@ bool PluginPackage::fetchInfo() > 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(); > 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("(*"); >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 1db6131902bc6228836d892e837fd76fb4c0c918..ded91fc551c6e73edf35bdf3f9f9b06e0307c60d 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,18 @@ >+2018-07-25 Ross Kirsling <ross.kirsling@sony.com> >+ >+ String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter >+ https://bugs.webkit.org/show_bug.cgi?id=187963 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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-25 Aakash Jain <aakash_jain@apple.com> > > [ews-build] Add build steps DownloadBuiltProduct and ExtractBuiltProduct >diff --git a/Tools/TestWebKitAPI/Tests/WTF/StringView.cpp b/Tools/TestWebKitAPI/Tests/WTF/StringView.cpp >index c8bb11401d24ad17d530abe96a0aedc07e4722e3..b751f6883dceef9b7ae01901eb5587d5261b5941 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/StringView.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/StringView.cpp >@@ -297,7 +297,7 @@ TEST(WTF, StringViewSplitWithConsecutiveSeparators) > 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) >diff --git a/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp b/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp >index 5cb6c76e6c3bd4f29708679e775a718351944792..8ecc4d4d43efc6cd68a9f202bc0e956d81cc2058 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp >@@ -499,4 +499,21 @@ TEST(WTF, StringFormatWithArguments) > 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 >diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp >index 3ea3c0a58e8880a08b05defa9eb09cc0160525e6..75d2ddb7eb4ebbc5439df31c2357434320d6dbfa 100644 >--- a/Tools/WebKitTestRunner/TestController.cpp >+++ b/Tools/WebKitTestRunner/TestController.cpp >@@ -1088,7 +1088,7 @@ static void updateTestOptionsFromTestHeader(TestOptions& testOptions, const std: > 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")
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 187963
:
345722
|
345730
|
345744
| 345832