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

Unified Diff: components/cronet/android/url_request_adapter.h

Issue 743713002: Cronet Fix Channel Write after Close when request is canceled after success. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Matt's comments. Created 6 years 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: components/cronet/android/url_request_adapter.h
diff --git a/components/cronet/android/url_request_adapter.h b/components/cronet/android/url_request_adapter.h
index 56035eae50ff4a5909d6ed1139a62b4d17de1d78..89376577e69fe8958419fada30911db76936bb37 100644
--- a/components/cronet/android/url_request_adapter.h
+++ b/components/cronet/android/url_request_adapter.h
@@ -17,7 +17,7 @@
#include "net/url_request/url_request.h"
namespace net {
-class GrowableIOBuffer;
+class IOBufferWithSize;
class HttpResponseHeaders;
class UploadDataStream;
struct RedirectInfo;
@@ -36,7 +36,7 @@ class URLRequestAdapter : public net::URLRequest::Delegate {
: public base::RefCountedThreadSafe<URLRequestAdapterDelegate> {
public:
virtual void OnResponseStarted(URLRequestAdapter* request) = 0;
- virtual void OnBytesRead(URLRequestAdapter* request) = 0;
+ virtual void OnBytesRead(URLRequestAdapter* request, int bytes_read) = 0;
virtual void OnRequestFinished(URLRequestAdapter* request) = 0;
virtual int ReadFromUploadChannel(net::IOBuffer* buf, int buf_length) = 0;
@@ -112,9 +112,6 @@ class URLRequestAdapter : public net::URLRequest::Delegate {
// Get all response headers, as a HttpResponseHeaders object.
net::HttpResponseHeaders* GetResponseHeaders() const;
- // Returns the overall number of bytes read.
- size_t bytes_read() const { return bytes_read_; }
-
// Returns a pointer to the downloaded data.
unsigned char* Data() const;
@@ -138,12 +135,11 @@ class URLRequestAdapter : public net::URLRequest::Delegate {
void OnRequestSucceeded();
void OnRequestFailed();
void OnRequestCompleted();
- void OnRequestCanceled();
- void OnBytesRead(int bytes_read);
void OnAppendChunk(const scoped_ptr<char[]> bytes, int bytes_len,
bool is_last_chunk);
void Read();
+ bool HandleReadResult(net::URLRequest* request, int bytes_read);
mmenke 2014/12/10 20:59:14 Document this method.
mmenke 2014/12/10 20:59:14 No need to pass in the request, since it's always
mef 2014/12/10 23:23:36 Done.
URLRequestContextAdapter* context_;
scoped_refptr<URLRequestAdapterDelegate> delegate_;
@@ -153,8 +149,7 @@ class URLRequestAdapter : public net::URLRequest::Delegate {
net::HttpRequestHeaders headers_;
scoped_ptr<net::URLRequest> url_request_;
scoped_ptr<net::UploadDataStream> upload_data_stream_;
- scoped_refptr<net::GrowableIOBuffer> read_buffer_;
- int bytes_read_;
+ scoped_refptr<net::IOBufferWithSize> read_buffer_;
int total_bytes_read_;
int error_code_;
int http_status_code_;

Powered by Google App Engine
This is Rietveld 408576698