Changeset 226205 in webkit
- Timestamp:
- Dec 20, 2017 5:10:52 PM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r226203 r226205 1 2017-12-20 Don Olmstead <don.olmstead@sony.com> 2 3 [Win] Use WCharStringExtras functions in WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=180963 5 6 Reviewed by Alex Christensen. 7 8 No new tests. No change in behavior. 9 10 * platform/graphics/win/FontCacheWin.cpp: 11 (WebCore::appendLinkedFonts): 12 (WebCore::getLinkedFonts): 13 (WebCore::FontCache::systemFallbackForCharacters): 14 (WebCore::FontCache::fontFromDescriptionAndLogFont): 15 * platform/graphics/win/FontCustomPlatformDataCairo.cpp: 16 (WebCore::FontCustomPlatformData::fontPlatformData): 17 * platform/graphics/win/IconWin.cpp: 18 (WebCore::Icon::createIconForFiles): 19 * platform/network/win/DownloadBundleWin.cpp: 20 (WebCore::DownloadBundle::appendResumeData): 21 (WebCore::DownloadBundle::extractResumeData): 22 * platform/text/win/LocaleWin.cpp: 23 (WebCore::LCIDFromLocaleInternal): 24 (WebCore::LCIDFromLocale): 25 * platform/win/ClipboardUtilitiesWin.cpp: 26 (WebCore::getWebLocData): 27 (WebCore::createGlobalData): 28 (WebCore::getFileDescriptorData): 29 (WebCore::getURL): 30 (WebCore::getCFData): 31 (WebCore::setCFData): 32 * platform/win/DragDataWin.cpp: 33 (WebCore::DragData::asFilenames const): 34 * platform/win/DragImageWin.cpp: 35 (WebCore::createDragImageIconForCachedImageFilename): 36 (WebCore::dragLabelFont): 37 * platform/win/FileSystemWin.cpp: 38 (WebCore::FileSystem::getFindData): 39 (WebCore::FileSystem::createSymbolicLink): 40 (WebCore::FileSystem::deleteFile): 41 (WebCore::FileSystem::deleteEmptyDirectory): 42 (WebCore::FileSystem::moveFile): 43 (WebCore::FileSystem::pathByAppendingComponent): 44 (WebCore::FileSystem::makeAllDirectories): 45 (WebCore::FileSystem::pathGetFileName): 46 (WebCore::FileSystem::openTemporaryFile): 47 (WebCore::FileSystem::openFile): 48 (WebCore::FileSystem::hardLinkOrCopyFile): 49 * platform/win/MIMETypeRegistryWin.cpp: 50 (WebCore::mimeTypeForExtension): 51 (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): 52 * platform/win/PasteboardWin.cpp: 53 (WebCore::Pasteboard::read): 54 (WebCore::createGlobalHDropContent): 55 * platform/win/PathWalker.cpp: 56 (WebCore::PathWalker::PathWalker): 57 * platform/win/SSLKeyGeneratorWin.cpp: 58 (WebCore::WebCore::signedPublicKeyAndChallengeString): 59 * platform/win/SharedBufferWin.cpp: 60 (WebCore::SharedBuffer::createFromReadingFile): 61 * rendering/RenderThemeWin.cpp: 62 (WebCore::fillFontDescription): 63 1 64 2017-12-20 Youenn Fablet <youenn@apple.com> 2 65 -
trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp
r225641 r226205 40 40 #include <wtf/text/StringHash.h> 41 41 #include <wtf/text/StringView.h> 42 #include <wtf/text/win/WCharStringExtras.h> 42 43 #include <wtf/win/GDIObject.h> 43 44 … … 114 115 while (j < length && linkedFonts[j]) 115 116 j++; 116 result->append( String(linkedFonts + i, j - i));117 result->append(wcharToString(linkedFonts + i, j - i)); 117 118 i = j + 1; 118 119 } … … 133 134 134 135 DWORD linkedFontsBufferSize = 0; 135 if (::RegQueryValueEx(fontLinkKey, family.charactersWithNullTermination().data(), 0, nullptr, nullptr, &linkedFontsBufferSize) == ERROR_FILE_NOT_FOUND) {136 if (::RegQueryValueEx(fontLinkKey, stringToNullTerminatedWChar(family).data(), 0, nullptr, nullptr, &linkedFontsBufferSize) == ERROR_FILE_NOT_FOUND) { 136 137 WTFLogAlways("The font link key %s does not exist in the registry.", family.utf8().data()); 137 138 return result; … … 140 141 static const constexpr unsigned InitialBufferSize { 256 / sizeof(WCHAR) }; 141 142 Vector<WCHAR, InitialBufferSize> linkedFonts(roundUpToMultipleOf<sizeof(WCHAR)>(linkedFontsBufferSize) / sizeof(WCHAR)); 142 if (::RegQueryValueEx(fontLinkKey, family.charactersWithNullTermination().data(), 0, nullptr, reinterpret_cast<BYTE*>(linkedFonts.data()), &linkedFontsBufferSize) == ERROR_SUCCESS) {143 if (::RegQueryValueEx(fontLinkKey, stringToNullTerminatedWChar(family).data(), 0, nullptr, reinterpret_cast<BYTE*>(linkedFonts.data()), &linkedFontsBufferSize) == ERROR_SUCCESS) { 143 144 unsigned length = linkedFontsBufferSize / sizeof(WCHAR); 144 145 appendLinkedFonts(linkedFonts.data(), length, result); … … 287 288 WCHAR name[LF_FACESIZE]; 288 289 GetTextFace(hdc, LF_FACESIZE, name); 289 familyName = n ame;290 familyName = nullTerminatedWCharToString(name); 290 291 291 292 if (containsCharacter || currentFontContainsCharacter(hdc, character)) … … 332 333 RefPtr<Font> FontCache::fontFromDescriptionAndLogFont(const FontDescription& fontDescription, const LOGFONT& font, AtomicString& outFontFamilyName) 333 334 { 334 AtomicString familyName = String(font.lfFaceName, wcsnlen(font.lfFaceName, LF_FACESIZE));335 AtomicString familyName = wcharToString(font.lfFaceName, wcsnlen(font.lfFaceName, LF_FACESIZE)); 335 336 RefPtr<Font> fontData = fontForFamily(fontDescription, familyName); 336 337 if (fontData) -
trunk/Source/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp
r206597 r226205 30 30 #include <wtf/RetainPtr.h> 31 31 #include <wtf/text/Base64.h> 32 #include <wtf/text/win/WCharStringExtras.h> 32 33 #include <wtf/win/GDIObject.h> 33 34 … … 47 48 LOGFONT logFont; 48 49 memset(&logFont, 0, sizeof(LOGFONT)); 49 wcsncpy(logFont.lfFaceName, m_name.charactersWithNullTermination().data(), LF_FACESIZE - 1);50 wcsncpy(logFont.lfFaceName, stringToNullTerminatedWChar(m_name).data(), LF_FACESIZE - 1); 50 51 51 52 logFont.lfHeight = -size; -
trunk/Source/WebCore/platform/graphics/win/IconWin.cpp
r198655 r226205 27 27 #include <windows.h> 28 28 #include <wtf/text/WTFString.h> 29 #include <wtf/text/win/WCharStringExtras.h> 29 30 30 31 namespace WebCore { … … 54 55 55 56 String tmpFilename = filenames[0]; 56 if (!SHGetFileInfo( tmpFilename.charactersWithNullTermination().data(), 0, &sfi, sizeof(sfi), SHGFI_ICON | SHGFI_SHELLICONSIZE | SHGFI_SMALLICON))57 if (!SHGetFileInfo(stringToNullTerminatedWChar(tmpFilename).data(), 0, &sfi, sizeof(sfi), SHGFI_ICON | SHGFI_SHELLICONSIZE | SHGFI_SMALLICON)) 57 58 return 0; 58 59 -
trunk/Source/WebCore/platform/network/win/DownloadBundleWin.cpp
r219858 r226205 32 32 #include <wtf/text/CString.h> 33 33 #include <wtf/text/WTFString.h> 34 #include <wtf/text/win/WCharStringExtras.h> 34 35 35 36 namespace WebCore { … … 61 62 String nullifiedPath = bundlePath; 62 63 FILE* bundle = 0; 63 if (_wfopen_s(&bundle, nullifiedPath.charactersWithNullTermination().data(), TEXT("ab")) || !bundle) {64 if (_wfopen_s(&bundle, stringToNullTerminatedWChar(nullifiedPath).data(), TEXT("ab")) || !bundle) { 64 65 LOG_ERROR("Failed to open file %s to append resume data", bundlePath.ascii().data()); 65 66 return false; … … 100 101 String nullifiedPath = bundlePath; 101 102 FILE* bundle = 0; 102 if (_wfopen_s(&bundle, nullifiedPath.charactersWithNullTermination().data(), TEXT("r+b")) || !bundle) {103 if (_wfopen_s(&bundle, stringToNullTerminatedWChar(nullifiedPath).data(), TEXT("r+b")) || !bundle) { 103 104 LOG_ERROR("Failed to open file %s to get resume data", bundlePath.ascii().data()); 104 105 return false; -
trunk/Source/WebCore/platform/text/win/LocaleWin.cpp
r225555 r226205 43 43 #include <wtf/text/StringBuilder.h> 44 44 #include <wtf/text/StringHash.h> 45 45 #include <wtf/text/win/WCharStringExtras.h> 46 46 47 47 namespace WebCore { … … 62 62 if (equalIgnoringASCIICase(extractLanguageCode(locale), userDefaultLanguageCode)) 63 63 return userDefaultLCID; 64 return LocaleNameToLCID( locale.charactersWithNullTermination().data(), 0);64 return LocaleNameToLCID(stringToNullTerminatedWChar(locale).data(), 0); 65 65 } 66 66 … … 71 71 WCHAR lowercaseLanguageCode[languageCodeBufferSize]; 72 72 ::GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SISO639LANGNAME, lowercaseLanguageCode, languageCodeBufferSize); 73 String userDefaultLanguageCode = String(lowercaseLanguageCode);73 String userDefaultLanguageCode = nullTerminatedWCharToString(lowercaseLanguageCode); 74 74 75 75 LCID lcid = LCIDFromLocaleInternal(LOCALE_USER_DEFAULT, userDefaultLanguageCode, String(locale)); -
trunk/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp
r225117 r226205 38 38 #include <wtf/text/CString.h> 39 39 #include <wtf/text/StringBuilder.h> 40 40 #include <wtf/text/win/WCharStringExtras.h> 41 41 42 42 #if USE(CF) … … 132 132 return false; 133 133 134 wcscpy(filename, dataObject->get(cfHDropFormat()->cfFormat)[0].charactersWithNullTermination().data());134 wcscpy(filename, stringToNullTerminatedWChar(dataObject->get(cfHDropFormat()->cfFormat)[0]).data()); 135 135 if (_wcsicmp(PathFindExtensionW(filename), L".url")) 136 136 return false; … … 141 141 if (title) { 142 142 PathRemoveExtension(filename); 143 *title = filename;143 *title = nullTerminatedWCharToString(filename); 144 144 } 145 145 146 url = urlBuffer;146 url = nullTerminatedWCharToString(urlBuffer); 147 147 return true; 148 148 #else … … 181 181 if (cbData) { 182 182 PWSTR buffer = static_cast<PWSTR>(GlobalLock(cbData)); 183 _snwprintf(buffer, size, L"%s\n%s", mutableURL.charactersWithNullTermination().data(), mutableTitle.charactersWithNullTermination().data());183 _snwprintf(buffer, size, L"%s\n%s", stringToNullTerminatedWChar(mutableURL).data(), stringToNullTerminatedWChar(mutableTitle).data()); 184 184 GlobalUnlock(cbData); 185 185 } … … 398 398 FILEGROUPDESCRIPTOR* fgd = static_cast<FILEGROUPDESCRIPTOR*>(GlobalLock(store.hGlobal)); 399 399 size = fgd->fgd[0].nFileSizeLow; 400 pathname = fgd->fgd[0].cFileName;400 pathname = nullTerminatedWCharToString(fgd->fgd[0].cFileName); 401 401 402 402 GlobalUnlock(store.hGlobal); … … 521 521 getDataMapItem(data, filenameFormat(), stringData); 522 522 523 if (stringData.isEmpty() || (!PathFileExists(string Data.charactersWithNullTermination().data()) && !PathIsUNC(stringData.charactersWithNullTermination().data())))523 if (stringData.isEmpty() || (!PathFileExists(stringToNullTerminatedWChar(stringData).data()) && !PathIsUNC(stringToNullTerminatedWChar(stringData).data()))) 524 524 return url; 525 RetainPtr<CFStringRef> pathAsCFString = adoptCF(CFStringCreateWithCharacters(kCFAllocatorDefault, (const UniChar *)string Data.charactersWithNullTermination().data(), wcslen(stringData.charactersWithNullTermination().data())));525 RetainPtr<CFStringRef> pathAsCFString = adoptCF(CFStringCreateWithCharacters(kCFAllocatorDefault, (const UniChar *)stringToNullTerminatedWChar(stringData).data(), wcslen(stringToNullTerminatedWChar(stringData).data()))); 526 526 if (urlFromPath(pathAsCFString.get(), url) && title) 527 527 *title = url; … … 738 738 if (!DragQueryFileW(hdrop, i, filename, WTF_ARRAY_LENGTH(filename))) 739 739 continue; 740 dataStrings.append( static_cast<UChar*>(filename));740 dataStrings.append(nullTerminatedWCharToString(filename)); 741 741 } 742 742 … … 793 793 dropFiles->fWide = TRUE; 794 794 String filename = dataStrings.first(); 795 wcscpy(reinterpret_cast<LPWSTR>(dropFiles + 1), filename.charactersWithNullTermination().data());795 wcscpy(reinterpret_cast<LPWSTR>(dropFiles + 1), stringToNullTerminatedWChar(filename).data()); 796 796 GlobalUnlock(medium.hGlobal); 797 797 data->SetData(format, &medium, FALSE); -
trunk/Source/WebCore/platform/win/DragDataWin.cpp
r222025 r226205 38 38 #include <wtf/RefPtr.h> 39 39 #include <wtf/text/WTFString.h> 40 #include <wtf/text/win/WCharStringExtras.h> 40 41 41 42 namespace WebCore { … … 158 159 if (!DragQueryFileW(hdrop, i, filename, WTF_ARRAY_LENGTH(filename))) 159 160 continue; 160 result.append( static_cast<UChar*>(filename));161 result.append(nullTerminatedWCharToString(filename)); 161 162 } 162 163 -
trunk/Source/WebCore/platform/win/DragImageWin.cpp
r213464 r226205 41 41 #include "WebCoreTextRenderer.h" 42 42 #include <wtf/RetainPtr.h> 43 #include <wtf/text/win/WCharStringExtras.h> 43 44 #include <wtf/win/GDIObject.h> 44 45 … … 75 76 SHFILEINFO shfi = {0}; 76 77 String fname = filename; 77 if (FAILED(SHGetFileInfo(static_cast<LPCWSTR>(fname.charactersWithNullTermination().data()), FILE_ATTRIBUTE_NORMAL, 78 &shfi, sizeof(shfi), SHGFI_ICON | SHGFI_USEFILEATTRIBUTES))) 78 if (FAILED(SHGetFileInfo(stringToNullTerminatedWChar(fname).data(), FILE_ATTRIBUTE_NORMAL, &shfi, sizeof(shfi), SHGFI_ICON | SHGFI_USEFILEATTRIBUTES))) 79 79 return 0; 80 80 … … 113 113 FontCascadeDescription description; 114 114 description.setWeight(bold ? boldWeightValue() : normalWeightValue()); 115 description.setOneFamily( metrics.lfSmCaptionFont.lfFaceName);115 description.setOneFamily(nullTerminatedWCharToString(metrics.lfSmCaptionFont.lfFaceName)); 116 116 description.setSpecifiedSize((float)size); 117 117 description.setComputedSize((float)size); -
trunk/Source/WebCore/platform/win/FileSystemWin.cpp
r224635 r226205 43 43 #include <wtf/text/CString.h> 44 44 #include <wtf/text/StringBuilder.h> 45 #include <wtf/text/win/WCharStringExtras.h> 45 46 46 47 namespace WebCore { … … 52 53 static bool getFindData(String path, WIN32_FIND_DATAW& findData) 53 54 { 54 HANDLE handle = FindFirstFileW( path.charactersWithNullTermination().data(), &findData);55 HANDLE handle = FindFirstFileW(stringToNullTerminatedWChar(path).data(), &findData); 55 56 if (handle == INVALID_HANDLE_VALUE) 56 57 return false; … … 220 221 bool createSymbolicLink(const String& targetPath, const String& symbolicLinkPath) 221 222 { 222 return !::CreateSymbolicLinkW(s ymbolicLinkPath.charactersWithNullTermination().data(), targetPath.charactersWithNullTermination().data(), 0);223 return !::CreateSymbolicLinkW(stringToNullTerminatedWChar(symbolicLinkPath).data(), stringToNullTerminatedWChar(targetPath).data(), 0); 223 224 } 224 225 … … 232 233 { 233 234 String filename = path; 234 return !!DeleteFileW( filename.charactersWithNullTermination().data());235 return !!DeleteFileW(stringToNullTerminatedWChar(filename).data()); 235 236 } 236 237 … … 238 239 { 239 240 String filename = path; 240 return !!RemoveDirectoryW( filename.charactersWithNullTermination().data());241 return !!RemoveDirectoryW(stringToNullTerminatedWChar(filename).data()); 241 242 } 242 243 … … 245 246 String oldFilename = oldPath; 246 247 String newFilename = newPath; 247 return !!::MoveFileEx( oldFilename.charactersWithNullTermination().data(), newFilename.charactersWithNullTermination().data(), MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING);248 return !!::MoveFileEx(stringToNullTerminatedWChar(oldFilename).data(), stringToNullTerminatedWChar(newFilename).data(), MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING); 248 249 } 249 250 … … 258 259 buffer[path.length()] = '\0'; 259 260 260 if (!PathAppendW(buffer.data(), component.charactersWithNullTermination().data()))261 if (!PathAppendW(buffer.data(), stringToNullTerminatedWChar(component).data())) 261 262 return String(); 262 263 … … 296 297 { 297 298 String fullPath = path; 298 if (SHCreateDirectoryEx(0, fullPath.charactersWithNullTermination().data(), 0) != ERROR_SUCCESS) {299 if (SHCreateDirectoryEx(0, stringToNullTerminatedWChar(fullPath).data(), 0) != ERROR_SUCCESS) { 299 300 DWORD error = GetLastError(); 300 301 if (error != ERROR_FILE_EXISTS && error != ERROR_ALREADY_EXISTS) { … … 314 315 String pathGetFileName(const String& path) 315 316 { 316 return String(::PathFindFileName(String(path).charactersWithNullTermination().data()));317 return nullTerminatedWCharToString(::PathFindFileName(stringToNullTerminatedWChar(path).data())); 317 318 } 318 319 … … 399 400 ASSERT(wcslen(tempFile) == WTF_ARRAY_LENGTH(tempFile) - 1); 400 401 401 proposedPath = pathByAppendingComponent( tempPath, tempFile);402 proposedPath = pathByAppendingComponent(nullTerminatedWCharToString(tempPath), nullTerminatedWCharToString(tempFile)); 402 403 if (proposedPath.isEmpty()) 403 404 break; 404 405 405 406 // use CREATE_NEW to avoid overwriting an existing file with the same name 406 handle = ::CreateFileW( proposedPath.charactersWithNullTermination().data(), GENERIC_READ | GENERIC_WRITE, 0, 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0);407 handle = ::CreateFileW(stringToNullTerminatedWChar(proposedPath).data(), GENERIC_READ | GENERIC_WRITE, 0, 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0); 407 408 } while (!isHandleValid(handle) && GetLastError() == ERROR_ALREADY_EXISTS); 408 409 … … 433 434 434 435 String destination = path; 435 return CreateFile( destination.charactersWithNullTermination().data(), desiredAccess, shareMode, 0, creationDisposition, FILE_ATTRIBUTE_NORMAL, 0);436 return CreateFile(stringToNullTerminatedWChar(destination).data(), desiredAccess, shareMode, 0, creationDisposition, FILE_ATTRIBUTE_NORMAL, 0); 436 437 } 437 438 … … 492 493 bool hardLinkOrCopyFile(const String& source, const String& destination) 493 494 { 494 return !!::CopyFile(s ource.charactersWithNullTermination().data(), destination.charactersWithNullTermination().data(), TRUE);495 return !!::CopyFile(stringToNullTerminatedWChar(source).data(), stringToNullTerminatedWChar(destination).data(), TRUE); 495 496 } 496 497 -
trunk/Source/WebCore/platform/win/MIMETypeRegistryWin.cpp
r165676 r226205 31 31 #include <wtf/MainThread.h> 32 32 #include <wtf/WindowsExtras.h> 33 #include <wtf/text/win/WCharStringExtras.h> 33 34 34 35 namespace WebCore { … … 41 42 DWORD keyType; 42 43 43 HRESULT result = getRegistryValue(HKEY_CLASSES_ROOT, ext.charactersWithNullTermination().data(), L"Content Type", &keyType, contentTypeStr, &contentTypeStrLen);44 HRESULT result = getRegistryValue(HKEY_CLASSES_ROOT, stringToNullTerminatedWChar(ext).data(), L"Content Type", &keyType, contentTypeStr, &contentTypeStrLen); 44 45 45 46 if (result == ERROR_SUCCESS && keyType == REG_SZ) 46 return String(contentTypeStr, contentTypeStrLen / sizeof(contentTypeStr[0]) - 1);47 return wcharToString(contentTypeStr, contentTypeStrLen / sizeof(contentTypeStr[0]) - 1); 47 48 48 49 return String(); … … 56 57 DWORD keyType; 57 58 58 HRESULT result = getRegistryValue(HKEY_CLASSES_ROOT, path.charactersWithNullTermination().data(), L"Extension", &keyType, extStr, &extStrLen);59 HRESULT result = getRegistryValue(HKEY_CLASSES_ROOT, stringToNullTerminatedWChar(path).data(), L"Extension", &keyType, extStr, &extStrLen); 59 60 60 61 if (result == ERROR_SUCCESS && keyType == REG_SZ) 61 return String(extStr + 1, extStrLen / sizeof(extStr[0]) - 2);62 return wcharToString(extStr + 1, extStrLen / sizeof(extStr[0]) - 2); 62 63 63 64 return String(); -
trunk/Source/WebCore/platform/win/PasteboardWin.cpp
r225127 r226205 52 52 #include <wtf/text/CString.h> 53 53 #include <wtf/text/StringView.h> 54 #include <wtf/text/win/WCharStringExtras.h> 54 55 #include <wtf/win/GDIObject.h> 55 56 … … 340 341 if (!DragQueryFileW(hdrop, i, filename, WTF_ARRAY_LENGTH(filename))) 341 342 continue; 342 reader.readFilename( filename);343 reader.readFilename(nullTerminatedWCharToString(filename)); 343 344 } 344 345 … … 960 961 if (localPath[0] == '/') 961 962 localPath = localPath.substring(1); 962 const Vector<UChar>& localPathWide = localPath.charactersWithNullTermination();963 auto localPathWide = stringToNullTerminatedWChar(localPath); 963 964 LPCWSTR localPathStr = localPathWide.data(); 964 965 if (localPathStr && wcslen(localPathStr) + 1 < MAX_PATH) … … 971 972 if (!::GetTempPath(WTF_ARRAY_LENGTH(tempPath), tempPath)) 972 973 return 0; 973 if (!::PathAppend(tempPath, fileName.charactersWithNullTermination().data()))974 if (!::PathAppend(tempPath, stringToNullTerminatedWChar(fileName).data())) 974 975 return 0; 975 976 LPCWSTR foundExtension = ::PathFindExtension(tempPath); -
trunk/Source/WebCore/platform/win/PathWalker.cpp
r152142 r226205 28 28 29 29 #include <wtf/text/WTFString.h> 30 #include <wtf/text/win/WCharStringExtras.h> 30 31 31 32 namespace WebCore { … … 34 35 { 35 36 String path = directory + "\\" + pattern; 36 m_handle = ::FindFirstFileW( path.charactersWithNullTermination().data(), &m_data);37 m_handle = ::FindFirstFileW(stringToNullTerminatedWChar(path).data(), &m_data); 37 38 } 38 39 -
trunk/Source/WebCore/platform/win/SSLKeyGeneratorWin.cpp
r208858 r226205 23 23 #include <wtf/text/Base64.h> 24 24 #include <wtf/text/CString.h> 25 #include <wtf/text/win/WCharStringExtras.h> 25 26 26 27 #include <windows.h> … … 68 69 69 70 // Windows API won't write to our buffer, although it's not declared with const. 70 const Vector<UChar>& localChallengeWide = localChallenge.charactersWithNullTermination();71 auto localChallengeWide = stringToNullTerminatedWChar(localChallenge); 71 72 requestInfo.pwszChallengeString = const_cast<wchar_t*>(localChallengeWide.data()); 72 73 -
trunk/Source/WebCore/platform/win/SharedBufferWin.cpp
r216833 r226205 31 31 #include "SharedBuffer.h" 32 32 #include <wtf/text/CString.h> 33 #include <wtf/text/win/WCharStringExtras.h> 33 34 34 35 namespace WebCore { … … 40 41 41 42 String nullifiedPath = filePath; 42 HANDLE fileHandle = CreateFileW( nullifiedPath.charactersWithNullTermination().data(), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);43 HANDLE fileHandle = CreateFileW(stringToNullTerminatedWChar(nullifiedPath).data(), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); 43 44 if (fileHandle == INVALID_HANDLE_VALUE) { 44 45 LOG_ERROR("Failed to open file %s to create shared buffer, GetLastError() = %u", filePath.ascii().data(), GetLastError()); -
trunk/Source/WebCore/rendering/RenderThemeWin.cpp
r224635 r226205 41 41 #include <wtf/SoftLinking.h> 42 42 #include <wtf/text/StringBuilder.h> 43 #include <wtf/text/win/WCharStringExtras.h> 43 44 #include <wtf/win/GDIObject.h> 44 45 … … 319 320 { 320 321 fontDescription.setIsAbsoluteSize(true); 321 fontDescription.setOneFamily( String(logFont.lfFaceName));322 fontDescription.setOneFamily(nullTerminatedWCharToString(logFont.lfFaceName)); 322 323 fontDescription.setSpecifiedSize(fontSize); 323 324 fontDescription.setWeight(logFont.lfWeight >= 700 ? boldWeightValue() : normalWeightValue()); // FIXME: Use real weight.
Note: See TracChangeset
for help on using the changeset viewer.