[Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
authorross.kirsling@sony.com <ross.kirsling@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2019 07:31:57 +0000 (07:31 +0000)
committerross.kirsling@sony.com <ross.kirsling@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2019 07:31:57 +0000 (07:31 +0000)
commitc5c66c5763dc2c44866d417d96649b991a837e6e
treec7084f3aaa486204ff91a46339a6a64dd72bab91
parentbe9c2b21d7891ebc62e6f9a057317a7d0b96021a
[Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
https://bugs.webkit.org/show_bug.cgi?id=195346

Reviewed by Fujii Hironori.

.:

* Source/cmake/OptionsJSCOnly.cmake:
* Source/cmake/OptionsWin.cmake:
Stop compiling with -DUCHAR_TYPE=wchar_t.

Source/JavaScriptCore:

* jsc.cpp:
(currentWorkingDirectory):
(fetchModuleFromLocalFileSystem):
* runtime/DateConversion.cpp:
(JSC::formatDateTime):
Use wchar helpers as needed.

Source/WebCore:

* platform/graphics/win/FontCacheWin.cpp:
(WebCore::appendLinkedFonts):
(WebCore::getLinkedFonts):
(WebCore::FontCache::systemFallbackForCharacters):
(WebCore::FontCache::fontFromDescriptionAndLogFont):
(WebCore::createGDIFont):
(WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
* platform/graphics/win/FontCustomPlatformDataCairo.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
(WebCore::GlyphPage::fill):
* platform/graphics/win/IconWin.cpp:
(WebCore::Icon::createIconForFiles):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::mimeTypeCache):
(WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::itemizeShapeAndPlace):
(WebCore::UniscribeController::shape):
* platform/network/win/DownloadBundleWin.cpp:
(WebCore::DownloadBundle::appendResumeData):
(WebCore::DownloadBundle::extractResumeData):
* platform/text/win/LocaleWin.cpp:
(WebCore::LCIDFromLocaleInternal):
(WebCore::LCIDFromLocale):
(WebCore::LocaleWin::getLocaleInfoString):
* platform/win/BString.cpp:
(WebCore::BString::BString):
* platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::getWebLocData):
(WebCore::createGlobalData):
(WebCore::getFileDescriptorData):
(WebCore::getURL):
(WebCore::getCFData):
(WebCore::setCFData):
* platform/win/DragDataWin.cpp:
(WebCore::DragData::asFilenames const):
* platform/win/DragImageWin.cpp:
(WebCore::createDragImageIconForCachedImageFilename):
(WebCore::dragLabelFont):
* platform/win/MIMETypeRegistryWin.cpp:
(WebCore::mimeTypeForExtension):
(WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::read):
(WebCore::filesystemPathFromUrlOrTitle):
(WebCore::Pasteboard::writeURLToDataObject):
(WebCore::createGlobalImageFileDescriptor):
(WebCore::createGlobalHDropContent):
* platform/win/SSLKeyGeneratorWin.cpp:
(WebCore::signedPublicKeyAndChallengeString):
* platform/win/SharedBufferWin.cpp:
(WebCore::SharedBuffer::createFromReadingFile):
* rendering/RenderThemeWin.cpp:
(WebCore::fillFontDescription):
Use wchar helpers as needed.

Source/WebKit:

* Platform/IPC/win/ConnectionWin.cpp:
(IPC::Connection::createServerAndClientIdentifiers):
* Platform/win/ModuleWin.cpp:
(WebKit::Module::load):
* UIProcess/Launcher/win/ProcessLauncherWin.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/win/WebContextMenuProxyWin.cpp:
(WebKit::createMenuItem):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::setToolTip):
* WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
(WebKit::InjectedBundle::initialize):
Use wchar helpers as needed.

Source/WebKitLegacy/win:

* COMPropertyBag.h:
(HashType>::GetPropertyInfo):
(HashType>::LoadObject):
* DOMCoreClasses.cpp:
(DOMNode::addEventListener):
(DOMNode::removeEventListener):
(DOMWindow::addEventListener):
(DOMWindow::removeEventListener):
(DOMElement::font):
* DOMHTMLClasses.cpp:
(DOMHTMLInputElement::setValueForUser):
(DOMHTMLInputElement::replaceCharactersInRange):
* Plugins/PluginDatabaseWin.cpp:
(WebCore::addPluginPathsFromRegistry):
(WebCore::PluginDatabase::getPluginPathsInDirectories const):
(WebCore::addMozillaPluginDirectories):
(WebCore::addWindowsMediaPlayerPluginDirectory):
(WebCore::addAdobeAcrobatPluginDirectory):
(WebCore::addJavaPluginDirectory):
(WebCore::safariPluginsDirectory):
(WebCore::addMacromediaPluginDirectories):
* Plugins/PluginPackageWin.cpp:
(WebCore::getVersionInfo):
(WebCore::PluginPackage::fetchInfo):
(WebCore::PluginPackage::load):
* Plugins/PluginViewWin.cpp:
(WebCore::PluginView::handlePostReadFile):
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::runOpenPanel):
* WebCoreSupport/WebEditorClient.cpp:
(WebEditorClient::checkSpellingOfString):
(WebEditorClient::checkGrammarOfString):
* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::updateWindowTitle):
* WebLocalizableStrings.cpp:
(LocalizedString::operator LPCTSTR const):
* WebView.cpp:
(createContextMenuFromItems):
(WebView::setToolTip):
Use wchar helpers as needed.

