Changeset 152142 in webkit


Ignore:
Timestamp:
Jun 27, 2013 5:19:42 PM (11 years ago)
Author:
andersca@apple.com
Message:

Add a new String::charactersWithNullTermination() function that returns a vector
https://bugs.webkit.org/show_bug.cgi?id=118155

Reviewed by Andreas Kling.

Source/WebCore:

Change calls to deprecatedCharactersWithNullTermination() to charactersWithNullTermination().data()

  • platform/graphics/win/FontCacheWin.cpp:

(WebCore::getLinkedFonts):

  • platform/graphics/win/FontCustomPlatformData.cpp:

(WebCore::FontCustomPlatformData::fontPlatformData):

  • platform/graphics/win/FontCustomPlatformDataCairo.cpp:

(WebCore::FontCustomPlatformData::fontPlatformData):

  • platform/graphics/win/IconWin.cpp:

(WebCore::Icon::createIconForFiles):

  • platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:

(WebCore::MediaPlayerPrivateQuickTimeVisualContext::setUpCookiesForQuickTime):

  • platform/graphics/wince/FontPlatformData.cpp:

(WebCore::FontPlatformData::FontPlatformData):

  • platform/network/curl/CurlDownload.cpp:

(CurlDownload::moveFileToDestination):

  • platform/network/win/CookieJarWin.cpp:

(WebCore::setCookiesFromDOM):
(WebCore::cookiesForDOM):

  • platform/network/win/DownloadBundleWin.cpp:

(WebCore::DownloadBundle::appendResumeData):
(WebCore::DownloadBundle::extractResumeData):

  • platform/network/win/ResourceHandleWin.cpp:

(WebCore::createInternetHandle):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::fileLoadTimer):

  • platform/text/win/LocaleWin.cpp:

(WebCore::LCIDFromLocaleInternal):

  • platform/text/win/TextCodecWin.cpp:

(WebCore::TextCodecWin::enumerateSupportedEncodings):

  • platform/win/ClipboardUtilitiesWin.cpp:

(WebCore::getWebLocData):
(WebCore::createGlobalData):
(WebCore::setFileDescriptorData):
(WebCore::getURL):
(WebCore::setCFData):

  • platform/win/ContextMenuWin.cpp:

(WebCore::ContextMenu::createPlatformContextMenuFromItems):

  • platform/win/DragImageWin.cpp:

(WebCore::createDragImageIconForCachedImageFilename):

  • platform/win/FileSystemWin.cpp:

(WebCore::getFindData):
(WebCore::deleteFile):
(WebCore::deleteEmptyDirectory):
(WebCore::pathByAppendingComponent):
(WebCore::makeAllDirectories):
(WebCore::pathGetFileName):
(WebCore::openTemporaryFile):
(WebCore::openFile):

  • platform/win/MIMETypeRegistryWin.cpp:

(WebCore::mimeTypeForExtension):
(WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):

  • platform/win/PasteboardWin.cpp:

(WebCore::createGlobalImageFileDescriptor):
(WebCore::createGlobalHDropContent):

  • platform/win/PathWalker.cpp:

(WebCore::PathWalker::PathWalker):

  • platform/win/SSLKeyGeneratorWin.cpp:

(WebCore::WebCore::signedPublicKeyAndChallengeString):

  • platform/win/SharedBufferWin.cpp:

(WebCore::SharedBuffer::createWithContentsOfFile):

  • platform/wince/FileSystemWinCE.cpp:

(WebCore::getFileInfo):
(WebCore::fileExists):
(WebCore::deleteFile):
(WebCore::deleteEmptyDirectory):
(WebCore::makeAllDirectories):
(WebCore::openTemporaryFile):
(WebCore::openFile):

  • plugins/win/PluginDatabaseWin.cpp:

(WebCore::PluginDatabase::getPluginPathsInDirectories):
(WebCore::addMozillaPluginDirectories):
(WebCore::addAdobeAcrobatPluginDirectory):
(WebCore::addJavaPluginDirectory):

  • plugins/win/PluginPackageWin.cpp:

