Title: [151493] trunk/Source/WebCore
Revision
151493
Author
ser...@webkit.org
Date
2013-06-12 04:34:01 -0700 (Wed, 12 Jun 2013)

Log Message

[Soup] Use ResourceLoadPriority
https://bugs.webkit.org/show_bug.cgi?id=112902

Reviewed by Carlos Garcia Campos.

Use the ResourceLoadPriority from the ResourceRequest to set the
correnpondent priority to each SoupMessage.

No new tests required as there is no change in functionality,
we're just enabling a new feature in the underlying network stack.

* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::createSoupMessageForHandleAndRequest):
* platform/network/soup/ResourceRequest.h:
(WebCore):
(WebCore::toSoupMessagePriority): Translates ResourceLoadPriority
to SoupMessagePriority.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (151492 => 151493)


--- trunk/Source/WebCore/ChangeLog	2013-06-12 08:51:48 UTC (rev 151492)
+++ trunk/Source/WebCore/ChangeLog	2013-06-12 11:34:01 UTC (rev 151493)
@@ -1,3 +1,23 @@
+2013-06-12  Sergio Villar Senin  <svil...@igalia.com>
+
+        [Soup] Use ResourceLoadPriority
+        https://bugs.webkit.org/show_bug.cgi?id=112902
+
+        Reviewed by Carlos Garcia Campos.
+
+        Use the ResourceLoadPriority from the ResourceRequest to set the
+        correnpondent priority to each SoupMessage.
+
+        No new tests required as there is no change in functionality,
+        we're just enabling a new feature in the underlying network stack.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::createSoupMessageForHandleAndRequest):
+        * platform/network/soup/ResourceRequest.h:
+        (WebCore):
+        (WebCore::toSoupMessagePriority): Translates ResourceLoadPriority
+        to SoupMessagePriority.
+
 2013-06-12  Zan Dobersek  <zdober...@igalia.com>
 
         Remove memoryInfoEnabled, quantizedMemoryInfoEnabled settings

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


--- trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp	2013-06-12 08:51:48 UTC (rev 151492)
+++ trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp	2013-06-12 11:34:01 UTC (rev 151493)
@@ -985,6 +985,10 @@
     g_signal_connect(d->m_soupMessage.get(), "wrote-body", G_CALLBACK(wroteBodyCallback), handle);
 #endif
 
+#if SOUP_CHECK_VERSION(2, 43, 1)
+    soup_message_set_priority(d->m_soupMessage.get(), toSoupMessagePriority(request.priority()));
+#endif
+
     return true;
 }
 

Modified: trunk/Source/WebCore/platform/network/soup/ResourceRequest.h (151492 => 151493)


--- trunk/Source/WebCore/platform/network/soup/ResourceRequest.h	2013-06-12 08:51:48 UTC (rev 151492)
+++ trunk/Source/WebCore/platform/network/soup/ResourceRequest.h	2013-06-12 11:34:01 UTC (rev 151493)
@@ -97,6 +97,29 @@
     struct CrossThreadResourceRequestData : public CrossThreadResourceRequestDataBase {
     };
 
+#if SOUP_CHECK_VERSION(2, 43, 1)
+inline SoupMessagePriority toSoupMessagePriority(ResourceLoadPriority priority)
+{
+    switch (priority) {
+    case ResourceLoadPriorityUnresolved:
+        return SOUP_MESSAGE_PRIORITY_NORMAL;
+    case ResourceLoadPriorityVeryLow:
+        return SOUP_MESSAGE_PRIORITY_VERY_LOW;
+    case ResourceLoadPriorityLow:
+        return SOUP_MESSAGE_PRIORITY_LOW;
+    case ResourceLoadPriorityMedium:
+        return SOUP_MESSAGE_PRIORITY_NORMAL;
+    case ResourceLoadPriorityHigh:
+        return SOUP_MESSAGE_PRIORITY_HIGH;
+    case ResourceLoadPriorityVeryHigh:
+        return SOUP_MESSAGE_PRIORITY_VERY_HIGH;
+    }
+
+    ASSERT_NOT_REACHED();
+    return SOUP_MESSAGE_PRIORITY_VERY_LOW;
+}
+#endif
+
 } // namespace WebCore
 
 #endif // ResourceRequest_h
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to