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

Unified Diff: net/http/http_response_body_drainer.h

Issue 8591037: Implement Drain() on HttpPipelinedStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More tests Created 9 years, 1 month 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_response_body_drainer.h
diff --git a/net/http/http_response_body_drainer.h b/net/http/http_response_body_drainer.h
index cdcd65cc245ce4544a99c34fc8d356d830cf2db2..859fd17441e444c73e78b09b4e5ea767e0727955 100644
--- a/net/http/http_response_body_drainer.h
+++ b/net/http/http_response_body_drainer.h
@@ -36,6 +36,9 @@ class NET_EXPORT_PRIVATE HttpResponseBodyDrainer {
// doesn't complete immediately, it will add itself to |session|.
void Start(HttpNetworkSession* session);
+ // As above, but stop reading once |num_bytes_to_drain| has been reached.
+ void StartWithSize(HttpNetworkSession* session, int num_bytes_to_drain);
+
private:
enum State {
STATE_DRAIN_RESPONSE_BODY,
@@ -52,6 +55,7 @@ class NET_EXPORT_PRIVATE HttpResponseBodyDrainer {
void OnTimerFired();
void Finish(int result);
+ int read_size_;
scoped_refptr<IOBuffer> read_buf_;
const scoped_ptr<HttpStream> stream_;
State next_state_;

Powered by Google App Engine
This is Rietveld 408576698