WebKit Bugzilla
Attachment 346738 Details for
Bug 188391
: [Curl] Surface additional NetworkLoadMetrics
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188391.diff (text/plain), 5.79 KB, created by
Don Olmstead
on 2018-08-07 15:19:19 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Don Olmstead
Created:
2018-08-07 15:19:19 PDT
Size:
5.79 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ec38d74d5e8..be1cff8e896 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,13 @@ >+2018-08-07 Don Olmstead <don.olmstead@sony.com> >+ >+ [Curl] Surface additional NetworkLoadMetrics >+ https://bugs.webkit.org/show_bug.cgi?id=188391 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * platform/network/curl/CurlContext.cpp: >+ (WebCore::CurlHandle::getNetworkLoadMetrics): >+ > 2018-08-07 Ryan Haddad <ryanhaddad@apple.com> > > Unreviewed, suppress warnings to fix the build. >diff --git a/Source/WebCore/platform/network/curl/CurlContext.cpp b/Source/WebCore/platform/network/curl/CurlContext.cpp >index 166ee38f5be..4d195332726 100644 >--- a/Source/WebCore/platform/network/curl/CurlContext.cpp >+++ b/Source/WebCore/platform/network/curl/CurlContext.cpp >@@ -77,6 +77,10 @@ constexpr const char* EnvironmentVariableReader::sscanTemplate<signed>() { retur > template<> > constexpr const char* EnvironmentVariableReader::sscanTemplate<unsigned>() { return "%u"; } > >+static const ASCIILiteral http10Protocol { "http/1.0"_s }; >+static const ASCIILiteral http11Protocol { "http/1.1"_s }; >+static const ASCIILiteral http20Protocol { "h2"_s }; >+ > // CurlContext ------------------------------------------------------------------- > > CurlContext& CurlContext::singleton() >@@ -725,6 +729,14 @@ std::optional<NetworkLoadMetrics> CurlHandle::getNetworkLoadMetrics() > double connect = 0.0; > double appConnect = 0.0; > double startTransfer = 0.0; >+ long requestHeaderSize = 0; >+ curl_off_t requestBodySize = 0; >+ long responseHeaderSize = 0; >+ curl_off_t responseBodySize = 0; >+ long version = 0; >+ char* ip = nullptr; >+ long port = 0; >+ long protocol; > > if (!m_handle) > return std::nullopt; >@@ -745,6 +757,35 @@ std::optional<NetworkLoadMetrics> CurlHandle::getNetworkLoadMetrics() > if (errorCode != CURLE_OK) > return std::nullopt; > >+ // FIXME: Gets total request size not just headers https://bugs.webkit.org/show_bug.cgi?id=188363 >+ errorCode = curl_easy_getinfo(m_handle, CURLINFO_REQUEST_SIZE, &requestHeaderSize); >+ if (errorCode != CURLE_OK) >+ return std::nullopt; >+ >+ errorCode = curl_easy_getinfo(m_handle, CURLINFO_SIZE_UPLOAD_T, &requestBodySize); >+ if (errorCode != CURLE_OK) >+ return std::nullopt; >+ >+ errorCode = curl_easy_getinfo(m_handle, CURLINFO_HEADER_SIZE, &responseHeaderSize); >+ if (errorCode != CURLE_OK) >+ return std::nullopt; >+ >+ errorCode = curl_easy_getinfo(m_handle, CURLINFO_SIZE_DOWNLOAD_T, &responseBodySize); >+ if (errorCode != CURLE_OK) >+ return std::nullopt; >+ >+ errorCode = curl_easy_getinfo(m_handle, CURLINFO_PRIMARY_IP, &ip); >+ if (errorCode != CURLE_OK) >+ return std::nullopt; >+ >+ errorCode = curl_easy_getinfo(m_handle, CURLINFO_PRIMARY_PORT, &port); >+ if (errorCode != CURLE_OK) >+ return std::nullopt; >+ >+ errorCode = curl_easy_getinfo(m_handle, CURLINFO_HTTP_VERSION, &version); >+ if (errorCode != CURLE_OK) >+ return std::nullopt; >+ > NetworkLoadMetrics networkLoadMetrics; > > networkLoadMetrics.domainLookupStart = Seconds(0); >@@ -760,6 +801,24 @@ std::optional<NetworkLoadMetrics> CurlHandle::getNetworkLoadMetrics() > networkLoadMetrics.requestStart = networkLoadMetrics.connectEnd; > networkLoadMetrics.responseStart = Seconds(startTransfer); > >+ networkLoadMetrics.requestHeaderBytesSent = requestHeaderSize; >+ networkLoadMetrics.requestBodyBytesSent = requestBodySize; >+ networkLoadMetrics.responseHeaderBytesReceived = responseHeaderSize; >+ networkLoadMetrics.responseBodyBytesReceived = responseBodySize; >+ >+ if (ip) { >+ networkLoadMetrics.remoteAddress = String(ip); >+ if (port) >+ networkLoadMetrics.remoteAddress.append(":" + String::number(port)); >+ } >+ >+ if (version == CURL_HTTP_VERSION_1_0) >+ networkLoadMetrics.protocol = http10Protocol; >+ else if (version == CURL_HTTP_VERSION_1_1) >+ networkLoadMetrics.protocol = http11Protocol; >+ else if (version == CURL_HTTP_VERSION_2_0) >+ networkLoadMetrics.protocol = http20Protocol; >+ > return networkLoadMetrics; > } > >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index d45b39da990..fc01e706a22 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,13 @@ >+2018-08-07 Don Olmstead <don.olmstead@sony.com> >+ >+ [Curl] Surface additional NetworkLoadMetrics >+ https://bugs.webkit.org/show_bug.cgi?id=188391 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * NetworkProcess/curl/NetworkDataTaskCurl.cpp: >+ (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse): >+ > 2018-08-07 Chris Dumez <cdumez@apple.com> > > StorageManager should stop ref'ing IPC::Connections as this is leak-prone >diff --git a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp >index fbc89df0c7a..e7c487f5ee7 100644 >--- a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp >+++ b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp >@@ -147,13 +147,14 @@ void NetworkDataTaskCurl::curlDidSendData(CurlRequest&, unsigned long long total > m_client->didSendData(totalBytesSent, totalBytesExpectedToSend); > } > >-void NetworkDataTaskCurl::curlDidReceiveResponse(CurlRequest&, const CurlResponse& receivedResponse) >+void NetworkDataTaskCurl::curlDidReceiveResponse(CurlRequest& request, const CurlResponse& receivedResponse) > { > auto protectedThis = makeRef(*this); > if (state() == State::Canceling || state() == State::Completed || !m_client) > return; > > m_response = ResourceResponse(receivedResponse); >+ m_response.setDeprecatedNetworkLoadMetrics(request.networkLoadMetrics().isolatedCopy()); > > handleCookieHeaders(receivedResponse); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
joepeck
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188391
:
346737
|
346738
|
346805