Skip to content

Commit

Permalink
Merge r180928 - [SOUP] Use SoupMessage::starting instead of SoupSessi…
Browse files Browse the repository at this point in the history
…on::request-started

https://bugs.webkit.org/show_bug.cgi?id=142164

Reviewed by Sergio Villar Senin.

SoupSession::request-started is deprecated in libsoup 2.50. Both
signals are equivalent, but SoupMessage::starting is also emitted
for resources loaded from the disk cache. This fixes web timing
calculations for cached resources, since we were not initializing
m_requestStart.

* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::startingCallback):
(WebCore::createSoupMessageForHandleAndRequest):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession):

Canonical link: https://commits.webkit.org/154760.318@webkitgtk/2.6
git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@182404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carlosgcampos committed Apr 6, 2015
1 parent cd49bab commit 004a501
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
19 changes: 19 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,22 @@
2015-03-02 Carlos Garcia Campos <cgarcia@igalia.com>

[SOUP] Use SoupMessage::starting instead of SoupSession::request-started
https://bugs.webkit.org/show_bug.cgi?id=142164

Reviewed by Sergio Villar Senin.

SoupSession::request-started is deprecated in libsoup 2.50. Both
signals are equivalent, but SoupMessage::starting is also emitted
for resources loaded from the disk cache. This fixes web timing
calculations for cached resources, since we were not initializing
m_requestStart.

* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::startingCallback):
(WebCore::createSoupMessageForHandleAndRequest):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession):

2015-03-04 Philippe Normand <pnormand@igalia.com>

[GStreamer] the GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED should be wrapped by a ifdef
Expand Down
10 changes: 10 additions & 0 deletions Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
Expand Up @@ -838,6 +838,13 @@ void ResourceHandle::didStartRequest()
getInternal()->m_response.resourceLoadTiming().requestStart = milisecondsSinceRequest(m_requestTime);
}

#if SOUP_CHECK_VERSION(2, 49, 91)
static void startingCallback(SoupMessage*, ResourceHandle* handle)
{
handle->didStartRequest();
}
#endif // SOUP_CHECK_VERSION(2, 49, 91)

static void networkEventCallback(SoupMessage*, GSocketClientEvent event, GIOStream*, gpointer data)
{
ResourceHandle* handle = static_cast<ResourceHandle*>(data);
Expand Down Expand Up @@ -946,6 +953,9 @@ static bool createSoupMessageForHandleAndRequest(ResourceHandle* handle, const R
soup_message_set_flags(d->m_soupMessage.get(), static_cast<SoupMessageFlags>(soup_message_get_flags(d->m_soupMessage.get()) | flags));

#if ENABLE(WEB_TIMING)
#if SOUP_CHECK_VERSION(2, 49, 91)
g_signal_connect(d->m_soupMessage.get(), "starting", G_CALLBACK(startingCallback), handle);
#endif
g_signal_connect(d->m_soupMessage.get(), "network-event", G_CALLBACK(networkEventCallback), handle);
g_signal_connect(d->m_soupMessage.get(), "restarted", G_CALLBACK(restartedCallback), handle);
#endif
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/platform/network/soup/SoupNetworkSession.cpp
Expand Up @@ -81,7 +81,7 @@ static void authenticateCallback(SoupSession* session, SoupMessage* soupMessage,
handle->didReceiveAuthenticationChallenge(AuthenticationChallenge(session, soupMessage, soupAuth, retrying, handle.get()));
}

#if ENABLE(WEB_TIMING)
#if ENABLE(WEB_TIMING) && !SOUP_CHECK_VERSION(2, 49, 91)
static void requestStartedCallback(SoupSession*, SoupMessage* soupMessage, SoupSocket*, gpointer)
{
RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(g_object_get_data(G_OBJECT(soupMessage), "handle"));
Expand Down Expand Up @@ -114,7 +114,7 @@ SoupNetworkSession::SoupNetworkSession(SoupCookieJar* cookieJar)
setupLogger();

g_signal_connect(m_soupSession.get(), "authenticate", G_CALLBACK(authenticateCallback), nullptr);
#if ENABLE(WEB_TIMING)
#if ENABLE(WEB_TIMING) && !SOUP_CHECK_VERSION(2, 49, 91)
g_signal_connect(m_soupSession.get(), "request-started", G_CALLBACK(requestStartedCallback), nullptr);
#endif
}
Expand Down

0 comments on commit 004a501

Please sign in to comment.