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

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

Issue 470443005: Cronet modifications to support AGSA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Resync. Created 6 years, 4 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: 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 482f175f626527975157ff9f2736fde8f475030d..1c3c3265aa32c122691ad359b4da7bd715abf916 100644
--- a/components/cronet/android/url_request_adapter.h
+++ b/components/cronet/android/url_request_adapter.h
@@ -58,14 +58,22 @@ class URLRequestAdapter : public net::URLRequest::Delegate {
// Sets the contents of the POST or PUT request
void SetUploadContent(const char* bytes, int bytes_len);
// Sets the request to streaming upload.
void SetUploadChannel(JNIEnv* env, int64 content_length);
+ // Indicates that the request body will be streamed by calling AppendChunk()
+ // repeatedly. This must be called before Start().
+ void EnableChunkedUpload();
+
+ // Appends a chunk to the POST body.
+ // This must be called after EnableChunkedUpload() and Start().
+ void AppendChunk(const char* bytes, int bytes_len, bool is_last_chunk);
+
// Starts the request.
void Start();
// Cancels the request.
void Cancel();
// Releases all resources for the request and deletes the object itself.
@@ -112,15 +120,16 @@ class URLRequestAdapter : public net::URLRequest::Delegate {
void OnInitiateConnection();
void OnCancelRequest();
void OnRequestSucceeded();
void OnRequestFailed();
void OnRequestCompleted();
void OnRequestCanceled();
void OnBytesRead(int bytes_read);
- void OnAppendChunk(const char* bytes, int bytes_len, bool is_last_chunk);
+ void OnAppendChunk(const scoped_ptr<char[]> bytes, int bytes_len,
+ bool is_last_chunk);
void Read();
URLRequestContextAdapter* context_;
scoped_refptr<URLRequestAdapterDelegate> delegate_;
GURL url_;
net::RequestPriority priority_;
@@ -132,14 +141,15 @@ class URLRequestAdapter : public net::URLRequest::Delegate {
int bytes_read_;
int total_bytes_read_;
int error_code_;
int http_status_code_;
std::string content_type_;
bool canceled_;
int64 expected_size_;
+ bool chunked_upload_;
DISALLOW_COPY_AND_ASSIGN(URLRequestAdapter);
};
} // namespace cronet
#endif // COMPONENTS_CRONET_ANDROID_URL_REQUEST_ADAPTER_H_

Powered by Google App Engine
This is Rietveld 408576698