Changeset 152142 in webkit
- Timestamp:
- Jun 27, 2013 5:19:42 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r152069 r152142 1 2013-06-27 Anders Carlsson <andersca@apple.com> 2 3 Add a new String::charactersWithNullTermination() function that returns a vector 4 https://bugs.webkit.org/show_bug.cgi?id=118155 5 6 Reviewed by Andreas Kling. 7 8 This new String::charactersWithNullTermination() function returns a new Vector<UChar> 9 and does not modify the underlying string data. 10 11 * wtf/text/WTFString.cpp: 12 (WTF::String::charactersWithNullTermination): 13 * wtf/text/WTFString.h: 14 1 15 2013-06-26 Anders Carlsson <andersca@apple.com> 2 16 -
trunk/Source/WTF/wtf/text/WTFString.cpp
r152069 r152142 395 395 } 396 396 397 Vector<UChar> String::charactersWithNullTermination() const 398 { 399 Vector<UChar> result; 400 401 if (m_impl) { 402 result.reserveInitialCapacity(length() + 1); 403 404 if (is8Bit()) { 405 const LChar* characters8 = m_impl->characters8(); 406 for (size_t i = 0; i < length(); ++i) 407 result.uncheckedAppend(characters8[i]); 408 } else { 409 const UChar* characters16 = m_impl->characters16(); 410 result.append(characters16, m_impl->length()); 411 } 412 413 result.append(0); 414 } 415 416 return result; 417 } 418 397 419 const UChar* String::deprecatedCharactersWithNullTermination() 398 420 { -
trunk/Source/WTF/wtf/text/WTFString.h
r152069 r152142 282 282 { return caseSensitive ? reverseFind(str, start) : reverseFindIgnoringCase(str, start); } 283 283 284 WTF_EXPORT_STRING_API Vector<UChar> charactersWithNullTermination() const; 284 285 WTF_EXPORT_STRING_API const UChar* deprecatedCharactersWithNullTermination(); 285 286 -
trunk/Source/WebCore/ChangeLog
r152140 r152142 1 2013-06-27 Anders Carlsson <andersca@apple.com> 2 3 Add a new String::charactersWithNullTermination() function that returns a vector 4 https://bugs.webkit.org/show_bug.cgi?id=118155 5 6 Reviewed by Andreas Kling. 7 8 Change calls to deprecatedCharactersWithNullTermination() to charactersWithNullTermination().data() 9 10 * platform/graphics/win/FontCacheWin.cpp: 11 (WebCore::getLinkedFonts): 12 * platform/graphics/win/FontCustomPlatformData.cpp: 13 (WebCore::FontCustomPlatformData::fontPlatformData): 14 * platform/graphics/win/FontCustomPlatformDataCairo.cpp: 15 (WebCore::FontCustomPlatformData::fontPlatformData): 16 * platform/graphics/win/IconWin.cpp: 17 (WebCore::Icon::createIconForFiles): 18 * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp: 19 (WebCore::MediaPlayerPrivateQuickTimeVisualContext::setUpCookiesForQuickTime): 20 * platform/graphics/wince/FontPlatformData.cpp: 21 (WebCore::FontPlatformData::FontPlatformData): 22 * platform/network/curl/CurlDownload.cpp: 23 (CurlDownload::moveFileToDestination): 24 * platform/network/win/CookieJarWin.cpp: 25 (WebCore::setCookiesFromDOM): 26 (WebCore::cookiesForDOM): 27 * platform/network/win/DownloadBundleWin.cpp: 28 (WebCore::DownloadBundle::appendResumeData): 29 (WebCore::DownloadBundle::extractResumeData): 30 * platform/network/win/ResourceHandleWin.cpp: 31 (WebCore::createInternetHandle): 32 (WebCore::ResourceHandle::start): 33 (WebCore::ResourceHandle::fileLoadTimer): 34 * platform/text/win/LocaleWin.cpp: 35 (WebCore::LCIDFromLocaleInternal): 36 * platform/text/win/TextCodecWin.cpp: 37 (WebCore::TextCodecWin::enumerateSupportedEncodings): 38 * platform/win/ClipboardUtilitiesWin.cpp: 39 (WebCore::getWebLocData): 40 (WebCore::createGlobalData): 41 (WebCore::setFileDescriptorData): 42 (WebCore::getURL): 43 (WebCore::setCFData): 44 * platform/win/ContextMenuWin.cpp: 45 (WebCore::ContextMenu::createPlatformContextMenuFromItems): 46 * platform/win/DragImageWin.cpp: 47 (WebCore::createDragImageIconForCachedImageFilename): 48 * platform/win/FileSystemWin.cpp: 49 (WebCore::getFindData): 50 (WebCore::deleteFile): 51 (WebCore::deleteEmptyDirectory): 52 (WebCore::pathByAppendingComponent): 53 (WebCore::makeAllDirectories): 54 (WebCore::pathGetFileName): 55 (WebCore::openTemporaryFile): 56 (WebCore::openFile): 57 * platform/win/MIMETypeRegistryWin.cpp: 58 (WebCore::mimeTypeForExtension): 59 (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): 60 * platform/win/PasteboardWin.cpp: 61 (WebCore::createGlobalImageFileDescriptor): 62 (WebCore::createGlobalHDropContent): 63 * platform/win/PathWalker.cpp: 64 (WebCore::PathWalker::PathWalker): 65 * platform/win/SSLKeyGeneratorWin.cpp: 66 (WebCore::WebCore::signedPublicKeyAndChallengeString): 67 * platform/win/SharedBufferWin.cpp: 68 (WebCore::SharedBuffer::createWithContentsOfFile): 69 * platform/wince/FileSystemWinCE.cpp: 70 (WebCore::getFileInfo): 71 (WebCore::fileExists): 72 (WebCore::deleteFile): 73 (WebCore::deleteEmptyDirectory): 74 (WebCore::makeAllDirectories): 75 (WebCore::openTemporaryFile): 76 (WebCore::openFile): 77 * plugins/win/PluginDatabaseWin.cpp: 78 (WebCore::PluginDatabase::getPluginPathsInDirectories): 79 (WebCore::addMozillaPluginDirectories): 80 (WebCore::addAdobeAcrobatPluginDirectory): 81 (WebCore::addJavaPluginDirectory): 82 * plugins/win/PluginPackageWin.cpp: 83 (WebCore::getVersionInfo): 84 (WebCore::PluginPackage::fetchInfo): 85 (WebCore::PluginPackage::load): 86 * plugins/win/PluginViewWin.cpp: 87 (WebCore::PluginView::handlePostReadFile): 88 1 89 2013-06-27 Frédéric Wang <fred.wang@free.fr> 2 90 -
trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp
r152069 r152142 101 101 102 102 DWORD linkedFontsBufferSize = 0; 103 RegQueryValueEx(fontLinkKey, family. deprecatedCharactersWithNullTermination(), 0, NULL, NULL, &linkedFontsBufferSize);103 RegQueryValueEx(fontLinkKey, family.charactersWithNullTermination().data(), 0, NULL, NULL, &linkedFontsBufferSize); 104 104 WCHAR* linkedFonts = reinterpret_cast<WCHAR*>(malloc(linkedFontsBufferSize)); 105 if (SUCCEEDED(RegQueryValueEx(fontLinkKey, family. deprecatedCharactersWithNullTermination(), 0, NULL, reinterpret_cast<BYTE*>(linkedFonts), &linkedFontsBufferSize))) {105 if (SUCCEEDED(RegQueryValueEx(fontLinkKey, family.charactersWithNullTermination().data(), 0, NULL, reinterpret_cast<BYTE*>(linkedFonts), &linkedFontsBufferSize))) { 106 106 unsigned i = 0; 107 107 unsigned length = linkedFontsBufferSize / sizeof(*linkedFonts); -
trunk/Source/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
r152069 r152142 46 46 47 47 LOGFONT& logFont = *static_cast<LOGFONT*>(malloc(sizeof(LOGFONT))); 48 memcpy(logFont.lfFaceName, m_name. deprecatedCharactersWithNullTermination(), sizeof(logFont.lfFaceName[0]) * min(static_cast<size_t>(LF_FACESIZE), 1 + m_name.length()));48 memcpy(logFont.lfFaceName, m_name.charactersWithNullTermination().data(), sizeof(logFont.lfFaceName[0]) * min(static_cast<size_t>(LF_FACESIZE), 1 + m_name.length())); 49 49 50 50 logFont.lfHeight = -size; -
trunk/Source/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp
r152069 r152142 42 42 LOGFONT logFont; 43 43 memset(&logFont, 0, sizeof(LOGFONT)); 44 wcsncpy(logFont.lfFaceName, m_name. deprecatedCharactersWithNullTermination(), LF_FACESIZE - 1);44 wcsncpy(logFont.lfFaceName, m_name.charactersWithNullTermination().data(), LF_FACESIZE - 1); 45 45 46 46 logFont.lfHeight = -size; -
trunk/Source/WebCore/platform/graphics/win/IconWin.cpp
r152069 r152142 59 59 60 60 String tmpFilename = filenames[0]; 61 if (!SHGetFileInfo(tmpFilename. deprecatedCharactersWithNullTermination(), 0, &sfi, sizeof(sfi), SHGFI_ICON | SHGFI_SHELLICONSIZE | SHGFI_SMALLICON))61 if (!SHGetFileInfo(tmpFilename.charactersWithNullTermination().data(), 0, &sfi, sizeof(sfi), SHGFI_ICON | SHGFI_SHELLICONSIZE | SHGFI_SMALLICON)) 62 62 return 0; 63 63 -
trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
r152135 r152142 308 308 309 309 String string = cookieBuilder.toString(); 310 InternetSetCookieExW(cookieURL. deprecatedCharactersWithNullTermination(), 0, string.deprecatedCharactersWithNullTermination(), 0, 0);310 InternetSetCookieExW(cookieURL.charactersWithNullTermination().data(), 0, string.charactersWithNullTermination().data(), 0, 0); 311 311 } 312 312 } -
trunk/Source/WebCore/platform/graphics/wince/FontPlatformData.cpp
r152069 r152142 337 337 { 338 338 String family(desiredFamily); 339 if (!equalIgnoringCase(family, defaultFontFamily()) && !FontFamilyChecker(family. deprecatedCharactersWithNullTermination()).isSupported()) {339 if (!equalIgnoringCase(family, defaultFontFamily()) && !FontFamilyChecker(family.charactersWithNullTermination().data()).isSupported()) { 340 340 if (equalIgnoringCase(family, String(heiTiStr)) && isSongTiSupported()) 341 341 family = String(songTiStr); -
trunk/Source/WebCore/platform/network/curl/CurlDownload.cpp
r152069 r152142 291 291 return; 292 292 293 ::MoveFile(m_tempPath. deprecatedCharactersWithNullTermination(), m_destination.deprecatedCharactersWithNullTermination());293 ::MoveFile(m_tempPath.charactersWithNullTermination().data(), m_destination.charactersWithNullTermination().data()); 294 294 } 295 295 -
trunk/Source/WebCore/platform/network/win/CookieJarWin.cpp
r152069 r152142 42 42 String str = url.string(); 43 43 String val = value; 44 InternetSetCookie(str. deprecatedCharactersWithNullTermination(), 0, val.deprecatedCharactersWithNullTermination());44 InternetSetCookie(str.charactersWithNullTermination().data(), 0, val.charactersWithNullTermination().data()); 45 45 } 46 46 … … 52 52 53 53 DWORD count = 0; 54 if (!InternetGetCookie(str. deprecatedCharactersWithNullTermination(), 0, 0, &count))54 if (!InternetGetCookie(str.charactersWithNullTermination().data(), 0, 0, &count)) 55 55 return String(); 56 56 … … 59 59 60 60 Vector<UChar> buffer(count); 61 if (!InternetGetCookie(str. deprecatedCharactersWithNullTermination(), 0, buffer.data(), &count))61 if (!InternetGetCookie(str.charactersWithNullTermination().data(), 0, buffer.data(), &count)) 62 62 return String(); 63 63 -
trunk/Source/WebCore/platform/network/win/DownloadBundleWin.cpp
r152069 r152142 62 62 String nullifiedPath = bundlePath; 63 63 FILE* bundle = 0; 64 if (_wfopen_s(&bundle, nullifiedPath. deprecatedCharactersWithNullTermination(), TEXT("ab")) || !bundle) {64 if (_wfopen_s(&bundle, nullifiedPath.charactersWithNullTermination().data(), TEXT("ab")) || !bundle) { 65 65 LOG_ERROR("Failed to open file %s to append resume data", bundlePath.ascii().data()); 66 66 return false; … … 111 111 String nullifiedPath = bundlePath; 112 112 FILE* bundle = 0; 113 if (_wfopen_s(&bundle, nullifiedPath. deprecatedCharactersWithNullTermination(), TEXT("r+b")) || !bundle) {113 if (_wfopen_s(&bundle, nullifiedPath.charactersWithNullTermination().data(), TEXT("r+b")) || !bundle) { 114 114 LOG_ERROR("Failed to open file %s to get resume data", bundlePath.ascii().data()); 115 115 return 0; -
trunk/Source/WebCore/platform/network/win/ResourceHandleWin.cpp
r152069 r152142 50 50 { 51 51 String userAgentString = userAgent; 52 HINTERNET internetHandle = InternetOpenW(userAgentString. deprecatedCharactersWithNullTermination(), INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, asynchronous ? INTERNET_FLAG_ASYNC : 0);52 HINTERNET internetHandle = InternetOpenW(userAgentString.charactersWithNullTermination().data(), INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, asynchronous ? INTERNET_FLAG_ASYNC : 0); 53 53 54 54 if (asynchronous) … … 288 288 | INTERNET_FLAG_RELOAD; 289 289 290 d->m_connectHandle = InternetConnectW(d->m_internetHandle, firstRequest().url().host(). deprecatedCharactersWithNullTermination(), firstRequest().url().port(),290 d->m_connectHandle = InternetConnectW(d->m_internetHandle, firstRequest().url().host().charactersWithNullTermination().data(), firstRequest().url().port(), 291 291 0, 0, INTERNET_SERVICE_HTTP, flags, reinterpret_cast<DWORD_PTR>(this)); 292 292 … … 307 307 LPCWSTR httpAccept[] = { L"*/*", 0 }; 308 308 309 d->m_requestHandle = HttpOpenRequestW(d->m_connectHandle, httpMethod. deprecatedCharactersWithNullTermination(), urlStr.deprecatedCharactersWithNullTermination(),310 0, httpReferrer. deprecatedCharactersWithNullTermination(), httpAccept, flags, reinterpret_cast<DWORD_PTR>(this));309 d->m_requestHandle = HttpOpenRequestW(d->m_connectHandle, httpMethod.charactersWithNullTermination().data(), urlStr.charactersWithNullTermination().data(), 310 0, httpReferrer.charactersWithNullTermination().data(), httpAccept, flags, reinterpret_cast<DWORD_PTR>(this)); 311 311 312 312 if (!d->m_requestHandle) { … … 365 365 366 366 String fileName = firstRequest().url().fileSystemPath(); 367 HANDLE fileHandle = CreateFileW(fileName. deprecatedCharactersWithNullTermination(), GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);367 HANDLE fileHandle = CreateFileW(fileName.charactersWithNullTermination().data(), GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); 368 368 369 369 if (fileHandle == INVALID_HANDLE_VALUE) { -
trunk/Source/WebCore/platform/text/win/LocaleWin.cpp
r152069 r152142 126 126 if (equalIgnoringCase(localeLanguageCode, userDefaultLanguageCode)) 127 127 return userDefaultLCID; 128 return localeNameToLCID(locale. deprecatedCharactersWithNullTermination(), 0);128 return localeNameToLCID(locale.charactersWithNullTermination().data(), 0); 129 129 } 130 130 -
trunk/Source/WebCore/platform/text/win/TextCodecWin.cpp
r152069 r152142 302 302 for (CharsetSet::iterator i = supportedCharsets().begin(); i != supportedCharsets().end(); ++i) { 303 303 HashMap<String, CharsetInfo>::iterator j = knownCharsets().find(*i); 304 if (j != knownCharsets().end() && !receiver.receive(j->value.m_name.data(), j->value.m_friendlyName. deprecatedCharactersWithNullTermination(), j->value.m_codePage))304 if (j != knownCharsets().end() && !receiver.receive(j->value.m_name.data(), j->value.m_friendlyName.charactersWithNullTermination().data(), j->value.m_codePage)) 305 305 break; 306 306 } -
trunk/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp
r152069 r152142 134 134 return false; 135 135 136 wcscpy(filename, dataObject->get(cfHDropFormat()->cfFormat)[0]. deprecatedCharactersWithNullTermination());136 wcscpy(filename, dataObject->get(cfHDropFormat()->cfFormat)[0].charactersWithNullTermination().data()); 137 137 if (_wcsicmp(PathFindExtensionW(filename), L".url")) 138 138 return false; … … 183 183 if (cbData) { 184 184 PWSTR buffer = static_cast<PWSTR>(GlobalLock(cbData)); 185 _snwprintf(buffer, size, L"%s\n%s", mutableURL. deprecatedCharactersWithNullTermination(), mutableTitle.deprecatedCharactersWithNullTermination());185 _snwprintf(buffer, size, L"%s\n%s", mutableURL.charactersWithNullTermination().data(), mutableTitle.charactersWithNullTermination().data()); 186 186 GlobalUnlock(cbData); 187 187 } … … 435 435 436 436 int maxSize = std::min<int>(pathname.length(), WTF_ARRAY_LENGTH(fgd->fgd[0].cFileName)); 437 CopyMemory(fgd->fgd[0].cFileName, pathname. deprecatedCharactersWithNullTermination(), maxSize * sizeof(UChar));437 CopyMemory(fgd->fgd[0].cFileName, pathname.charactersWithNullTermination().data(), maxSize * sizeof(UChar)); 438 438 GlobalUnlock(medium.hGlobal); 439 439 … … 522 522 getDataMapItem(data, filenameFormat(), stringData); 523 523 524 if (stringData.isEmpty() || (!PathFileExists(stringData. deprecatedCharactersWithNullTermination()) && !PathIsUNC(stringData.deprecatedCharactersWithNullTermination())))524 if (stringData.isEmpty() || (!PathFileExists(stringData.charactersWithNullTermination().data()) && !PathIsUNC(stringData.charactersWithNullTermination().data()))) 525 525 return url; 526 RetainPtr<CFStringRef> pathAsCFString = adoptCF(CFStringCreateWithCharacters(kCFAllocatorDefault, (const UniChar *)stringData. deprecatedCharactersWithNullTermination(), wcslen(stringData.deprecatedCharactersWithNullTermination())));526 RetainPtr<CFStringRef> pathAsCFString = adoptCF(CFStringCreateWithCharacters(kCFAllocatorDefault, (const UniChar *)stringData.charactersWithNullTermination().data(), wcslen(stringData.charactersWithNullTermination().data()))); 527 527 if (urlFromPath(pathAsCFString.get(), url) && title) 528 528 *title = url; … … 798 798 dropFiles->fWide = TRUE; 799 799 String filename = dataStrings.first(); 800 wcscpy(reinterpret_cast<LPWSTR>(dropFiles + 1), filename. deprecatedCharactersWithNullTermination());800 wcscpy(reinterpret_cast<LPWSTR>(dropFiles + 1), filename.charactersWithNullTermination().data()); 801 801 GlobalUnlock(medium.hGlobal); 802 802 data->SetData(format, &medium, FALSE); -
trunk/Source/WebCore/platform/win/ContextMenuWin.cpp
r152069 r152142 124 124 menuItem.fMask |= MIIM_STRING; 125 125 menuItem.cch = itemTitle.length(); 126 menuItem.dwTypeData = const_cast<LPWSTR>(itemTitle. deprecatedCharactersWithNullTermination());126 menuItem.dwTypeData = const_cast<LPWSTR>(itemTitle.charactersWithNullTermination().data()); 127 127 } 128 128 -
trunk/Source/WebCore/platform/win/DragImageWin.cpp
r152069 r152142 72 72 SHFILEINFO shfi = {0}; 73 73 String fname = filename; 74 if (FAILED(SHGetFileInfo(static_cast<LPCWSTR>(fname. deprecatedCharactersWithNullTermination()), FILE_ATTRIBUTE_NORMAL,74 if (FAILED(SHGetFileInfo(static_cast<LPCWSTR>(fname.charactersWithNullTermination().data()), FILE_ATTRIBUTE_NORMAL, 75 75 &shfi, sizeof(shfi), SHGFI_ICON | SHGFI_USEFILEATTRIBUTES))) 76 76 return 0; -
trunk/Source/WebCore/platform/win/FileSystemWin.cpp
r152069 r152142 49 49 static bool getFindData(String path, WIN32_FIND_DATAW& findData) 50 50 { 51 HANDLE handle = FindFirstFileW(path. deprecatedCharactersWithNullTermination(), &findData);51 HANDLE handle = FindFirstFileW(path.charactersWithNullTermination().data(), &findData); 52 52 if (handle == INVALID_HANDLE_VALUE) 53 53 return false; … … 125 125 { 126 126 String filename = path; 127 return !!DeleteFileW(filename. deprecatedCharactersWithNullTermination());127 return !!DeleteFileW(filename.charactersWithNullTermination().data()); 128 128 } 129 129 … … 131 131 { 132 132 String filename = path; 133 return !!RemoveDirectoryW(filename. deprecatedCharactersWithNullTermination());133 return !!RemoveDirectoryW(filename.charactersWithNullTermination().data()); 134 134 } 135 135 … … 155 155 156 156 String componentCopy = component; 157 if (!PathAppendW(buffer.data(), componentCopy. deprecatedCharactersWithNullTermination()))157 if (!PathAppendW(buffer.data(), componentCopy.charactersWithNullTermination().data())) 158 158 return String(); 159 159 … … 184 184 { 185 185 String fullPath = path; 186 if (SHCreateDirectoryEx(0, fullPath. deprecatedCharactersWithNullTermination(), 0) != ERROR_SUCCESS) {186 if (SHCreateDirectoryEx(0, fullPath.charactersWithNullTermination().data(), 0) != ERROR_SUCCESS) { 187 187 DWORD error = GetLastError(); 188 188 if (error != ERROR_FILE_EXISTS && error != ERROR_ALREADY_EXISTS) { … … 218 218 return path.substring(position + 1); 219 219 #else 220 return String(::PathFindFileName(String(path). deprecatedCharactersWithNullTermination()));220 return String(::PathFindFileName(String(path).charactersWithNullTermination().data())); 221 221 #endif 222 222 } … … 310 310 311 311 // use CREATE_NEW to avoid overwriting an existing file with the same name 312 handle = ::CreateFileW(proposedPath. deprecatedCharactersWithNullTermination(), GENERIC_READ | GENERIC_WRITE, 0, 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0);312 handle = ::CreateFileW(proposedPath.charactersWithNullTermination().data(), GENERIC_READ | GENERIC_WRITE, 0, 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0); 313 313 } while (!isHandleValid(handle) && GetLastError() == ERROR_ALREADY_EXISTS); 314 314 … … 337 337 338 338 String destination = path; 339 return CreateFile(destination. deprecatedCharactersWithNullTermination(), desiredAccess, 0, 0, creationDisposition, FILE_ATTRIBUTE_NORMAL, 0);339 return CreateFile(destination.charactersWithNullTermination().data(), desiredAccess, 0, 0, creationDisposition, FILE_ATTRIBUTE_NORMAL, 0); 340 340 } 341 341 -
trunk/Source/WebCore/platform/win/MIMETypeRegistryWin.cpp
r152069 r152142 41 41 DWORD keyType; 42 42 43 HRESULT result = getRegistryValue(HKEY_CLASSES_ROOT, ext. deprecatedCharactersWithNullTermination(), L"Content Type", &keyType, contentTypeStr, &contentTypeStrLen);43 HRESULT result = getRegistryValue(HKEY_CLASSES_ROOT, ext.charactersWithNullTermination().data(), L"Content Type", &keyType, contentTypeStr, &contentTypeStrLen); 44 44 45 45 if (result == ERROR_SUCCESS && keyType == REG_SZ) … … 56 56 DWORD keyType; 57 57 58 HRESULT result = getRegistryValue(HKEY_CLASSES_ROOT, path. deprecatedCharactersWithNullTermination(), L"Extension", &keyType, extStr, &extStrLen);58 HRESULT result = getRegistryValue(HKEY_CLASSES_ROOT, path.charactersWithNullTermination().data(), L"Extension", &keyType, extStr, &extStrLen); 59 59 60 60 if (result == ERROR_SUCCESS && keyType == REG_SZ) -
trunk/Source/WebCore/platform/win/PasteboardWin.cpp
r152069 r152142 922 922 } 923 923 extension.insert(".", 0); 924 fsPath = filesystemPathFromUrlOrTitle(url, preferredTitle, extension. deprecatedCharactersWithNullTermination(), false);924 fsPath = filesystemPathFromUrlOrTitle(url, preferredTitle, extension.charactersWithNullTermination().data(), false); 925 925 926 926 if (fsPath.length() <= 0) { … … 964 964 if (localPath[0] == '/') 965 965 localPath = localPath.substring(1); 966 LPCWSTR localPathStr = localPath. deprecatedCharactersWithNullTermination();966 LPCWSTR localPathStr = localPath.charactersWithNullTermination().data(); 967 967 if (wcslen(localPathStr) + 1 < MAX_PATH) 968 968 wcscpy_s(filePath, MAX_PATH, localPathStr); … … 978 978 if (!::GetTempPath(WTF_ARRAY_LENGTH(tempPath), tempPath)) 979 979 return 0; 980 if (!::PathAppend(tempPath, fileName. deprecatedCharactersWithNullTermination()))980 if (!::PathAppend(tempPath, fileName.charactersWithNullTermination().data())) 981 981 return 0; 982 982 LPCWSTR foundExtension = ::PathFindExtension(tempPath); -
trunk/Source/WebCore/platform/win/PathWalker.cpp
r152069 r152142 34 34 { 35 35 String path = directory + "\\" + pattern; 36 m_handle = ::FindFirstFileW(path. deprecatedCharactersWithNullTermination(), &m_data);36 m_handle = ::FindFirstFileW(path.charactersWithNullTermination().data(), &m_data); 37 37 } 38 38 -
trunk/Source/WebCore/platform/win/SSLKeyGeneratorWin.cpp
r152069 r152142 69 69 70 70 // Windows API won't write to our buffer, although it's not declared with const. 71 requestInfo.pwszChallengeString = const_cast<wchar_t*>(localChallenge. deprecatedCharactersWithNullTermination());71 requestInfo.pwszChallengeString = const_cast<wchar_t*>(localChallenge.charactersWithNullTermination().data()); 72 72 73 73 CRYPT_ALGORITHM_IDENTIFIER signAlgo = { 0 }; -
trunk/Source/WebCore/platform/win/SharedBufferWin.cpp
r152069 r152142 45 45 46 46 String nullifiedPath = filePath; 47 HANDLE fileHandle = CreateFileW(nullifiedPath. deprecatedCharactersWithNullTermination(), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);47 HANDLE fileHandle = CreateFileW(nullifiedPath.charactersWithNullTermination().data(), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); 48 48 if (fileHandle == INVALID_HANDLE_VALUE) { 49 49 LOG_ERROR("Failed to open file %s to create shared buffer, GetLastError() = %u", filePath.ascii().data(), GetLastError()); -
trunk/Source/WebCore/platform/wince/FileSystemWinCE.cpp
r152069 r152142 58 58 { 59 59 String filename = path; 60 HANDLE hFile = CreateFile(filename. deprecatedCharactersWithNullTermination(), GENERIC_READ, FILE_SHARE_READ, 060 HANDLE hFile = CreateFile(filename.charactersWithNullTermination().data(), GENERIC_READ, FILE_SHARE_READ, 0 61 61 , OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, 0); 62 62 … … 125 125 { 126 126 String filename = path; 127 HANDLE hFile = CreateFile(filename. deprecatedCharactersWithNullTermination(), 0, FILE_SHARE_READ | FILE_SHARE_WRITE127 HANDLE hFile = CreateFile(filename.charactersWithNullTermination().data(), 0, FILE_SHARE_READ | FILE_SHARE_WRITE 128 128 , 0, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, 0); 129 129 … … 136 136 { 137 137 String filename = path; 138 return !!DeleteFileW(filename. deprecatedCharactersWithNullTermination());138 return !!DeleteFileW(filename.charactersWithNullTermination().data()); 139 139 } 140 140 … … 143 143 { 144 144 String filename = path; 145 return !!RemoveDirectoryW(filename. deprecatedCharactersWithNullTermination());145 return !!RemoveDirectoryW(filename.charactersWithNullTermination().data()); 146 146 } 147 147 … … 184 184 185 185 String folder(path.substring(0, endPos)); 186 CreateDirectory(folder. deprecatedCharactersWithNullTermination(), 0);187 188 DWORD fileAttr = GetFileAttributes(folder. deprecatedCharactersWithNullTermination());186 CreateDirectory(folder.charactersWithNullTermination().data(), 0); 187 188 DWORD fileAttr = GetFileAttributes(folder.charactersWithNullTermination().data()); 189 189 return fileAttr != 0xFFFFFFFF && (fileAttr & FILE_ATTRIBUTE_DIRECTORY); 190 190 } … … 244 244 245 245 // use CREATE_NEW to avoid overwriting an existing file with the same name 246 handle = CreateFile(proposedPath. deprecatedCharactersWithNullTermination(), GENERIC_READ | GENERIC_WRITE, 0, 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0);246 handle = CreateFile(proposedPath.charactersWithNullTermination().data(), GENERIC_READ | GENERIC_WRITE, 0, 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0); 247 247 if (!isHandleValid(handle) && GetLastError() == ERROR_ALREADY_EXISTS) 248 248 continue; … … 275 275 276 276 String destination = path; 277 return CreateFile(destination. deprecatedCharactersWithNullTermination(), desiredAccess, 0, 0, creationDisposition, FILE_ATTRIBUTE_NORMAL, 0);277 return CreateFile(destination.charactersWithNullTermination().data(), desiredAccess, 0, 0, creationDisposition, FILE_ATTRIBUTE_NORMAL, 0); 278 278 } 279 279 -
trunk/Source/WebCore/plugins/win/PluginDatabaseWin.cpp
r152069 r152142 116 116 String pattern = *it + "\\*"; 117 117 118 hFind = FindFirstFileW(pattern. deprecatedCharactersWithNullTermination(), &findFileData);118 hFind = FindFirstFileW(pattern.charactersWithNullTermination().data(), &findFileData); 119 119 120 120 if (hFind == INVALID_HANDLE_VALUE) … … 216 216 217 217 // Try opening the key 218 result = RegOpenKeyEx(key, extensionsPath. deprecatedCharactersWithNullTermination(), 0, KEY_READ, &extensionsKey);218 result = RegOpenKeyEx(key, extensionsPath.charactersWithNullTermination().data(), 0, KEY_READ, &extensionsKey); 219 219 220 220 if (result == ERROR_SUCCESS) { … … 306 306 307 307 String acrobatPluginKeyPath = "Software\\Adobe\\Acrobat Reader\\" + latestAcrobatVersionString + "\\InstallPath"; 308 result = getRegistryValue(HKEY_LOCAL_MACHINE, acrobatPluginKeyPath. deprecatedCharactersWithNullTermination(), 0, &type, acrobatInstallPathStr, &acrobatInstallPathSize);308 result = getRegistryValue(HKEY_LOCAL_MACHINE, acrobatPluginKeyPath.charactersWithNullTermination().data(), 0, &type, acrobatInstallPathStr, &acrobatInstallPathSize); 309 309 310 310 if (result == ERROR_SUCCESS) { … … 353 353 354 354 String javaPluginKeyPath = "Software\\JavaSoft\\Java Plug-in\\" + latestJavaVersionString; 355 result = getRegistryValue(HKEY_LOCAL_MACHINE, javaPluginKeyPath. deprecatedCharactersWithNullTermination(), L"UseNewJavaPlugin", &type, &useNewPluginValue, &useNewPluginSize);355 result = getRegistryValue(HKEY_LOCAL_MACHINE, javaPluginKeyPath.charactersWithNullTermination().data(), L"UseNewJavaPlugin", &type, &useNewPluginValue, &useNewPluginSize); 356 356 357 357 if (result == ERROR_SUCCESS && useNewPluginValue == 1) { 358 result = getRegistryValue(HKEY_LOCAL_MACHINE, javaPluginKeyPath. deprecatedCharactersWithNullTermination(), L"JavaHome", &type, javaInstallPathStr, &javaInstallPathSize);358 result = getRegistryValue(HKEY_LOCAL_MACHINE, javaPluginKeyPath.charactersWithNullTermination().data(), L"JavaHome", &type, javaInstallPathStr, &javaInstallPathSize); 359 359 if (result == ERROR_SUCCESS) { 360 360 String javaPluginDirectory = String(javaInstallPathStr, javaInstallPathSize / sizeof(WCHAR) - 1) + "\\bin\\new_plugin"; -
trunk/Source/WebCore/plugins/win/PluginPackageWin.cpp
r152069 r152142 48 48 String subInfo = "\\StringfileInfo\\040904E4\\" + info; 49 49 bool retval = VerQueryValueW(versionInfoData, 50 const_cast<UChar*>(subInfo. deprecatedCharactersWithNullTermination()),50 const_cast<UChar*>(subInfo.charactersWithNullTermination().data()), 51 51 &buffer, &bufferLength); 52 52 if (!retval || bufferLength == 0) … … 168 168 { 169 169 DWORD versionInfoSize, zeroHandle; 170 versionInfoSize = GetFileVersionInfoSizeW(const_cast<UChar*>(m_path. deprecatedCharactersWithNullTermination()), &zeroHandle);170 versionInfoSize = GetFileVersionInfoSizeW(const_cast<UChar*>(m_path.charactersWithNullTermination().data()), &zeroHandle); 171 171 if (versionInfoSize == 0) 172 172 return false; … … 174 174 OwnArrayPtr<char> versionInfoData = adoptArrayPtr(new char[versionInfoSize]); 175 175 176 if (!GetFileVersionInfoW(const_cast<UChar*>(m_path. deprecatedCharactersWithNullTermination()),176 if (!GetFileVersionInfoW(const_cast<UChar*>(m_path.charactersWithNullTermination().data()), 177 177 0, versionInfoSize, versionInfoData.get())) 178 178 return false; … … 239 239 } else { 240 240 #if OS(WINCE) 241 m_module = ::LoadLibraryW(m_path. deprecatedCharactersWithNullTermination());241 m_module = ::LoadLibraryW(m_path.charactersWithNullTermination().data()); 242 242 #else 243 243 WCHAR currentPath[MAX_PATH]; … … 248 248 String path = m_path.substring(0, m_path.reverseFind('\\')); 249 249 250 if (!::SetCurrentDirectoryW(path. deprecatedCharactersWithNullTermination()))250 if (!::SetCurrentDirectoryW(path.charactersWithNullTermination().data())) 251 251 return false; 252 252 253 253 // Load the library 254 m_module = ::LoadLibraryExW(m_path. deprecatedCharactersWithNullTermination(), 0, LOAD_WITH_ALTERED_SEARCH_PATH);254 m_module = ::LoadLibraryExW(m_path.charactersWithNullTermination().data(), 0, LOAD_WITH_ALTERED_SEARCH_PATH); 255 255 256 256 if (!::SetCurrentDirectoryW(currentPath)) { -
trunk/Source/WebCore/plugins/win/PluginViewWin.cpp
r152069 r152142 898 898 // Get file info 899 899 WIN32_FILE_ATTRIBUTE_DATA attrs; 900 if (GetFileAttributesExW(filename. deprecatedCharactersWithNullTermination(), GetFileExInfoStandard, &attrs) == 0)900 if (GetFileAttributesExW(filename.charactersWithNullTermination().data(), GetFileExInfoStandard, &attrs) == 0) 901 901 return NPERR_FILE_NOT_FOUND; 902 902 … … 904 904 return NPERR_FILE_NOT_FOUND; 905 905 906 HANDLE fileHandle = CreateFileW(filename. deprecatedCharactersWithNullTermination(), FILE_READ_DATA, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);906 HANDLE fileHandle = CreateFileW(filename.charactersWithNullTermination().data(), FILE_READ_DATA, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); 907 907 908 908 if (fileHandle == INVALID_HANDLE_VALUE)
Note: See TracChangeset
for help on using the changeset viewer.