Source/WTF:

* wtf/PlatformWin.cmake:
* wtf/text/AtomicString.h:
(WTF::AtomicString::AtomicString):
* wtf/text/WTFString.h:
(WTF::String::String):
* wtf/text/win/StringWin.cpp: Added.
(WTF::String::wideCharacters const): Renamed from WTF::stringToNullTerminatedWChar.
* wtf/text/win/WCharStringExtras.h:
(WTF::ucharFrom):
(WTF::wcharFrom):
(WTF::stringToNullTerminatedWChar): Deleted.
(WTF::wcharToString): Deleted.
(WTF::nullTerminatedWCharToString): Deleted.
Add static_assert-guarded reinterpret_cast wrappers for going between UChar* and wchar_t*.
Move existing to/from-String helpers into the String (and AtomicString) class(es).

* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::getFindData):
(WTF::FileSystemImpl::getFinalPathName):
(WTF::FileSystemImpl::createSymbolicLink):
(WTF::FileSystemImpl::deleteFile):
(WTF::FileSystemImpl::deleteEmptyDirectory):
(WTF::FileSystemImpl::moveFile):
(WTF::FileSystemImpl::pathByAppendingComponent):
(WTF::FileSystemImpl::fileSystemRepresentation):
(WTF::FileSystemImpl::makeAllDirectories):
(WTF::FileSystemImpl::pathGetFileName):
(WTF::FileSystemImpl::storageDirectory):
(WTF::FileSystemImpl::generateTemporaryPath):
(WTF::FileSystemImpl::openTemporaryFile):
(WTF::FileSystemImpl::openFile):
(WTF::FileSystemImpl::hardLinkOrCopyFile):
(WTF::FileSystemImpl::deleteNonEmptyDirectory):
* wtf/win/LanguageWin.cpp:
(WTF::localeInfo):
* wtf/win/PathWalker.cpp:
(WTF::PathWalker::PathWalker):
Use wchar helpers as needed.

Tools:

* TestWebKitAPI/Tests/WTF/StringOperators.cpp:
(TestWebKitAPI::TEST):
Delete wchar tests -- these are MSVC-only and we won't be using String::operator+ going forward anyway.

* DumpRenderTree/win/DumpRenderTree.cpp:
(findFontFallback):
(addFontFallbackIfPresent):
(removeFontFallbackIfPresent):
(main):
* TestWebKitAPI/win/PlatformUtilitiesWin.cpp:
(TestWebKitAPI::Util::moduleDirectory):
(TestWebKitAPI::Util::createInjectedBundlePath):
Use wchar helpers as needed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242592 268f45cc-cd09-0410-ab3c-d52691b4dbfc
56 files changed:
ChangeLog
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/runtime/DateConversion.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/PlatformWin.cmake
Source/WTF/wtf/text/AtomicString.h
Source/WTF/wtf/text/WTFString.h
Source/WTF/wtf/text/win/StringWin.cpp [new file with mode: 0644]
Source/WTF/wtf/text/win/WCharStringExtras.h
Source/WTF/wtf/win/FileSystemWin.cpp
Source/WTF/wtf/win/LanguageWin.cpp
Source/WTF/wtf/win/PathWalker.cpp
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/win/FontCacheWin.cpp
Source/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp
Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp
Source/WebCore/platform/graphics/win/IconWin.cpp
Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp
Source/WebCore/platform/graphics/win/UniscribeController.cpp
Source/WebCore/platform/network/win/DownloadBundleWin.cpp
Source/WebCore/platform/text/win/LocaleWin.cpp
Source/WebCore/platform/win/BString.cpp
Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp
Source/WebCore/platform/win/DragDataWin.cpp
Source/WebCore/platform/win/DragImageWin.cpp
Source/WebCore/platform/win/MIMETypeRegistryWin.cpp
Source/WebCore/platform/win/PasteboardWin.cpp
Source/WebCore/platform/win/SSLKeyGeneratorWin.cpp
Source/WebCore/platform/win/SharedBufferWin.cpp
Source/WebCore/rendering/RenderThemeWin.cpp
Source/WebKit/ChangeLog
Source/WebKit/Platform/IPC/win/ConnectionWin.cpp
Source/WebKit/Platform/win/ModuleWin.cpp
Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp
Source/WebKit/UIProcess/win/WebContextMenuProxyWin.cpp
Source/WebKit/UIProcess/win/WebView.cpp
Source/WebKit/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp
Source/WebKitLegacy/win/COMPropertyBag.h
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/DOMCoreClasses.cpp
Source/WebKitLegacy/win/DOMHTMLClasses.cpp
Source/WebKitLegacy/win/Plugins/PluginDatabaseWin.cpp
Source/WebKitLegacy/win/Plugins/PluginPackageWin.cpp
Source/WebKitLegacy/win/Plugins/PluginViewWin.cpp
Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.cpp
Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.cpp
Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.cpp
Source/WebKitLegacy/win/WebLocalizableStrings.cpp
Source/WebKitLegacy/win/WebView.cpp
Source/cmake/OptionsJSCOnly.cmake
Source/cmake/OptionsWin.cmake
Tools/ChangeLog
Tools/DumpRenderTree/win/DumpRenderTree.cpp
Tools/TestWebKitAPI/Tests/WTF/StringOperators.cpp
Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp