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

Unified Diff: net/http/http_stream_base.h

Issue 403393003: HTTP retry support. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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: net/http/http_stream_base.h
diff --git a/net/http/http_stream_base.h b/net/http/http_stream_base.h
index 76e57ef8ff883bba74882792597f4b934116e67f..c6a99056a60e104715537f71a0c5df40b795365d 100644
--- a/net/http/http_stream_base.h
+++ b/net/http/http_stream_base.h
@@ -122,6 +122,9 @@ class NET_EXPORT_PRIVATE HttpStreamBase {
// Get the total number of bytes received from network for this stream.
virtual int64 GetTotalReceivedBytes() const = 0;
+ // Get the total number of body bytes received from network for this stream.
+ virtual int64 GetReceivedBodyLength() const = 0;
mmenke 2014/07/22 14:57:41 Why are these in the HttpStreamBase class, and not
jonnyr 2014/07/23 08:43:05 I could not do this in HttpNetworkTransaction sinc
mmenke 2014/07/23 15:08:40 I'm not following why this doesn't work. In HttpN
+
// Populates the connection establishment part of |load_timing_info|, and
// socket ID. |load_timing_info| must have all null times when called.
// Returns false and does nothing if there is no underlying connection, either
@@ -156,6 +159,16 @@ class NET_EXPORT_PRIVATE HttpStreamBase {
// Called when the priority of the parent transaction changes.
virtual void SetPriority(RequestPriority priority) = 0;
+ // If restarting a request where a part of the body has already been
+ // received, set where we should start reading from, previous content length
+ // and hash of previous response.
+ virtual void SetRestartInfo(int64 read_offset, const void* hash,
+ size_t hash_length) = 0;
+
+ // If restarting a request where a part of the body has already been received,
+ // retrieve the hash so that this can be verified on retry.
+ virtual void GetHash(void* output, size_t hash_length) = 0;
+
private:
DISALLOW_COPY_AND_ASSIGN(HttpStreamBase);
};

Powered by Google App Engine
This is Rietveld 408576698