summaryrefslogtreecommitdiffstats
path: root/net/url_request/url_request_test_job.h
diff options
context:
space:
mode:
authorxunjieli <xunjieli@chromium.org>2015-11-23 11:39:13 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-23 19:40:12 +0000
commit26ede96bb45057dbb767ba41abde6ee29b1fb1de (patch)
treebefaffbcd93b47129fd8a80b2e1649a32505fb5d /net/url_request/url_request_test_job.h
parent6f1a8a68a7a36ccb983242905712d8e8efbdc5fc (diff)
downloadchromium_src-26ede96bb45057dbb767ba41abde6ee29b1fb1de.zip
chromium_src-26ede96bb45057dbb767ba41abde6ee29b1fb1de.tar.gz
chromium_src-26ede96bb45057dbb767ba41abde6ee29b1fb1de.tar.bz2
URLRequestJob: change ReadRawData contract
Previously, the interface for URLRequestJob::ReadRawData was as follows: bool ReadRawData(IOBuffer*, int, int*) Subclasses were expected to signal completion of the ReadRawData call by calling NotifyDone, SetStatus, or maybe one of the other Notify* functions on URLRequestJob, most of which do internal housekeeping and also drive the URLRequest's state machine. This made it difficult to reason about the URLRequestJob's state machine and needlessly complicated most of URLRequestJob. The new interface is as follows: int ReadRawData(IOBuffer*, int) Subclasses are required to either: a) Return ERR_IO_PENDING, and call ReadRawDataComplete when the read completes in any way, or b) Return a count of bytes read >= 0, indicating synchronous success, or c) Return another error code < 0, indicating synchronous failure. This substantially narrows the interface between URLRequestJob and its subclasses and moves the logic for the URLRequest state machine largely into URLRequestJob. Also, the signature of URLRequestJob::ReadFilteredData and some other internal URLRequestJob helpers changes to propagate detailed error codes instead of coercing all errors to FAILED. TBR=michaeln@chromium.org,mnaganov@chromium.org,skyostil@chromium.org,eugenebut@chromium.org,davidben@chromium.org,falken@chromium.org,mtomasz@chromium.org, sky@chromium.org,jianli@chromium.org,zork@chromium.org,rdsmith@chromium.org BUG=553300 Review URL: https://codereview.chromium.org/1467603002 Cr-Commit-Position: refs/heads/master@{#361158}
Diffstat (limited to 'net/url_request/url_request_test_job.h')
-rw-r--r--net/url_request/url_request_test_job.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/url_request/url_request_test_job.h b/net/url_request/url_request_test_job.h
index 09b31a4..eb1db01 100644
--- a/net/url_request/url_request_test_job.h
+++ b/net/url_request/url_request_test_job.h
@@ -111,7 +111,7 @@ class NET_EXPORT_PRIVATE URLRequestTestJob : public URLRequestJob {
// Job functions
void SetPriority(RequestPriority priority) override;
void Start() override;
- bool ReadRawData(IOBuffer* buf, int buf_size, int* bytes_read) override;
+ int ReadRawData(IOBuffer* buf, int buf_size) override;
void Kill() override;
bool GetMimeType(std::string* mime_type) const override;
void GetResponseInfo(HttpResponseInfo* info) override;