class GrowableIOBuffer;
class HttpResponseHeaders;
class UploadDataStream;
+class RedirectInfo;
} // namespace net
namespace cronet {
// Sets the request to streaming upload.
void SetUploadChannel(JNIEnv* env, int64 content_length);
+ // Disables redirect. Note that redirect is enabled by default.
+ void DisableRedirects();
+
// Indicates that the request body will be streamed by calling AppendChunk()
// repeatedly. This must be called before Start().
void EnableChunkedUpload();
return http_status_code_;
};
+ // Returns the HTTP status text of the normalized status line.
+ const std::string& http_status_text() const {
+ return http_status_text_;
+ }
+
// Returns the value of the content-length response header.
int64 content_length() const { return expected_size_; }
// Get NPN or ALPN Negotiated Protocol (if any) from HttpResponseInfo.
std::string GetNegotiatedProtocol() const;
- virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE;
+ // net::URLRequest::Delegate implementation:
+ void OnResponseStarted(net::URLRequest* request) override;
+ void OnReadCompleted(net::URLRequest* request, int bytes_read) override;
+ void OnReceivedRedirect(net::URLRequest* request,
+ const net::RedirectInfo& redirect_info,
+ bool* defer_redirect) override;
- virtual void OnReadCompleted(net::URLRequest* request,
- int bytes_read) OVERRIDE;
+ bool OnNetworkThread() const;
private:
static void OnDestroyRequest(URLRequestAdapter* self);
int total_bytes_read_;
int error_code_;
int http_status_code_;
+ std::string http_status_text_;
std::string content_type_;
bool canceled_;
int64 expected_size_;
bool chunked_upload_;
+ // Indicates whether redirect has been disabled.
+ bool disable_redirect_;
DISALLOW_COPY_AND_ASSIGN(URLRequestAdapter);
};