| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // This file contains data structures and utility functions used for serializing | 5 // This file contains data structures and utility functions used for serializing |
| 6 // and parsing alternative service header values, common to HTTP/1.1 header | 6 // and parsing alternative service header values, common to HTTP/1.1 header |
| 7 // fields and HTTP/2 and QUIC ALTSVC frames. See specification at | 7 // fields and HTTP/2 and QUIC ALTSVC frames. See specification at |
| 8 // https://httpwg.github.io/http-extensions/alt-svc.html. | 8 // https://httpwg.github.io/http-extensions/alt-svc.html. |
| 9 | 9 |
| 10 #ifndef NET_SPDY_CORE_SPDY_ALT_SVC_WIRE_FORMAT_H_ | 10 #ifndef NET_SPDY_CORE_SPDY_ALT_SVC_WIRE_FORMAT_H_ |
| 11 #define NET_SPDY_CORE_SPDY_ALT_SVC_WIRE_FORMAT_H_ | 11 #define NET_SPDY_CORE_SPDY_ALT_SVC_WIRE_FORMAT_H_ |
| 12 | 12 |
| 13 #include <cstdint> | 13 #include <cstdint> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "net/base/net_export.h" | 16 #include "net/spdy/platform/api/spdy_export.h" |
| 17 #include "net/spdy/platform/api/spdy_string.h" | 17 #include "net/spdy/platform/api/spdy_string.h" |
| 18 #include "net/spdy/platform/api/spdy_string_piece.h" | 18 #include "net/spdy/platform/api/spdy_string_piece.h" |
| 19 | 19 |
| 20 namespace net { | 20 namespace net { |
| 21 | 21 |
| 22 namespace test { | 22 namespace test { |
| 23 class SpdyAltSvcWireFormatPeer; | 23 class SpdyAltSvcWireFormatPeer; |
| 24 } // namespace test | 24 } // namespace test |
| 25 | 25 |
| 26 class NET_EXPORT_PRIVATE SpdyAltSvcWireFormat { | 26 class SPDY_EXPORT_PRIVATE SpdyAltSvcWireFormat { |
| 27 public: | 27 public: |
| 28 using VersionVector = std::vector<uint16_t>; | 28 using VersionVector = std::vector<uint16_t>; |
| 29 | 29 |
| 30 struct NET_EXPORT_PRIVATE AlternativeService { | 30 struct SPDY_EXPORT_PRIVATE AlternativeService { |
| 31 SpdyString protocol_id; | 31 SpdyString protocol_id; |
| 32 SpdyString host; | 32 SpdyString host; |
| 33 | 33 |
| 34 // Default is 0: invalid port. | 34 // Default is 0: invalid port. |
| 35 uint16_t port = 0; | 35 uint16_t port = 0; |
| 36 // Default is one day. | 36 // Default is one day. |
| 37 uint32_t max_age = 86400; | 37 uint32_t max_age = 86400; |
| 38 // Default is empty: unspecified version. | 38 // Default is empty: unspecified version. |
| 39 VersionVector version; | 39 VersionVector version; |
| 40 | 40 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 SpdyStringPiece::const_iterator end, | 78 SpdyStringPiece::const_iterator end, |
| 79 uint16_t* value); | 79 uint16_t* value); |
| 80 static bool ParsePositiveInteger32(SpdyStringPiece::const_iterator c, | 80 static bool ParsePositiveInteger32(SpdyStringPiece::const_iterator c, |
| 81 SpdyStringPiece::const_iterator end, | 81 SpdyStringPiece::const_iterator end, |
| 82 uint32_t* value); | 82 uint32_t* value); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace net | 85 } // namespace net |
| 86 | 86 |
| 87 #endif // NET_SPDY_CORE_SPDY_ALT_SVC_WIRE_FORMAT_H_ | 87 #endif // NET_SPDY_CORE_SPDY_ALT_SVC_WIRE_FORMAT_H_ |
| OLD | NEW |