Move TextCodec files from WebCore/platform/text to WebCore/PAL/text
https://bugs.webkit.org/show_bug.cgi?id=233683
Reviewed by Yusuke Suzuki.
Source/WebCore:
This is a purely mechanical move. The TextCodec files don't have any dependencies
except for ICU, so they're good candidates to move.
They do have a thread-local cache, so I split ThreadGlobalData into a PAL part and
a WebCore part.
No new tests because there is no behavior change.
- Headers.cmake:
- Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::generateKeyRequest):
- Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::consumeAsStream):
(WebCore::FetchBody::consumeText):
(WebCore::FetchBody::bodyAsFormData const):
(WebCore::FetchBody::take):
- Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::packageFormData):
- Sources.txt:
- SourcesCocoa.txt:
- WebCore.xcodeproj/project.pbxproj:
- accessibility/atk/WebKitAccessibleInterfaceText.cpp:
- bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeJavaScriptURL):
- css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::completeURL const):
- css/parser/CSSParserContext.h:
- dom/Document.cpp:
(WebCore::Document::characterSetWithUTF8Fallback const):
(WebCore::Document::defaultCharsetForLegacyBindings const):
- dom/Document.h:
- dom/DocumentInlines.h:
(WebCore::Document::textEncoding const):
- dom/TextDecoder.cpp:
- dom/TextDecoder.h:
- fileapi/BlobBuilder.cpp:
(WebCore::BlobBuilder::append):
- fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::convertToText):
(WebCore::FileReaderLoader::setEncoding):
- fileapi/FileReaderLoader.h:
- html/DOMFormData.cpp:
(WebCore::DOMFormData::DOMFormData):
(WebCore::DOMFormData::create):
(WebCore::DOMFormData::encoding const):
- html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
(WebCore::ImageDocument::finishedParsing):
- html/MediaFragmentURIParser.cpp:
(WebCore::MediaFragmentURIParser::parseFragments):
- html/parser/HTMLMetaCharsetParser.cpp:
(WebCore::HTMLMetaCharsetParser::HTMLMetaCharsetParser):
(WebCore::HTMLMetaCharsetParser::encodingFromMetaAttributes):
- html/parser/HTMLMetaCharsetParser.h:
(WebCore::HTMLMetaCharsetParser::encoding):
- html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::WebVTTParser):
- inspector/agents/InspectorDOMAgent.cpp:
(WebCore::computeContentSecurityPolicySHA256Hash):
- inspector/agents/InspectorNetworkAgent.cpp:
- inspector/agents/InspectorPageAgent.cpp:
(WebCore::decodeBuffer):
- loader/FormSubmission.cpp:
(WebCore::appendMailtoPostFormDataToURL):
(WebCore::encodingFromAcceptCharset):
(WebCore::FormSubmission::create):
- loader/TextResourceDecoder.cpp:
(WebCore::findTextEncoding):
(WebCore::TextResourceDecoder::defaultEncoding):
(WebCore::TextResourceDecoder::TextResourceDecoder):
(WebCore::TextResourceDecoder::create):
(WebCore::TextResourceDecoder::setEncoding):
(WebCore::TextResourceDecoder::checkForBOM):
(WebCore::TextResourceDecoder::checkForHeadCharset):
(WebCore::TextResourceDecoder::decode):
(WebCore::TextResourceDecoder::flush):
(WebCore::TextResourceDecoder::encodingForURLParsing):
- loader/TextResourceDecoder.h:
(WebCore::TextResourceDecoder::create):
(WebCore::TextResourceDecoder::encoding const):
- loader/cache/CachedApplicationManifest.cpp:
(WebCore::CachedApplicationManifest::CachedApplicationManifest):
- loader/cache/CachedScript.cpp:
(WebCore::CachedScript::script):
(WebCore::FrameView::scrollToFragment):
(WebCore::Page::userStyleSheetLocationChanged):
(WebCore::PageSerializer::serializeFrame):
(WebCore::PageSerializer::serializeCSSStyleSheet):
(WebCore::SecurityOrigin::extractInnerURL):
(WebCore::SecurityOrigin::create):
- page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::findHashOfContentInPolicies const):
- page/csp/ContentSecurityPolicy.h:
- page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::pathMatches const):
- page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::parsePath):
- platform/ThreadGlobalData.cpp:
(WebCore::ThreadGlobalData::ThreadGlobalData):
(WebCore::ThreadGlobalData::destroy):
(PAL::threadGlobalData):
- platform/ThreadGlobalData.h:
(WebCore::ThreadGlobalData::threadTimers):
(WebCore::ThreadGlobalData::ThreadGlobalData::cachedResourceRequestInitiators): Deleted.
(WebCore::ThreadGlobalData::ThreadGlobalData::eventNames): Deleted.
(WebCore::ThreadGlobalData::ThreadGlobalData::qualifiedNameCache): Deleted.
(WebCore::ThreadGlobalData::ThreadGlobalData::mimeTypeRegistryThreadGlobalData): Deleted.
(WebCore::ThreadGlobalData::ThreadGlobalData::threadTimers): Deleted.
(WebCore::ThreadGlobalData::ThreadGlobalData::cachedConverterICU): Deleted.
(WebCore::ThreadGlobalData::ThreadGlobalData::currentState const): Deleted.
(WebCore::ThreadGlobalData::ThreadGlobalData::setCurrentState): Deleted.
(WebCore::ThreadGlobalData::ThreadGlobalData::isInRemoveAllEventListeners const): Deleted.
(WebCore::ThreadGlobalData::ThreadGlobalData::setIsInRemoveAllEventListeners): Deleted.
(WebCore::ThreadGlobalData::ThreadGlobalData::fontCache): Deleted.
(WebCore::ThreadGlobalData::ThreadGlobalData::fontCacheIfNotDestroyed): Deleted.
- platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
- platform/gtk/PlatformKeyboardEventGtk.cpp:
- platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::decodeBase64):
(WebCore::DataURLDecoder::decodeEscaped):
- platform/network/FormData.cpp:
(WebCore::normalizeStringData):
(WebCore::FormData::appendMultiPartFileValue):
(WebCore::FormData::appendMultiPartStringValue):
(WebCore::FormData::flattenToString const):
- platform/network/FormData.h:
- platform/network/FormDataBuilder.cpp:
(WebCore::FormDataBuilder::addFilenameToMultiPartHeader):
- platform/network/FormDataBuilder.h:
- platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::handleDataURL):
- platform/network/soup/ResourceHandleSoup.cpp:
- platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::getFullCFHTML):
(WebCore::getUtf8Data):
- platform/win/DragDataWin.cpp:
- platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::documentFragment):
(WebCore::createGlobalHDropContent):
- rendering/RenderText.cpp:
(WebCore::RenderText::computeUseBackslashAsYenSymbol const):
(WebCore::XMLHttpRequest::send):
(WebCore::XMLHttpRequest::finalResponseCharset const):
(WebCore::XMLHttpRequest::createDecoder const):
- xml/XMLHttpRequest.h:
- xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource):
Source/WebCore/PAL:
This is a purely mechanical move. The TextCodec files don't have any dependencies
except for ICU, so they're good candidates to move.
- PAL.xcodeproj/project.pbxproj:
- pal/CMakeLists.txt:
- pal/PlatformMac.cmake:
- pal/ThreadGlobalData.cpp: Copied from Source/WebCore/PAL/pal/text/UnencodableHandling.h.
(PAL::ThreadGlobalData::ThreadGlobalData):
(PAL::ThreadGlobalData::destroy):
- pal/ThreadGlobalData.h: Copied from Source/WebCore/html/parser/HTMLMetaCharsetParser.h.
(PAL::ThreadGlobalData::ThreadGlobalData::cachedConverterICU):
- pal/text/DecodeEscapeSequences.h: Renamed from Source/WebCore/platform/text/DecodeEscapeSequences.h.
(PAL::Unicode16BitEscapeSequence::findEndOfRun):
(PAL::Unicode16BitEscapeSequence::decodeRun):
(PAL::URLEscapeSequence::findEndOfRun):
(PAL::URLEscapeSequence::decodeRun):
(PAL::decodeURLEscapeSequencesAsData):
- pal/text/EncodingTables.cpp: Renamed from Source/WebCore/platform/text/EncodingTables.cpp.
(PAL::big5):
(PAL::eucKR):
- pal/text/EncodingTables.h: Renamed from Source/WebCore/platform/text/EncodingTables.h.
(PAL::findInSortedPairs):
- pal/text/TextCodec.cpp: Renamed from Source/WebCore/platform/text/TextCodec.cpp.
- pal/text/TextCodec.h: Renamed from Source/WebCore/platform/text/TextCodec.h.
- pal/text/TextCodecASCIIFastPath.h: Renamed from Source/WebCore/platform/text/TextCodecASCIIFastPath.h.
- pal/text/TextCodecCJK.cpp: Renamed from Source/WebCore/platform/text/TextCodecCJK.cpp.
(PAL::gb18030Ranges):
- pal/text/TextCodecCJK.h: Renamed from Source/WebCore/platform/text/TextCodecCJK.h.
- pal/text/TextCodecICU.cpp: Renamed from Source/WebCore/platform/text/TextCodecICU.cpp.
(PAL::TextCodecICU::decode):
- pal/text/TextCodecICU.h: Renamed from Source/WebCore/platform/text/TextCodecICU.h.
- pal/text/TextCodecLatin1.cpp: Renamed from Source/WebCore/platform/text/TextCodecLatin1.cpp.
- pal/text/TextCodecLatin1.h: Renamed from Source/WebCore/platform/text/TextCodecLatin1.h.
- pal/text/TextCodecReplacement.cpp: Renamed from Source/WebCore/platform/text/TextCodecReplacement.cpp.
- pal/text/TextCodecReplacement.h: Renamed from Source/WebCore/platform/text/TextCodecReplacement.h.
- pal/text/TextCodecSingleByte.cpp: Renamed from Source/WebCore/platform/text/TextCodecSingleByte.cpp.
(PAL::TextCodecSingleByte::encode const):
(PAL::TextCodecSingleByte::decode):
- pal/text/TextCodecSingleByte.h: Renamed from Source/WebCore/platform/text/TextCodecSingleByte.h.
- pal/text/TextCodecUTF16.cpp: Renamed from Source/WebCore/platform/text/TextCodecUTF16.cpp.
- pal/text/TextCodecUTF16.h: Renamed from Source/WebCore/platform/text/TextCodecUTF16.h.
- pal/text/TextCodecUTF8.cpp: Renamed from Source/WebCore/platform/text/TextCodecUTF8.cpp.
(PAL::TextCodecUTF8::decode):
- pal/text/TextCodecUTF8.h: Renamed from Source/WebCore/platform/text/TextCodecUTF8.h.
- pal/text/TextCodecUserDefined.cpp: Renamed from Source/WebCore/platform/text/TextCodecUserDefined.cpp.
- pal/text/TextCodecUserDefined.h: Renamed from Source/WebCore/platform/text/TextCodecUserDefined.h.
- pal/text/TextEncoding.cpp: Renamed from Source/WebCore/platform/text/TextEncoding.cpp.
(PAL::TextEncoding::encode const):
- pal/text/TextEncoding.h: Renamed from Source/WebCore/platform/text/TextEncoding.h.
- pal/text/TextEncodingDetector.h: Renamed from Source/WebCore/platform/text/TextEncodingDetector.h.
- pal/text/TextEncodingDetectorICU.cpp: Renamed from Source/WebCore/platform/text/TextEncodingDetectorICU.cpp.
(PAL::detectTextEncoding):
- pal/text/TextEncodingRegistry.cpp: Renamed from Source/WebCore/platform/text/TextEncodingRegistry.cpp.
(PAL::isUndesiredAlias):
- pal/text/TextEncodingRegistry.h: Renamed from Source/WebCore/platform/text/TextEncodingRegistry.h.
- pal/text/UnencodableHandling.h:
- pal/text/ios/TextEncodingRegistryIOS.mm: Renamed from Source/WebCore/platform/text/ios/TextEncodingRegistryIOS.mm.
(PAL::webDefaultCFStringEncoding):
- pal/text/mac/TextEncodingRegistryMac.mm: Renamed from Source/WebCore/platform/text/mac/TextEncodingRegistryMac.mm.
- pal/text/win/TextCodecWin.cpp: Renamed from Source/WebCore/platform/text/win/TextCodecWin.cpp.
(PAL::getCodePageFlags):
- pal/text/win/TextCodecWin.h: Renamed from Source/WebCore/platform/text/win/TextCodecWin.h.
Source/WebKit:
Update to use the new PAL files.
- NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
- NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
- NetworkProcess/WebStorage/StorageManager.cpp:
- NetworkProcess/WebStorage/StorageManagerSet.cpp:
(WebKit::StorageManagerSet::StorageManagerSet):
- NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::suggestedFilename const):
- NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::suggestedFilename const):
- Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
- UIProcess/API/glib/WebKitFileChooserRequest.cpp:
(webkit_file_chooser_request_select_files):
- UIProcess/API/glib/WebKitSettings.cpp:
- UIProcess/Inspector/WebInspectorUIProxy.cpp:
(WebKit::WebInspectorUIProxy::isMainOrTestInspectorPage):
- WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performJavaScriptURLRequest):
Source/WebKitLegacy:
Update to use the new PAL files.
- Storage/StorageTracker.cpp:
(WebKit::StorageTracker::internalInitialize):
Source/WebKitLegacy/mac:
Update to use the new PAL files.
(-[NSString _webkit_stringByReplacingValidPercentEscapes]):
(+[WebFrame stringWithData:textEncodingName:]):
- WebView/WebPreferences.mm:
(+[WebPreferences _systemCFStringEncoding]):
(+[WebPreferences _setInitialDefaultTextEncodingToSystemEncoding]):
(-[WebResource _stringValue]):
Source/WebKitLegacy/win:
Update to use the new PAL files.
(WebDownload::didReceiveResponse):
Source/WTF:
Update to use the new PAL files.
- Scripts/Preferences/WebPreferences.yaml:
Tools:
Update to use the new PAL files.
- Scripts/webkitpy/style/checkers/cpp.py:
(check_identifier_name_in_declaration):
- TestWebKitAPI/Tests/WebCore/TextCodec.cpp:
(TestWebKitAPI::testDecode):
- TestWebKitAPI/Tests/WebCore/URLParserTextEncoding.cpp:
(TestWebKitAPI::checkURL):
(TestWebKitAPI::TEST_F):
|