2006-09-09 Steve Falkenburg <sfalken@apple.com>
authorsfalken <sfalken@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 10 Sep 2006 07:41:44 +0000 (07:41 +0000)
committersfalken <sfalken@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 10 Sep 2006 07:41:44 +0000 (07:41 +0000)
        Reviewed by aroben.

        Fixes to work with string API changes.

        * platform/cf/ResourceLoaderCFNet.cpp:
        (WebCore::arrayFromFormData):
        (WebCore::ResourceLoader::start):
        * platform/cf/StringCF.cpp:
        * platform/cf/StringImplCF.cpp:

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

WebCore/ChangeLog
WebCore/platform/cf/ResourceLoaderCFNet.cpp
WebCore/platform/cf/StringCF.cpp
WebCore/platform/cf/StringImplCF.cpp

index c152c4a3dab9942ce66ce2ffc90fdc2c05f9b880..8e515225ca41bf279734fe4e50068c6163fa1192 100644 (file)
@@ -1,3 +1,15 @@
+2006-09-09  Steve Falkenburg  <sfalken@apple.com>
+
+        Reviewed by aroben.
+
+        Fixes to work with string API changes.
+
+        * platform/cf/ResourceLoaderCFNet.cpp:
+        (WebCore::arrayFromFormData):
+        (WebCore::ResourceLoader::start):
+        * platform/cf/StringCF.cpp:
+        * platform/cf/StringImplCF.cpp:
+
 2006-09-09  David Hyatt  <hyatt@apple.com>
 
         Fix for Bugzilla bug 5500, scrollLeft/Top/Width/Height properties not supported
@@ -57,6 +69,7 @@
         (WebCore::RenderObject::clientLeft):
         (WebCore::RenderObject::clientTop):
 
+>>>>>>> .r16283
 2006-09-09  Sam Weinig  <sam.weinig@gmail.com>
 
         Reviewed by Eric.
index 02795967db75328a0779a5d44ffa1a6705575853..36892a3bf1e12d62afb83a4c1bd955a82bcb57f9 100644 (file)
@@ -211,18 +211,17 @@ ResourceLoader::~ResourceLoader()
 
 CFArrayRef arrayFromFormData(const FormData& d)
 {
-    CFMutableArrayRef a = CFArrayCreateMutable(0, d.count(), &kCFTypeArrayCallBacks);
-    for (DeprecatedValueListConstIterator<FormDataElement> it = d.begin(); it != d.end(); ++it) {
-        const FormDataElement& e = *it;
+    size_t size = d.elements().size();
+    CFMutableArrayRef a = CFArrayCreateMutable(0, d.elements().size(), &kCFTypeArrayCallBacks);
+    for (size_t i = 0; i < size; ++i) {
+        const FormDataElement& e = d.elements()[i];
         if (e.m_type == FormDataElement::data) {
             CFDataRef data = CFDataCreate(0, (const UInt8*)e.m_data.data(), e.m_data.size());
             CFArrayAppendValue(a, data);
             CFRelease(data);
         } else {
             ASSERT(e.m_type == FormDataElement::encodedFile);
-            int len;
-            const char* bytes = e.m_filename.ascii(); // !!! Not a good assumption.  We need to yank the DeprecatedString to CFString conversions from the Mac-only code
-            CFStringRef filename = CFStringCreateWithBytes(0, (const UInt8*)bytes, e.m_filename.length(), kCFStringEncodingUTF8, false);
+            CFStringRef filename = e.m_filename.createCFString();
             CFArrayAppendValue(a, filename);
             CFRelease(filename);
         }
@@ -265,17 +264,15 @@ bool ResourceLoader::start(DocLoader* docLoader)
         CFRelease(headerString);
     }
 
-    DeprecatedString referrer = docLoader->frame()->referrer();
-    if (!referrer.isEmpty() && referrer.isAllASCII()) {
-        int len;
-        const char* bytes = referrer.ascii();
-        CFStringRef str = CFStringCreateWithBytes(0, (const UInt8*)bytes, referrer.length(), kCFStringEncodingUTF8, false);
+    String referrer = docLoader->frame()->referrer();
+    if (!referrer.isEmpty()) {
+        CFStringRef str = referrer.createCFString();
         CFHTTPMessageSetHeaderFieldValue(httpRequest, CFSTR("Referer"),str);
         CFRelease(str);
     }
     
     CFReadStreamRef bodyStream = 0;
-    if (postData().count() > 0) {
+    if (postData().elements().size() > 0) {
         CFArrayRef formArray = arrayFromFormData(postData());
         bool done = false;
         CFIndex count = CFArrayGetCount(formArray);
index 57b3fcde8fa86749c030dec0b667f32ba4cbe942..13a797fae1edccf1e619095788023dbb768e1278 100644 (file)
@@ -21,6 +21,8 @@
 #include "config.h"
 #include "PlatformString.h"
 
+#if PLATFORM(CF)
+
 #include <CoreFoundation/CoreFoundation.h>
 
 namespace WebCore {
@@ -49,3 +51,5 @@ CFStringRef String::createCFString() const
 }
 
 }
+
+#endif // PLATFORM(CF)
index 849c50f84a519473acf2a18603cf0eaa63dc52fe..269cdd17d21848fc67dec54cb54e1c48b6185c95 100644 (file)
@@ -21,6 +21,8 @@
 #include "config.h"
 #include "StringImpl.h"
 
+#if PLATFORM(CF)
+
 #include <CoreFoundation/CoreFoundation.h>
 
 namespace WebCore {
@@ -31,3 +33,5 @@ CFStringRef StringImpl::createCFString() const
 }
 
 }
+
+#endif // PLATFORM(CF)