Avi Drissman | 6459548 | 2022-09-14 20:52:29 | [diff] [blame] | 1 | // Copyright 2015 The Chromium Authors |
zhongyi | 48704c18 | 2015-12-07 07:52:02 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef NET_BASE_NET_ERROR_DETAILS_H_ |
| 6 | #define NET_BASE_NET_ERROR_DETAILS_H_ |
| 7 | |
bnc | 81c46c1f | 2016-10-04 16:25:59 | [diff] [blame] | 8 | #include "net/base/net_export.h" |
Tsuyoshi Horo | 3023b5d | 2023-11-28 21:40:31 | [diff] [blame] | 9 | #include "net/http/http_connection_info.h" |
Ryan Hamilton | ea4fa19 | 2022-04-12 18:30:49 | [diff] [blame] | 10 | #include "net/third_party/quiche/src/quiche/quic/core/quic_error_codes.h" |
Mohannad Farrag | bc22ca5 | 2024-07-02 00:17:55 | [diff] [blame] | 11 | #include "net/third_party/quiche/src/quiche/quic/core/quic_types.h" |
zhongyi | 48704c18 | 2015-12-07 07:52:02 | [diff] [blame] | 12 | |
| 13 | namespace net { |
| 14 | |
| 15 | // A record of net errors with granular error specification generated by |
| 16 | // net stack. |
| 17 | struct NET_EXPORT NetErrorDetails { |
zhongyi | ca364fbb | 2015-12-12 03:39:12 | [diff] [blame] | 18 | NetErrorDetails() |
Tsuyoshi Horo | 432981d5 | 2022-06-09 09:50:13 | [diff] [blame] | 19 | : quic_broken(false), quic_connection_error(quic::QUIC_NO_ERROR) {} |
zhongyi | 48704c18 | 2015-12-07 07:52:02 | [diff] [blame] | 20 | |
Ryan Hamilton | 8d9ee76e | 2018-05-29 23:52:52 | [diff] [blame] | 21 | NetErrorDetails(bool quic_broken, quic::QuicErrorCode quic_connection_error) |
zhongyi | ca364fbb | 2015-12-12 03:39:12 | [diff] [blame] | 22 | : quic_broken(quic_broken), |
Tsuyoshi Horo | 432981d5 | 2022-06-09 09:50:13 | [diff] [blame] | 23 | quic_connection_error(quic_connection_error) {} |
zhongyi | 48704c18 | 2015-12-07 07:52:02 | [diff] [blame] | 24 | |
| 25 | // True if all QUIC alternative services are marked broken for the origin. |
| 26 | bool quic_broken; |
zhongyi | ca364fbb | 2015-12-12 03:39:12 | [diff] [blame] | 27 | // QUIC granular error info. |
Ryan Hamilton | 8d9ee76e | 2018-05-29 23:52:52 | [diff] [blame] | 28 | quic::QuicErrorCode quic_connection_error; |
Mohannad Farrag | bc22ca5 | 2024-07-02 00:17:55 | [diff] [blame] | 29 | // Source of the connection close. |
| 30 | quic::ConnectionCloseSource source = quic::ConnectionCloseSource::FROM_SELF; |
zhongyi | 2ed4a6a | 2016-02-26 19:45:42 | [diff] [blame] | 31 | // Early prediction of the connection type that this request attempts to use. |
| 32 | // Will be discarded by upper layers if the connection type can be fetched |
| 33 | // from response header from the server. |
Tsuyoshi Horo | 3023b5d | 2023-11-28 21:40:31 | [diff] [blame] | 34 | HttpConnectionInfo connection_info = HttpConnectionInfo::kUNKNOWN; |
zhongyi | 6b5a389 | 2016-03-12 04:46:20 | [diff] [blame] | 35 | // True if receives a GoAway frame from the server due to connection |
| 36 | // migration with port change. |
Tsuyoshi Horo | 432981d5 | 2022-06-09 09:50:13 | [diff] [blame] | 37 | bool quic_port_migration_detected = false; |
Stefano Duo | 69dc6a3 | 2022-07-13 12:08:30 | [diff] [blame] | 38 | bool quic_connection_migration_attempted = false; |
| 39 | bool quic_connection_migration_successful = false; |
zhongyi | 48704c18 | 2015-12-07 07:52:02 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | } // namespace net |
| 43 | |
bnc | 3698b0a0 | 2016-12-09 23:36:50 | [diff] [blame] | 44 | #endif // NET_BASE_NET_ERROR_DETAILS_H_ |