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 // This file's dependencies should be kept to a minimum so that it can be | 5 // This file's dependencies should be kept to a minimum so that it can be |
6 // included in WebKit code that doesn't rely on much of common. | 6 // included in WebKit code that doesn't rely on much of common. |
7 | 7 |
8 #ifndef NET_URL_REQUEST_URL_REQUEST_STATUS_H_ | 8 #ifndef NET_URL_REQUEST_URL_REQUEST_STATUS_H_ |
9 #define NET_URL_REQUEST_URL_REQUEST_STATUS_H_ | 9 #define NET_URL_REQUEST_URL_REQUEST_STATUS_H_ |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 int error() const { return error_; } | 38 int error() const { return error_; } |
39 void set_error(int e) { error_ = e; } | 39 void set_error(int e) { error_ = e; } |
40 | 40 |
41 // Returns true if the status is success, which makes some calling code more | 41 // Returns true if the status is success, which makes some calling code more |
42 // convenient because this is the most common test. | 42 // convenient because this is the most common test. |
43 bool is_success() const { | 43 bool is_success() const { |
44 return status_ == SUCCESS || status_ == IO_PENDING; | 44 return status_ == SUCCESS || status_ == IO_PENDING; |
45 } | 45 } |
46 | 46 |
47 // Returns true if the request is waiting for IO. | 47 // Returns true if the request is waiting for IO. |
48 bool is_io_pending() const { | 48 bool is_io_pending() const { return status_ == IO_PENDING; } |
49 return status_ == IO_PENDING; | |
50 } | |
51 | 49 |
52 private: | 50 private: |
53 // Application level status. | 51 // Application level status. |
54 Status status_; | 52 Status status_; |
55 | 53 |
56 // Error code from the network layer if an error was encountered. | 54 // Error code from the network layer if an error was encountered. |
57 int error_; | 55 int error_; |
58 }; | 56 }; |
59 | 57 |
60 } // namespace net | 58 } // namespace net |
61 | 59 |
62 #endif // NET_URL_REQUEST_URL_REQUEST_STATUS_H_ | 60 #endif // NET_URL_REQUEST_URL_REQUEST_STATUS_H_ |
OLD | NEW |