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

Unified Diff: net/url_request/url_request_test_util.h

Issue 2262653003: Make URLRequest::Read to return net errors or bytes read instead of a bool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more fixes Created 4 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: net/url_request/url_request_test_util.h
diff --git a/net/url_request/url_request_test_util.h b/net/url_request/url_request_test_util.h
index e7c38b4a149765797157761fc98716b37413ca6d..86d628485190b35ba80cd1450d61c8ff5b6cde5d 100644
--- a/net/url_request/url_request_test_util.h
+++ b/net/url_request/url_request_test_util.h
@@ -180,6 +180,7 @@ class TestDelegate : public URLRequest::Delegate {
return full_request_headers_;
}
void ClearFullRequestHeaders();
+ int request_status() const { return request_status_; }
// URLRequest::Delegate:
void OnReceivedRedirect(URLRequest* request,
@@ -193,6 +194,8 @@ class TestDelegate : public URLRequest::Delegate {
void OnSSLCertificateError(URLRequest* request,
const SSLInfo& ssl_info,
bool fatal) override;
+ void OnResponseStarted(URLRequest* request, int net_error) override;
+ // Deprecated.
void OnResponseStarted(URLRequest* request) override;
void OnReadCompleted(URLRequest* request, int bytes_read) override;
@@ -225,8 +228,14 @@ class TestDelegate : public URLRequest::Delegate {
bool have_full_request_headers_;
HttpRequestHeaders full_request_headers_;
+ // tracks status of request
+ int request_status_;
+
// our read buffer
scoped_refptr<IOBuffer> buf_;
+
+ // Temporarly used to distinguish old and new code.
+ bool old_;
};
//-----------------------------------------------------------------------------
@@ -327,10 +336,14 @@ class TestNetworkDelegate : public NetworkDelegateImpl {
scoped_refptr<HttpResponseHeaders>* override_response_headers,
GURL* allowed_unsafe_redirect_url) override;
void OnBeforeRedirect(URLRequest* request, const GURL& new_location) override;
+ void OnResponseStarted(URLRequest* request, int net_error) override;
+ // Deprecated.
void OnResponseStarted(URLRequest* request) override;
void OnNetworkBytesReceived(URLRequest* request,
int64_t bytes_received) override;
void OnNetworkBytesSent(URLRequest* request, int64_t bytes_sent) override;
+ void OnCompleted(URLRequest* request, bool started, int net_error) override;
+ // Deprecated.
void OnCompleted(URLRequest* request, bool started) override;
void OnURLRequestDestroyed(URLRequest* request) override;
void OnPACScriptError(int line_number, const base::string16& error) override;

Powered by Google App Engine
This is Rietveld 408576698