diff --git a/WebCore/platform/network/ResourceHandleInternal.h b/WebCore/platform/network/ResourceHandleInternal.h
index bc07ca1..c44f135 100644
--- a/WebCore/platform/network/ResourceHandleInternal.h
+++ b/WebCore/platform/network/ResourceHandleInternal.h
@@ -111,7 +111,7 @@ namespace WebCore {
 #if USE(SOUP)
             , m_msg(0)
             , m_cancelled(false)
-            , m_gfile(0)
+            , m_req(0)
             , m_inputStream(0)
             , m_cancellable(0)
             , m_buffer(0)
@@ -193,7 +193,7 @@ namespace WebCore {
         SoupMessage* m_msg;
         ResourceResponse m_response;
         bool m_cancelled;
-        GFile* m_gfile;
+        SoupRequest* m_req;
         GInputStream* m_inputStream;
         GCancellable* m_cancellable;
         char* m_buffer;
diff --git a/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index 5a229b8..7bd61d1 100644
--- a/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -118,9 +118,8 @@ void WebCoreSynchronousLoader::run()
         g_main_loop_run(m_mainLoop);
 }
 
-static void cleanupGioOperation(ResourceHandle* handle, bool isDestroying);
-static bool startData(ResourceHandle* handle, String urlString);
-static bool startGio(ResourceHandle* handle, KURL url);
+static void cleanupSoupRequestOperation(ResourceHandle* handle, bool isDestroying);
+static bool startSoupRequest(ResourceHandle* handle, KURL url);
 
 ResourceHandleInternal::~ResourceHandleInternal()
 {
@@ -141,7 +140,7 @@ ResourceHandle::~ResourceHandle()
         g_signal_handlers_disconnect_matched(d->m_msg, G_SIGNAL_MATCH_DATA,
                                              0, 0, 0, 0, this);
 
-    cleanupGioOperation(this, true);
+    cleanupSoupRequestOperation(this, true);
 }
 
 // All other kinds of redirections, except for the *304* status code
@@ -332,95 +331,6 @@ static void finishedCallback(SoupSession *session, SoupMessage* msg, gpointer da
     client->didFinishLoading(handle.get());
 }
 
-// parseDataUrl() is taken from the CURL http backend.
-static gboolean parseDataUrl(gpointer callback_data)
-{
-    ResourceHandle* handle = static_cast<ResourceHandle*>(callback_data);
-    ResourceHandleClient* client = handle->client();
-    ResourceHandleInternal* d = handle->getInternal();
-    if (d->m_cancelled)
-        return false;
-
-    d->m_idleHandler = 0;
-
-    ASSERT(client);
-    if (!client)
-        return false;
-
-    String url = handle->request().url().string();
-    ASSERT(url.startsWith("data:", false));
-
-    int index = url.find(',');
-    if (index == -1) {
-        client->cannotShowURL(handle);
-        return false;
-    }
-
-    String mediaType = url.substring(5, index - 5);
-    String data = url.substring(index + 1);
-
-    bool isBase64 = mediaType.endsWith(";base64", false);
-    if (isBase64)
-        mediaType = mediaType.left(mediaType.length() - 7);
-
-    if (mediaType.isEmpty())
-        mediaType = "text/plain;charset=US-ASCII";
-
-    String mimeType = extractMIMETypeFromMediaType(mediaType);
-    String charset = extractCharsetFromMediaType(mediaType);
-
-    ResourceResponse response;
-    response.setMimeType(mimeType);
-
-    if (isBase64) {
-        data = decodeURLEscapeSequences(data);
-        response.setTextEncodingName(charset);
-        client->didReceiveResponse(handle, response);
-
-        if (d->m_cancelled)
-            return false;
-
-        // Use the GLib Base64, since WebCore's decoder isn't
-        // general-purpose and fails on Acid3 test 97 (whitespace).
-        size_t outLength = 0;
-        char* outData = 0;
-        outData = reinterpret_cast<char*>(g_base64_decode(data.utf8().data(), &outLength));
-        if (outData && outLength > 0)
-            client->didReceiveData(handle, outData, outLength, 0);
-        g_free(outData);
-    } else {
-        // We have to convert to UTF-16 early due to limitations in KURL
-        data = decodeURLEscapeSequences(data, TextEncoding(charset));
-        response.setTextEncodingName("UTF-16");
-        client->didReceiveResponse(handle, response);
-
-        if (d->m_cancelled)
-            return false;
-
-        if (data.length() > 0)
-            client->didReceiveData(handle, reinterpret_cast<const char*>(data.characters()), data.length() * sizeof(UChar), 0);
-
-        if (d->m_cancelled)
-            return false;
-    }
-
-    client->didFinishLoading(handle);
-
-    return false;
-}
-
-static bool startData(ResourceHandle* handle, String urlString)
-{
-    ASSERT(handle);
-
-    ResourceHandleInternal* d = handle->getInternal();
-
-    // If parseDataUrl is called synchronously the job is not yet effectively started
-    // and webkit won't never know that the data has been parsed even didFinishLoading is called.
-    d->m_idleHandler = g_idle_add(parseDataUrl, handle);
-    return true;
-}
-
 static SoupSession* createSoupSession()
 {
     return soup_session_async_new();
@@ -576,17 +486,16 @@ bool ResourceHandle::start(Frame* frame)
     // Used to set the authentication dialog toplevel; may be NULL
     d->m_frame = frame;
 
-    if (equalIgnoringCase(protocol, "data"))
-        return startData(this, urlString);
-
     if (equalIgnoringCase(protocol, "http") || equalIgnoringCase(protocol, "https")) {
         if (startHttp(this))
             return true;
     }
 
-    if (equalIgnoringCase(protocol, "file") || equalIgnoringCase(protocol, "ftp") || equalIgnoringCase(protocol, "ftps")) {
+    if (equalIgnoringCase(protocol, "file") ||
+        equalIgnoringCase(protocol, "ftp") ||
+        equalIgnoringCase(protocol, "data")) {
         // FIXME: should we be doing any other protocols here?
-        if (startGio(this, url))
+        if (startSoupRequest(this, url))
             return true;
     }
 
@@ -644,16 +553,16 @@ void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, S
     syncLoader.run();
 }
 
-// GIO-based loader
+// SoupRequest-based loader
 
-static void cleanupGioOperation(ResourceHandle* handle, bool isDestroying = false)
+static void cleanupSoupRequestOperation(ResourceHandle* handle, bool isDestroying = false)
 {
     ResourceHandleInternal* d = handle->getInternal();
 
-    if (d->m_gfile) {
-        g_object_set_data(G_OBJECT(d->m_gfile), "webkit-resource", 0);
-        g_object_unref(d->m_gfile);
-        d->m_gfile = 0;
+    if (d->m_req) {
+        g_object_set_data(G_OBJECT(d->m_req), "webkit-resource", 0);
+        g_object_unref(d->m_req);
+        d->m_req = 0;
     }
 
     if (d->m_cancellable) {
@@ -686,7 +595,7 @@ static void closeCallback(GObject* source, GAsyncResult* res, gpointer)
     ResourceHandleClient* client = handle->client();
 
     g_input_stream_close_finish(d->m_inputStream, res, 0);
-    cleanupGioOperation(handle.get());
+    cleanupSoupRequestOperation(handle.get());
 
     // The load may have been cancelled, the client may have been
     // destroyed already. In such cases calling didFinishLoading is a
@@ -707,7 +616,7 @@ static void readCallback(GObject* source, GAsyncResult* res, gpointer)
     ResourceHandleClient* client = handle->client();
 
     if (d->m_cancelled || !client) {
-        cleanupGioOperation(handle.get());
+        cleanupSoupRequestOperation(handle.get());
         return;
     }
 
@@ -715,14 +624,15 @@ static void readCallback(GObject* source, GAsyncResult* res, gpointer)
 
     gssize bytesRead = g_input_stream_read_finish(d->m_inputStream, res, &error);
     if (error) {
-        char* uri = g_file_get_uri(d->m_gfile);
+        SoupURI* uri = soup_request_get_uri(d->m_req);
+        char* uristr = soup_uri_to_string(uri, false);
         ResourceError resourceError(g_quark_to_string(G_IO_ERROR),
                                     error->code,
-                                    uri,
+                                    uristr,
                                     error ? String::fromUTF8(error->message) : String());
-        g_free(uri);
+        g_free(uristr);
         g_error_free(error);
-        cleanupGioOperation(handle.get());
+        cleanupSoupRequestOperation(handle.get());
         client->didFail(handle.get(), resourceError);
         return;
     }
@@ -738,56 +648,16 @@ static void readCallback(GObject* source, GAsyncResult* res, gpointer)
 
     // didReceiveData may cancel the load, which may release the last reference.
     if (d->m_cancelled) {
-        cleanupGioOperation(handle.get());
-        return;
-    }
-
-    g_input_stream_read_async(d->m_inputStream, d->m_buffer, d->m_bufferSize,
-                              G_PRIORITY_DEFAULT, d->m_cancellable,
-                              readCallback, 0);
-}
-
-static void openCallback(GObject* source, GAsyncResult* res, gpointer)
-{
-    RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(g_object_get_data(source, "webkit-resource"));
-    if (!handle)
-        return;
-
-    ResourceHandleInternal* d = handle->getInternal();
-    ResourceHandleClient* client = handle->client();
-
-    if (d->m_cancelled || !client) {
-        cleanupGioOperation(handle.get());
+        cleanupSoupRequestOperation(handle.get());
         return;
     }
 
-    GError *error = 0;
-    GFileInputStream* in = g_file_read_finish(G_FILE(source), res, &error);
-    if (error) {
-        char* uri = g_file_get_uri(d->m_gfile);
-        ResourceError resourceError(g_quark_to_string(G_IO_ERROR),
-                                    error->code,
-                                    uri,
-                                    error ? String::fromUTF8(error->message) : String());
-        g_free(uri);
-        g_error_free(error);
-        cleanupGioOperation(handle.get());
-        client->didFail(handle.get(), resourceError);
-        return;
-    }
-
-    d->m_inputStream = G_INPUT_STREAM(in);
-    d->m_bufferSize = 8192;
-    d->m_buffer = static_cast<char*>(g_malloc(d->m_bufferSize));
-    d->m_total = 0;
-
-    g_object_set_data(G_OBJECT(d->m_inputStream), "webkit-resource", handle.get());
     g_input_stream_read_async(d->m_inputStream, d->m_buffer, d->m_bufferSize,
                               G_PRIORITY_DEFAULT, d->m_cancellable,
                               readCallback, 0);
 }
 
-static void queryInfoCallback(GObject* source, GAsyncResult* res, gpointer)
+static void sendRequestCallback(GObject* source, GAsyncResult* res, gpointer)
 {
     RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(g_object_get_data(source, "webkit-resource"));
     if (!handle)
@@ -797,76 +667,67 @@ static void queryInfoCallback(GObject* source, GAsyncResult* res, gpointer)
     ResourceHandleClient* client = handle->client();
 
     if (d->m_cancelled) {
-        cleanupGioOperation(handle.get());
+        cleanupSoupRequestOperation(handle.get());
         return;
     }
 
     ResourceResponse response;
 
-    char* uri = g_file_get_uri(d->m_gfile);
-    response.setURL(KURL(KURL(), uri));
-    g_free(uri);
+    SoupURI* uri = soup_request_get_uri(d->m_req);
+    char* uristr = soup_uri_to_string(uri, false);
+    response.setURL(KURL(KURL(), uristr));
 
     GError *error = 0;
-    GFileInfo* info = g_file_query_info_finish(d->m_gfile, res, &error);
+    GInputStream* in = soup_request_send_finish(d->m_req, res, &error);
 
     if (error) {
-        // FIXME: to be able to handle ftp URIs properly, we must
-        // check if the error is G_IO_ERROR_NOT_MOUNTED, and if so,
-        // call g_file_mount_enclosing_volume() to mount the ftp
-        // server (and then keep track of the fact that we mounted it,
-        // and set a timeout to unmount it later after it's been idle
-        // for a while).
-        char* uri = g_file_get_uri(d->m_gfile);
         ResourceError resourceError(g_quark_to_string(G_IO_ERROR),
                                     error->code,
-                                    uri,
+                                    uristr,
                                     error ? String::fromUTF8(error->message) : String());
-        g_free(uri);
+        g_free(uristr);
         g_error_free(error);
-        cleanupGioOperation(handle.get());
+        cleanupSoupRequestOperation(handle.get());
         client->didFail(handle.get(), resourceError);
         return;
     }
 
-    if (g_file_info_get_file_type(info) != G_FILE_TYPE_REGULAR) {
-        // FIXME: what if the URI points to a directory? Should we
-        // generate a listing? How? What do other backends do here?
-        char* uri = g_file_get_uri(d->m_gfile);
-        ResourceError resourceError(g_quark_to_string(G_IO_ERROR),
-                                    G_IO_ERROR_FAILED,
-                                    uri,
-                                    String());
-        g_free(uri);
-        cleanupGioOperation(handle.get());
-        client->didFail(handle.get(), resourceError);
-        return;
-    }
+    g_free(uristr);
 
-    response.setMimeType(g_file_info_get_content_type(info));
-    response.setExpectedContentLength(g_file_info_get_size(info));
+    response.setMimeType(soup_request_get_content_type(d->m_req));
+    response.setExpectedContentLength(soup_request_get_content_length(d->m_req));
 
+#ifdef FIXME
     GTimeVal tv;
     g_file_info_get_modification_time(info, &tv);
     response.setLastModifiedDate(tv.tv_sec);
+#endif
 
     client->didReceiveResponse(handle.get(), response);
 
     if (d->m_cancelled) {
-        cleanupGioOperation(handle.get());
+        cleanupSoupRequestOperation(handle.get());
         return;
     }
 
-    g_file_read_async(d->m_gfile, G_PRIORITY_DEFAULT, d->m_cancellable,
-                      openCallback, 0);
+    d->m_inputStream = in;
+    d->m_bufferSize = 8192;
+    d->m_buffer = static_cast<char*>(g_malloc(d->m_bufferSize));
+    d->m_total = 0;
+
+    g_object_set_data(G_OBJECT(d->m_inputStream), "webkit-resource", handle.get());
+    g_input_stream_read_async(d->m_inputStream, d->m_buffer, d->m_bufferSize,
+                              G_PRIORITY_DEFAULT, d->m_cancellable,
+                              readCallback, 0);
 }
-static bool startGio(ResourceHandle* handle, KURL url)
+
+static bool startSoupRequest(ResourceHandle* handle, KURL url)
 {
     ASSERT(handle);
 
     ResourceHandleInternal* d = handle->getInternal();
 
-    if (handle->request().httpMethod() != "GET" && handle->request().httpMethod() != "POST")
+    if (handle->request().httpMethod() != "GET")
         return false;
 
     // GIO doesn't know how to handle refs and queries, so remove them
@@ -874,30 +735,21 @@ static bool startGio(ResourceHandle* handle, KURL url)
     // using GIO internally, and providing URIs instead of file paths
     url.removeFragmentIdentifier();
     url.setQuery(String());
-    url.removePort();
-
-#if !PLATFORM(WIN_OS)
-    // we avoid the escaping for local files, because
-    // g_filename_from_uri (used internally by GFile) has problems
-    // decoding strings with arbitrary percent signs
-    if (url.isLocalFile())
-        d->m_gfile = g_file_new_for_path(url.prettyURL().utf8().data() + sizeof("file://") - 1);
-    else
-#endif
-        d->m_gfile = g_file_new_for_uri(url.string().utf8().data());
-    g_object_set_data(G_OBJECT(d->m_gfile), "webkit-resource", handle);
 
-    // balanced by a deref() in cleanupGioOperation, which should always run
+    GError* error = 0;
+    d->m_req = soup_session_request(handle->defaultSession(), url.string().utf8().data(), &error);
+    if (error) {
+        g_error_free(error);
+        return false;
+    }
+    g_object_set_data(G_OBJECT(d->m_req), "webkit-resource", handle);
+
+    // balanced by a deref() in cleanupSoupRequestOperation, which should always run
     handle->ref();
 
     d->m_cancellable = g_cancellable_new();
-    g_file_query_info_async(d->m_gfile,
-                            G_FILE_ATTRIBUTE_STANDARD_TYPE ","
-                            G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
-                            G_FILE_ATTRIBUTE_STANDARD_SIZE,
-                            G_FILE_QUERY_INFO_NONE,
-                            G_PRIORITY_DEFAULT, d->m_cancellable,
-                            queryInfoCallback, 0);
+    soup_request_send_async(d->m_req, d->m_cancellable,
+                            sendRequestCallback, 0);
     return true;
 }
 
