Title: [160961] trunk/Source/WebCore
Revision
160961
Author
carlo...@webkit.org
Date
2013-12-21 00:51:07 -0800 (Sat, 21 Dec 2013)

Log Message

[SOUP] ResourceHandleSoup should use async client callbacks when client uses async callbacks
https://bugs.webkit.org/show_bug.cgi?id=126006

Reviewed by Martin Robinson.

This fixes WebKit2 loader client unit tests when using the network
process.

* platform/network/ResourceHandle.cpp:
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::doRedirect): Call willSendRequestAsync on the client
when usesAsyncCallbacks returns true.
(WebCore::nextMultipartResponsePartCallback): Call
didReceiveResponseAsync on the client when usesAsyncCallbacks
returns true.
(WebCore::sendRequestCallback): Ditto.
(WebCore::ResourceHandle::continueWillSendRequest): Empty
implementation for now because the default one asserts.
(WebCore::ResourceHandle::continueDidReceiveResponse): Ditto.
(WebCore::ResourceHandle::continueShouldUseCredentialStorage): Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (160960 => 160961)


--- trunk/Source/WebCore/ChangeLog	2013-12-21 07:11:59 UTC (rev 160960)
+++ trunk/Source/WebCore/ChangeLog	2013-12-21 08:51:07 UTC (rev 160961)
@@ -1,3 +1,26 @@
+2013-12-21  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        [SOUP] ResourceHandleSoup should use async client callbacks when client uses async callbacks
+        https://bugs.webkit.org/show_bug.cgi?id=126006
+
+        Reviewed by Martin Robinson.
+
+        This fixes WebKit2 loader client unit tests when using the network
+        process.
+
+        * platform/network/ResourceHandle.cpp:
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::doRedirect): Call willSendRequestAsync on the client
+        when usesAsyncCallbacks returns true.
+        (WebCore::nextMultipartResponsePartCallback): Call
+        didReceiveResponseAsync on the client when usesAsyncCallbacks
+        returns true.
+        (WebCore::sendRequestCallback): Ditto.
+        (WebCore::ResourceHandle::continueWillSendRequest): Empty
+        implementation for now because the default one asserts.
+        (WebCore::ResourceHandle::continueDidReceiveResponse): Ditto.
+        (WebCore::ResourceHandle::continueShouldUseCredentialStorage): Ditto.
+
 2013-12-20  Anders Carlsson  <ander...@apple.com>
 
         Replace yield() and pauseBriefly() with std::this_thread::yield()

Modified: trunk/Source/WebCore/platform/network/ResourceHandle.cpp (160960 => 160961)


--- trunk/Source/WebCore/platform/network/ResourceHandle.cpp	2013-12-21 07:11:59 UTC (rev 160960)
+++ trunk/Source/WebCore/platform/network/ResourceHandle.cpp	2013-12-21 08:51:07 UTC (rev 160961)
@@ -147,7 +147,7 @@
     d->m_client = client;
 }
 
-#if !PLATFORM(MAC) && !USE(CFNETWORK)
+#if !PLATFORM(MAC) && !USE(CFNETWORK) && !USE(SOUP)
 // ResourceHandle never uses async client calls on these platforms yet.
 void ResourceHandle::continueWillSendRequest(const ResourceRequest&)
 {

Modified: trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp (160960 => 160961)


--- trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp	2013-12-21 07:11:59 UTC (rev 160960)
+++ trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp	2013-12-21 08:51:07 UTC (rev 160961)
@@ -511,7 +511,10 @@
     // the WebKit layer. They were only placed in the URL for the benefit of libsoup.
     newRequest.removeCredentials();
 
-    d->client()->willSendRequest(handle, newRequest, d->m_response);
+    if (d->client()->usesAsyncCallbacks())
+        d->client()->willSendRequestAsync(handle, newRequest, d->m_response);
+    else
+        d->client()->willSendRequest(handle, newRequest, d->m_response);
     handle->sendPendingRequest();
 }
 
@@ -649,7 +652,10 @@
     d->m_response.setURL(handle->firstRequest().url());
     d->m_response.updateFromSoupMessageHeaders(soup_multipart_input_stream_get_headers(d->m_multipartInputStream.get()));
 
-    handle->client()->didReceiveResponse(handle.get(), d->m_response);
+    if (handle->client()->usesAsyncCallbacks())
+        handle->client()->didReceiveResponseAsync(handle.get(), d->m_response);
+    else
+        handle->client()->didReceiveResponse(handle.get(), d->m_response);
 
     if (handle->cancelledOrClientless()) {
         cleanupSoupRequestOperation(handle.get());
@@ -716,7 +722,10 @@
         d->m_response.setExpectedContentLength(soup_request_get_content_length(d->m_soupRequest.get()));
     }
 
-    handle->client()->didReceiveResponse(handle.get(), d->m_response);
+    if (d->client()->usesAsyncCallbacks())
+        handle->client()->didReceiveResponseAsync(handle.get(), d->m_response);
+    else
+        handle->client()->didReceiveResponse(handle.get(), d->m_response);
 
     if (handle->cancelledOrClientless()) {
         cleanupSoupRequestOperation(handle.get());
@@ -1370,6 +1379,27 @@
         d->m_cancellable.get(), readCallback, handle.get());
 }
 
+void ResourceHandle::continueWillSendRequest(const ResourceRequest& request)
+{
+    ASSERT(client());
+    ASSERT(client()->usesAsyncCallbacks());
+    // FIXME: Implement this method if needed: https://bugs.webkit.org/show_bug.cgi?id=126114.
+}
+
+void ResourceHandle::continueDidReceiveResponse()
+{
+    ASSERT(client());
+    ASSERT(client()->usesAsyncCallbacks());
+    // FIXME: Implement this method if needed: https://bugs.webkit.org/show_bug.cgi?id=126114.
+}
+
+void ResourceHandle::continueShouldUseCredentialStorage(bool)
+{
+    ASSERT(client());
+    ASSERT(client()->usesAsyncCallbacks());
+    // FIXME: Implement this method if needed: https://bugs.webkit.org/show_bug.cgi?id=126114.
+}
+
 static gboolean requestTimeoutCallback(gpointer data)
 {
     RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to