| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_URL_REQUEST_URL_REQUEST_STATUS_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_STATUS_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_STATUS_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_STATUS_H_ |
| 7 | 7 |
| 8 #include "net/base/net_export.h" | 8 #include "net/base/net_export.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 // The request failed for some reason. |error_| may have more information. | 27 // The request failed for some reason. |error_| may have more information. |
| 28 FAILED, | 28 FAILED, |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 // Creates a successful URLRequestStatus. | 31 // Creates a successful URLRequestStatus. |
| 32 URLRequestStatus() : status_(SUCCESS), error_(0) {} | 32 URLRequestStatus() : status_(SUCCESS), error_(0) {} |
| 33 | 33 |
| 34 // Creates a URLRequestStatus with specified status and error parameters. New | 34 // Creates a URLRequestStatus with specified status and error parameters. New |
| 35 // consumers should use URLRequestStatus::FromError instead. | 35 // consumers should use URLRequestStatus::FromError instead. |
| 36 URLRequestStatus(Status status, int error) : status_(status), error_(error) {} | 36 URLRequestStatus(Status status, int error); |
| 37 | 37 |
| 38 // Creates a URLRequestStatus, initializing the status from |error|. OK maps | 38 // Creates a URLRequestStatus, initializing the status from |error|. OK maps |
| 39 // to SUCCESS, ERR_IO_PENDING maps to IO_PENDING, ERR_ABORTED maps to CANCELED | 39 // to SUCCESS, ERR_IO_PENDING maps to IO_PENDING, ERR_ABORTED maps to CANCELED |
| 40 // and all others map to FAILED. Other combinations of status and error are | 40 // and all others map to FAILED. Other combinations of status and error are |
| 41 // deprecated. See https://crbug.com/490311. | 41 // deprecated. See https://crbug.com/490311. |
| 42 static URLRequestStatus FromError(int error); | 42 static URLRequestStatus FromError(int error); |
| 43 | 43 |
| 44 Status status() const { return status_; } | 44 Status status() const { return status_; } |
| 45 int error() const { return error_; } | 45 int error() const { return error_; } |
| 46 | 46 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 59 // Application level status. | 59 // Application level status. |
| 60 Status status_; | 60 Status status_; |
| 61 | 61 |
| 62 // Error code from the network layer if an error was encountered. | 62 // Error code from the network layer if an error was encountered. |
| 63 int error_; | 63 int error_; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace net | 66 } // namespace net |
| 67 | 67 |
| 68 #endif // NET_URL_REQUEST_URL_REQUEST_STATUS_H_ | 68 #endif // NET_URL_REQUEST_URL_REQUEST_STATUS_H_ |
| OLD | NEW |