(WebCore::getVersionInfo):
(WebCore::PluginPackage::fetchInfo):
(WebCore::PluginPackage::load):

  • plugins/win/PluginViewWin.cpp:

(WebCore::PluginView::handlePostReadFile):

Source/WTF:

This new String::charactersWithNullTermination() function returns a new Vector<UChar>
and does not modify the underlying string data.

  • wtf/text/WTFString.cpp:

(WTF::String::charactersWithNullTermination):

  • wtf/text/WTFString.h:
Location:
trunk/Source
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r152069 r152142  
     12013-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
    1152013-06-26  Anders Carlsson  <andersca@apple.com>
    216
  • trunk/Source/WTF/wtf/text/WTFString.cpp

    r152069 r152142  
    395395}
    396396
     397Vector<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
    397419const UChar* String::deprecatedCharactersWithNullTermination()
    398420{
  • trunk/Source/WTF/wtf/text/WTFString.h

    r152069 r152142  
    282282        { return caseSensitive ? reverseFind(str, start) : reverseFindIgnoringCase(str, start); }
    283283
     284    WTF_EXPORT_STRING_API Vector<UChar> charactersWithNullTermination() const;
    284285    WTF_EXPORT_STRING_API const UChar* deprecatedCharactersWithNullTermination();
    285286   
  • trunk/Source/WebCore/ChangeLog

    r152140 r152142  
     12013-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
    1892013-06-27  Frédéric Wang  <fred.wang@free.fr>
    290
  • trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp

    r152069 r152142  
    101101
    102102    DWORD linkedFontsBufferSize = 0;
    103     RegQueryValueEx(fontLinkKey, family.deprecatedCharactersWithNullTermination(), 0, NULL, NULL, &linkedFontsBufferSize);
     103    RegQueryValueEx(fontLinkKey, family.charactersWithNullTermination().data(), 0, NULL, NULL, &linkedFontsBufferSize);
    104104    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))) {
    106106        unsigned i = 0;
    107107        unsigned length = linkedFontsBufferSize / sizeof(*linkedFonts);
  • trunk/Source/WebCore/platform/graphics/win/FontCustomPlatformData.cpp

    r152069 r152142  
    4646
    4747    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()));
    4949
    5050    logFont.lfHeight = -size;
  • trunk/Source/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp

    r152069 r152142  
    4242    LOGFONT logFont;
    4343    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);
    4545
    4646    logFont.lfHeight = -size;
  • trunk/Source/WebCore/platform/graphics/win/IconWin.cpp

    r152069 r152142  
    5959
    6060        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))
    6262            return 0;
    6363
  • trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp

    r152135 r152142  
    308308
    309309        String string = cookieBuilder.toString();
    310         InternetSetCookieExW(cookieURL.deprecatedCharactersWithNullTermination(), 0, string.deprecatedCharactersWithNullTermination(), 0, 0);
     310        InternetSetCookieExW(cookieURL.charactersWithNullTermination().data(), 0, string.charactersWithNullTermination().data(), 0, 0);
    311311    }
    312312}
  • trunk/Source/WebCore/platform/graphics/wince/FontPlatformData.cpp

    r152069 r152142  
    337337{
    338338    String family(desiredFamily);
    339     if (!equalIgnoringCase(family, defaultFontFamily()) && !FontFamilyChecker(family.deprecatedCharactersWithNullTermination()).isSupported()) {
     339    if (!equalIgnoringCase(family, defaultFontFamily()) && !FontFamilyChecker(family.charactersWithNullTermination().data()).isSupported()) {
    340340        if (equalIgnoringCase(family, String(heiTiStr)) && isSongTiSupported())
    341341            family = String(songTiStr);
  • trunk/Source/WebCore/platform/network/curl/CurlDownload.cpp

    r152069 r152142  
    291291        return;
    292292
    293     ::MoveFile(m_tempPath.deprecatedCharactersWithNullTermination(), m_destination.deprecatedCharactersWithNullTermination());
     293    ::MoveFile(m_tempPath.charactersWithNullTermination().data(), m_destination.charactersWithNullTermination().data());
    294294}
    295295
  • trunk/Source/WebCore/platform/network/win/CookieJarWin.cpp

    r152069 r152142  
    4242    String str = url.string();
    4343    String val = value;
    44     InternetSetCookie(str.deprecatedCharactersWithNullTermination(), 0, val.deprecatedCharactersWithNullTermination());
     44    InternetSetCookie(str.charactersWithNullTermination().data(), 0, val.charactersWithNullTermination().data());
    4545}
    4646
     
    5252
    5353    DWORD count = 0;
    54     if (!InternetGetCookie(str.deprecatedCharactersWithNullTermination(), 0, 0, &count))
     54    if (!InternetGetCookie(str.charactersWithNullTermination().data(), 0, 0, &count))
    5555        return String();
    5656
     
    5959
    6060    Vector<UChar> buffer(count);
    61     if (!InternetGetCookie(str.deprecatedCharactersWithNullTermination(), 0, buffer.data(), &count))
     61    if (!InternetGetCookie(str.charactersWithNullTermination().data(), 0, buffer.data(), &count))
    6262        return String();
    6363
  • trunk/Source/WebCore/platform/network/win/DownloadBundleWin.cpp

    r152069 r152142  
    6262    String nullifiedPath = bundlePath;
    6363    FILE* bundle = 0;
    64     if (_wfopen_s(&bundle, nullifiedPath.deprecatedCharactersWithNullTermination(), TEXT("ab")) || !bundle) {
     64    if (_wfopen_s(&bundle, nullifiedPath.charactersWithNullTermination().data(), TEXT("ab")) || !bundle) {
    6565        LOG_ERROR("Failed to open file %s to append resume data", bundlePath.ascii().data());
    6666        return false;
     
    111111    String nullifiedPath = bundlePath;
    112112    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) {
    114114        LOG_ERROR("Failed to open file %s to get resume data", bundlePath.ascii().data());
    115115        return 0;
  • trunk/Source/WebCore/platform/network/win/ResourceHandleWin.cpp

    r152069 r152142  
    5050{
    5151    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);
    5353
    5454    if (asynchronous)
     
    288288        | INTERNET_FLAG_RELOAD;
    289289
    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(),
    291291                                          0, 0, INTERNET_SERVICE_HTTP, flags, reinterpret_cast<DWORD_PTR>(this));
    292292
     
    307307    LPCWSTR httpAccept[] = { L"*/*", 0 };
    308308
    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));
    311311
    312312    if (!d->m_requestHandle) {
     
    365365
    366366    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);
    368368
    369369    if (fileHandle == INVALID_HANDLE_VALUE) {
  • trunk/Source/WebCore/platform/text/win/LocaleWin.cpp

    r152069 r152142  
    126126    if (equalIgnoringCase(localeLanguageCode, userDefaultLanguageCode))
    127127        return userDefaultLCID;
    128     return localeNameToLCID(locale.deprecatedCharactersWithNullTermination(), 0);
     128    return localeNameToLCID(locale.charactersWithNullTermination().data(), 0);
    129129}
    130130
  • trunk/Source/WebCore/platform/text/win/TextCodecWin.cpp

    r152069 r152142  
    302302    for (CharsetSet::iterator i = supportedCharsets().begin(); i != supportedCharsets().end(); ++i) {
    303303        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))
    305305            break;
    306306    }
  • trunk/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp

    r152069 r152142  
    134134        return false;
    135135
    136     wcscpy(filename, dataObject->get(cfHDropFormat()->cfFormat)[0].deprecatedCharactersWithNullTermination());
     136    wcscpy(filename, dataObject->get(cfHDropFormat()->cfFormat)[0].charactersWithNullTermination().data());
    137137    if (_wcsicmp(PathFindExtensionW(filename), L".url"))
    138138        return false;   
     
    183183    if (cbData) {
    184184        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());
    186186        GlobalUnlock(cbData);
    187187    }
     
    435435
    436436    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));
    438438    GlobalUnlock(medium.hGlobal);
    439439
     
    522522        getDataMapItem(data, filenameFormat(), stringData);
    523523
    524     if (stringData.isEmpty() || (!PathFileExists(stringData.deprecatedCharactersWithNullTermination()) && !PathIsUNC(stringData.deprecatedCharactersWithNullTermination())))
     524    if (stringData.isEmpty() || (!PathFileExists(stringData.charactersWithNullTermination().data()) && !PathIsUNC(stringData.charactersWithNullTermination().data())))
    525525        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())));
    527527    if (urlFromPath(pathAsCFString.get(), url) && title)
    528528        *title = url;
     
    798798    dropFiles->fWide = TRUE;
    799799    String filename = dataStrings.first();
    800     wcscpy(reinterpret_cast<LPWSTR>(dropFiles + 1), filename.deprecatedCharactersWithNullTermination());   
     800    wcscpy(reinterpret_cast<LPWSTR>(dropFiles + 1), filename.charactersWithNullTermination().data());   
    801801    GlobalUnlock(medium.hGlobal);
    802802    data->SetData(format, &medium, FALSE);
  • trunk/Source/WebCore/platform/win/ContextMenuWin.cpp

    r152069 r152142  
    124124            menuItem.fMask |= MIIM_STRING;
    125125            menuItem.cch = itemTitle.length();
    126             menuItem.dwTypeData = const_cast<LPWSTR>(itemTitle.deprecatedCharactersWithNullTermination());
     126            menuItem.dwTypeData = const_cast<LPWSTR>(itemTitle.charactersWithNullTermination().data());
    127127        }
    128128
  • trunk/Source/WebCore/platform/win/DragImageWin.cpp

    r152069 r152142  
    7272    SHFILEINFO shfi = {0};
    7373    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,
    7575        &shfi, sizeof(shfi), SHGFI_ICON | SHGFI_USEFILEATTRIBUTES)))
    7676        return 0;
  • trunk/Source/WebCore/platform/win/FileSystemWin.cpp

    r152069 r152142  
    4949static bool getFindData(String path, WIN32_FIND_DATAW& findData)
    5050{
    51     HANDLE handle = FindFirstFileW(path.deprecatedCharactersWithNullTermination(), &findData);
     51    HANDLE handle = FindFirstFileW(path.charactersWithNullTermination().data(), &findData);
    5252    if (handle == INVALID_HANDLE_VALUE)
    5353        return false;
     
    125125{
    126126    String filename = path;
    127     return !!DeleteFileW(filename.deprecatedCharactersWithNullTermination());
     127    return !!DeleteFileW(filename.charactersWithNullTermination().data());
    128128}
    129129
     
    131131{
    132132    String filename = path;
    133     return !!RemoveDirectoryW(filename.deprecatedCharactersWithNullTermination());
     133    return !!RemoveDirectoryW(filename.charactersWithNullTermination().data());
    134134}
    135135
     
    155155
    156156    String componentCopy = component;
    157     if (!PathAppendW(buffer.data(), componentCopy.deprecatedCharactersWithNullTermination()))
     157    if (!PathAppendW(buffer.data(), componentCopy.charactersWithNullTermination().data()))
    158158        return String();
    159159
     
    184184{
    185185    String fullPath = path;
    186     if (SHCreateDirectoryEx(0, fullPath.deprecatedCharactersWithNullTermination(), 0) != ERROR_SUCCESS) {
     186    if (SHCreateDirectoryEx(0, fullPath.charactersWithNullTermination().data(), 0) != ERROR_SUCCESS) {
    187187        DWORD error = GetLastError();
    188188        if (error != ERROR_FILE_EXISTS && error != ERROR_ALREADY_EXISTS) {
     
    218218    return path.substring(position + 1);
    219219#else
    220     return String(::PathFindFileName(String(path).deprecatedCharactersWithNullTermination()));
     220    return String(::PathFindFileName(String(path).charactersWithNullTermination().data()));
    221221#endif
    222222}
     
    310310
    311311        // 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);
    313313    } while (!isHandleValid(handle) && GetLastError() == ERROR_ALREADY_EXISTS);
    314314
     
    337337
    338338    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);
    340340}
    341341
  • trunk/Source/WebCore/platform/win/MIMETypeRegistryWin.cpp

    r152069 r152142  
    4141    DWORD keyType;
    4242
    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);
    4444
    4545    if (result == ERROR_SUCCESS && keyType == REG_SZ)
     
    5656    DWORD keyType;
    5757
    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);
    5959
    6060    if (result == ERROR_SUCCESS && keyType == REG_SZ)
  • trunk/Source/WebCore/platform/win/PasteboardWin.cpp

    r152069 r152142  
    922922    }
    923923    extension.insert(".", 0);
    924     fsPath = filesystemPathFromUrlOrTitle(url, preferredTitle, extension.deprecatedCharactersWithNullTermination(), false);
     924    fsPath = filesystemPathFromUrlOrTitle(url, preferredTitle, extension.charactersWithNullTermination().data(), false);
    925925
    926926    if (fsPath.length() <= 0) {
     
    964964        if (localPath[0] == '/')
    965965            localPath = localPath.substring(1);
    966         LPCWSTR localPathStr = localPath.deprecatedCharactersWithNullTermination();
     966        LPCWSTR localPathStr = localPath.charactersWithNullTermination().data();
    967967        if (wcslen(localPathStr) + 1 < MAX_PATH)
    968968            wcscpy_s(filePath, MAX_PATH, localPathStr);
     
    978978        if (!::GetTempPath(WTF_ARRAY_LENGTH(tempPath), tempPath))
    979979            return 0;
    980         if (!::PathAppend(tempPath, fileName.deprecatedCharactersWithNullTermination()))
     980        if (!::PathAppend(tempPath, fileName.charactersWithNullTermination().data()))
    981981            return 0;
    982982        LPCWSTR foundExtension = ::PathFindExtension(tempPath);
  • trunk/Source/WebCore/platform/win/PathWalker.cpp

    r152069 r152142  
    3434{
    3535    String path = directory + "\\" + pattern;
    36     m_handle = ::FindFirstFileW(path.deprecatedCharactersWithNullTermination(), &m_data);
     36    m_handle = ::FindFirstFileW(path.charactersWithNullTermination().data(), &m_data);
    3737}
    3838
  • trunk/Source/WebCore/platform/win/SSLKeyGeneratorWin.cpp

    r152069 r152142  
    6969
    7070        // 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());
    7272
    7373        CRYPT_ALGORITHM_IDENTIFIER signAlgo = { 0 };
  • trunk/Source/WebCore/platform/win/SharedBufferWin.cpp

    r152069 r152142  
    4545
    4646    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);
    4848    if (fileHandle == INVALID_HANDLE_VALUE) {
    4949        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  
    5858{
    5959    String filename = path;
    60     HANDLE hFile = CreateFile(filename.deprecatedCharactersWithNullTermination(), GENERIC_READ, FILE_SHARE_READ, 0
     60    HANDLE hFile = CreateFile(filename.charactersWithNullTermination().data(), GENERIC_READ, FILE_SHARE_READ, 0
    6161        , OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, 0);
    6262
     
    125125{
    126126    String filename = path;
    127     HANDLE hFile = CreateFile(filename.deprecatedCharactersWithNullTermination(), 0, FILE_SHARE_READ | FILE_SHARE_WRITE
     127    HANDLE hFile = CreateFile(filename.charactersWithNullTermination().data(), 0, FILE_SHARE_READ | FILE_SHARE_WRITE
    128128        , 0, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, 0);
    129129
     
    136136{
    137137    String filename = path;
    138     return !!DeleteFileW(filename.deprecatedCharactersWithNullTermination());
     138    return !!DeleteFileW(filename.charactersWithNullTermination().data());
    139139}
    140140
     
    143143{
    144144    String filename = path;
    145     return !!RemoveDirectoryW(filename.deprecatedCharactersWithNullTermination());
     145    return !!RemoveDirectoryW(filename.charactersWithNullTermination().data());
    146146}
    147147
     
    184184
    185185    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());
    189189    return fileAttr != 0xFFFFFFFF && (fileAttr & FILE_ATTRIBUTE_DIRECTORY);
    190190}
     
    244244
    245245        // 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);
    247247        if (!isHandleValid(handle) && GetLastError() == ERROR_ALREADY_EXISTS)
    248248            continue;
     
    275275
    276276    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);
    278278}
    279279
  • trunk/Source/WebCore/plugins/win/PluginDatabaseWin.cpp

    r152069 r152142  
    116116        String pattern = *it + "\\*";
    117117
    118         hFind = FindFirstFileW(pattern.deprecatedCharactersWithNullTermination(), &findFileData);
     118        hFind = FindFirstFileW(pattern.charactersWithNullTermination().data(), &findFileData);
    119119
    120120        if (hFind == INVALID_HANDLE_VALUE)
     
    216216
    217217            // 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);
    219219
    220220            if (result == ERROR_SUCCESS) {
     
    306306
    307307        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);
    309309
    310310        if (result == ERROR_SUCCESS) {
     
    353353
    354354        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);
    356356
    357357        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);
    359359            if (result == ERROR_SUCCESS) {
    360360                String javaPluginDirectory = String(javaInstallPathStr, javaInstallPathSize / sizeof(WCHAR) - 1) + "\\bin\\new_plugin";
  • trunk/Source/WebCore/plugins/win/PluginPackageWin.cpp

    r152069 r152142  
    4848    String subInfo = "\\StringfileInfo\\040904E4\\" + info;
    4949    bool retval = VerQueryValueW(versionInfoData,
    50         const_cast<UChar*>(subInfo.deprecatedCharactersWithNullTermination()),
     50        const_cast<UChar*>(subInfo.charactersWithNullTermination().data()),
    5151        &buffer, &bufferLength);
    5252    if (!retval || bufferLength == 0)
     
    168168{
    169169    DWORD versionInfoSize, zeroHandle;
    170     versionInfoSize = GetFileVersionInfoSizeW(const_cast<UChar*>(m_path.deprecatedCharactersWithNullTermination()), &zeroHandle);
     170    versionInfoSize = GetFileVersionInfoSizeW(const_cast<UChar*>(m_path.charactersWithNullTermination().data()), &zeroHandle);
    171171    if (versionInfoSize == 0)
    172172        return false;
     
    174174    OwnArrayPtr<char> versionInfoData = adoptArrayPtr(new char[versionInfoSize]);
    175175
    176     if (!GetFileVersionInfoW(const_cast<UChar*>(m_path.deprecatedCharactersWithNullTermination()),
     176    if (!GetFileVersionInfoW(const_cast<UChar*>(m_path.charactersWithNullTermination().data()),
    177177            0, versionInfoSize, versionInfoData.get()))
    178178        return false;
     
    239239    } else {
    240240#if OS(WINCE)
    241         m_module = ::LoadLibraryW(m_path.deprecatedCharactersWithNullTermination());
     241        m_module = ::LoadLibraryW(m_path.charactersWithNullTermination().data());
    242242#else
    243243        WCHAR currentPath[MAX_PATH];
     
    248248        String path = m_path.substring(0, m_path.reverseFind('\\'));
    249249
    250         if (!::SetCurrentDirectoryW(path.deprecatedCharactersWithNullTermination()))
     250        if (!::SetCurrentDirectoryW(path.charactersWithNullTermination().data()))
    251251            return false;
    252252
    253253        // 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);
    255255
    256256        if (!::SetCurrentDirectoryW(currentPath)) {
  • trunk/Source/WebCore/plugins/win/PluginViewWin.cpp

    r152069 r152142  
    898898    // Get file info
    899899    WIN32_FILE_ATTRIBUTE_DATA attrs;
    900     if (GetFileAttributesExW(filename.deprecatedCharactersWithNullTermination(), GetFileExInfoStandard, &attrs) == 0)
     900    if (GetFileAttributesExW(filename.charactersWithNullTermination().data(), GetFileExInfoStandard, &attrs) == 0)
    901901        return NPERR_FILE_NOT_FOUND;
    902902
     
    904904        return NPERR_FILE_NOT_FOUND;
    905905
    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);
    907907   
    908908    if (fileHandle == INVALID_HANDLE_VALUE)
Note: See TracChangeset for help on using the changeset viewer.