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

Side by Side Diff: net/url_request/url_request_status.cc

Issue 1459333002: Revert "Reland: URLRequestJob: change ReadRawData contract" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/url_request/url_request_status.h" 5 #include "net/url_request/url_request_status.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 9
10 namespace net { 10 namespace net {
(...skipping 28 matching lines...) Expand all
39 return URLRequestStatus(SUCCESS, OK); 39 return URLRequestStatus(SUCCESS, OK);
40 } else if (error == ERR_IO_PENDING) { 40 } else if (error == ERR_IO_PENDING) {
41 return URLRequestStatus(IO_PENDING, ERR_IO_PENDING); 41 return URLRequestStatus(IO_PENDING, ERR_IO_PENDING);
42 } else if (error == ERR_ABORTED) { 42 } else if (error == ERR_ABORTED) {
43 return URLRequestStatus(CANCELED, ERR_ABORTED); 43 return URLRequestStatus(CANCELED, ERR_ABORTED);
44 } else { 44 } else {
45 return URLRequestStatus(FAILED, error); 45 return URLRequestStatus(FAILED, error);
46 } 46 }
47 } 47 }
48 48
49 Error URLRequestStatus::ToNetError() const {
50 switch (status_) {
51 case SUCCESS:
52 return OK;
53 case IO_PENDING:
54 return ERR_IO_PENDING;
55 case CANCELED:
56 return ERR_ABORTED;
57 case FAILED:
58 return static_cast<Error>(error_);
59 }
60 NOTREACHED();
61 return ERR_FAILED;
62 }
63
64 } // namespace net 49 } // namespace net
OLDNEW
« 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