OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_QUIC_QUIC_PROTOCOL_H_ | 5 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ |
6 #define NET_QUIC_QUIC_PROTOCOL_H_ | 6 #define NET_QUIC_QUIC_PROTOCOL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <limits> | 9 #include <limits> |
10 #include <map> | 10 #include <map> |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 enum WriteStatus { | 1009 enum WriteStatus { |
1010 WRITE_STATUS_OK, | 1010 WRITE_STATUS_OK, |
1011 WRITE_STATUS_BLOCKED, | 1011 WRITE_STATUS_BLOCKED, |
1012 WRITE_STATUS_ERROR, | 1012 WRITE_STATUS_ERROR, |
1013 }; | 1013 }; |
1014 | 1014 |
1015 // A struct used to return the result of write calls including either the number | 1015 // A struct used to return the result of write calls including either the number |
1016 // of bytes written or the error code, depending upon the status. | 1016 // of bytes written or the error code, depending upon the status. |
1017 struct NET_EXPORT_PRIVATE WriteResult { | 1017 struct NET_EXPORT_PRIVATE WriteResult { |
1018 WriteResult(WriteStatus status, int bytes_written_or_error_code); | 1018 WriteResult(WriteStatus status, int bytes_written_or_error_code); |
| 1019 WriteResult(); |
1019 | 1020 |
1020 WriteStatus status; | 1021 WriteStatus status; |
1021 union { | 1022 union { |
1022 int bytes_written; // only valid when status is OK | 1023 int bytes_written; // only valid when status is OK |
1023 int error_code; // only valid when status is ERROR | 1024 int error_code; // only valid when status is ERROR |
1024 }; | 1025 }; |
1025 }; | 1026 }; |
1026 | 1027 |
1027 } // namespace net | 1028 } // namespace net |
1028 | 1029 |
1029 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1030 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |