Reviewed by Sam.
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Feb 2008 21:43:58 +0000 (21:43 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Feb 2008 21:43:58 +0000 (21:43 +0000)
        * platform/network/win/ResourceHandleWin.cpp:
        (WebCore::ResourceHandle::onHandleCreated): Use String instead of DeprecatedString.
        (WebCore::ResourceHandle::start): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30383 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/network/win/ResourceHandleWin.cpp

index b8f4f971a7cee0d612ff040397d9395c1b3e6117..d49bf3c9a264528e3caac3c696d1b860b8fb62e7 100644 (file)
@@ -1,3 +1,11 @@
+2008-02-18  Darin Adler  <darin@apple.com>
+
+        Reviewed by Sam.
+
+        * platform/network/win/ResourceHandleWin.cpp:
+        (WebCore::ResourceHandle::onHandleCreated): Use String instead of DeprecatedString.
+        (WebCore::ResourceHandle::start): Ditto.
+
 2008-02-18  Darin Adler  <darin@apple.com>
 
         Reviewed by Sam.
index 260652e08e9d7cd579ac306c6f8afd1671238d9b..337b752e68c1dca51f25588ef3ab1c929116529a 100644 (file)
@@ -146,13 +146,13 @@ void ResourceHandle::onHandleCreated(LPARAM lParam)
 
         if (method() == "POST") {
             // FIXME: Too late to set referrer properly.
-            DeprecatedString urlStr = url().path();
+            String urlStr = url().path();
             int fragmentIndex = urlStr.find('#');
             if (fragmentIndex != -1)
                 urlStr = urlStr.left(fragmentIndex);
             static LPCSTR accept[2]={"*/*", NULL};
             HINTERNET urlHandle = HttpOpenRequestA(d->m_resourceHandle, 
-                                                   "POST", urlStr.latin1(), 0, 0, accept,
+                                                   "POST", urlStr.latin1().data(), 0, 0, accept,
                                                    INTERNET_FLAG_KEEP_CONNECTION | 
                                                    INTERNET_FLAG_FORMS_SUBMIT |
                                                    INTERNET_FLAG_RELOAD |
@@ -328,11 +328,12 @@ bool ResourceHandle::start(Frame* frame)
 {
     ref();
     if (url().isLocalFile()) {
-        DeprecatedString path = url().path();
+        String path = url().path();
         // windows does not enjoy a leading slash on paths
         if (path[0] == '/')
-            path = path.mid(1);
-        d->m_fileHandle = CreateFileA(path.ascii(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+            path = path.substring(1);
+        // FIXME: This is wrong. Need to use wide version of this call.
+        d->m_fileHandle = CreateFileA(path.utf8().data(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
 
         // FIXME: perhaps this error should be reported asynchronously for
         // consistency.
@@ -372,16 +373,15 @@ bool ResourceHandle::start(Frame* frame)
         String referrer = frame->loader()->referrer();
         if (method() == "POST") {
             d->m_postReferrer = referrer;
-            DeprecatedString host = url().host();
-            host += "\0";
-            urlHandle = InternetConnectA(internetHandle, host.ascii(),
+            String host = url().host();
+            urlHandle = InternetConnectA(internetHandle, host.latin1().data(),
                                          url().port(),
                                          NULL, // no username
                                          NULL, // no password
                                          INTERNET_SERVICE_HTTP,
                                          flags, (DWORD_PTR)d->m_jobId);
         } else {
-            DeprecatedString urlStr = url().deprecatedString();
+            String urlStr = url().string();
             int fragmentIndex = urlStr.find('#');
             if (fragmentIndex != -1)
                 urlStr = urlStr.left(fragmentIndex);
@@ -389,8 +389,8 @@ bool ResourceHandle::start(Frame* frame)
             if (!referrer.isEmpty())
                 headers += String("Referer: ") + referrer + "\r\n";
 
-            urlHandle = InternetOpenUrlA(internetHandle, urlStr.ascii(),
-                                         headers.latin1(), headers.length(),
+            urlHandle = InternetOpenUrlA(internetHandle, urlStr.latin1().data(),
+                                         headers.latin1().data(), headers.length(),
                                          flags, (DWORD_PTR)d->m_jobId);
         }