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

Unified Diff: net/url_request/url_request_status.cc

Issue 1439953006: Reland: URLRequestJob: change ReadRawData contract (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address David's comment Created 5 years, 1 month 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
« no previous file with comments | « net/url_request/url_request_status.h ('k') | net/url_request/url_request_test_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_status.cc
diff --git a/net/url_request/url_request_status.cc b/net/url_request/url_request_status.cc
index 2a6a2fae861c202a51fc677558a7f3584c286373..7207df2fa52818dab4c6da7f0319f3c37b75565f 100644
--- a/net/url_request/url_request_status.cc
+++ b/net/url_request/url_request_status.cc
@@ -46,4 +46,19 @@ URLRequestStatus URLRequestStatus::FromError(int error) {
}
}
+Error URLRequestStatus::ToNetError() const {
+ switch (status_) {
+ case SUCCESS:
+ return OK;
+ case IO_PENDING:
+ return ERR_IO_PENDING;
+ case CANCELED:
+ return ERR_ABORTED;
+ case FAILED:
+ return static_cast<Error>(error_);
+ }
+ NOTREACHED();
+ return ERR_FAILED;
+}
+
} // namespace net
« no previous file with comments | « net/url_request/url_request_status.h ('k') | net/url_request/url_request_test_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698