Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: third_party/WebKit/public/platform/WebURLLoaderClient.h

Issue 2105713002: Render process changes for ResourceTiming sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resource_timing_sizes_browser_process
Patch Set: Initialise encoded_body_length for sync XHR to data: URLs Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/public/platform/WebURLLoaderClient.h
diff --git a/third_party/WebKit/public/platform/WebURLLoaderClient.h b/third_party/WebKit/public/platform/WebURLLoaderClient.h
index 41b7bee7db94cf0f07c1b382f38b047b64651e6c..9f93cbcc6957dc7248204a69f181227ec86583e2 100644
--- a/third_party/WebKit/public/platform/WebURLLoaderClient.h
+++ b/third_party/WebKit/public/platform/WebURLLoaderClient.h
@@ -45,8 +45,10 @@ class BLINK_PLATFORM_EXPORT WebURLLoaderClient {
public:
// Called when following a redirect. |newRequest| contains the request
// generated by the redirect. The client may modify |newRequest|.
+ // |encodedDataLength| is the size of the data that came from the network
+ // for this redirect, or zero if the redirect was served from cache.
virtual void willFollowRedirect(
- WebURLLoader*, WebURLRequest& newRequest, const WebURLResponse& redirectResponse) { }
+ WebURLLoader*, WebURLRequest& newRequest, const WebURLResponse& redirectResponse, int64_t encodedDataLength) {}
// Called to report upload progress. The bytes reported correspond to
// the HTTP message body.
@@ -68,8 +70,17 @@ public:
// if WebURLRequest's downloadToFile flag was set to true.
virtual void didDownloadData(WebURLLoader*, int dataLength, int encodedDataLength) { }
- // Called when a chunk of response data is received.
- virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength, int encodedDataLength) { }
+ // Called when a chunk of response data is received. |dataLength| is the
+ // number of bytes pointed to by |data|. |encodedDataLength| is the number
+ // of bytes actually received from network to serve this chunk, including
+ // HTTP headers and framing if relevant. It is 0 if the response was served
+ // from cache, and -1 if this information is unavailable.
+ // TODO(ricea): -1 is problematic for consumers maintaining a running
+ // total. Investigate using 0 for all unavailable cases.
+ // |encodedBodyLength| is the number of bytes used to store this chunk,
+ // possibly encrypted, excluding headers or framing. It is set even if the
+ // response was served from cache.
+ virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength, int encodedDataLength, int encodedBodyLength) {}
// Called when a chunk of renderer-generated metadata is received from the cache.
virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) { }
« no previous file with comments | « third_party/WebKit/Source/web/tests/sim/SimRequest.cpp ('k') | third_party/WebKit/public/platform/WebURLResponse.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698