Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(793)

Side by Side Diff: net/spdy/spdy_alt_svc_wire_format.h

Issue 1130053007: Update HTTP/2 ALTSVC wireformat from draft-04 to draft-06. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hack around win_chromium_compile_dbg_ng linker errors. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/net.gypi ('k') | net/spdy/spdy_alt_svc_wire_format.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
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
7 // fields and HTTP/2 and QUIC ALTSVC frames. See specification at
8 // https://tools.ietf.org/id/draft-ietf-httpbis-alt-svc-06.html
9
10 #ifndef NET_SPDY_SPDY_ALT_SVC_WIRE_FORMAT_H_
11 #define NET_SPDY_SPDY_ALT_SVC_WIRE_FORMAT_H_
12
13 #include "base/basictypes.h"
14 #include "base/strings/string_piece.h"
15 #include "net/base/net_export.h"
16
17 using base::StringPiece;
18
19 namespace net {
20
21 namespace test {
22 class SpdyAltSvcWireFormatPeer;
23 } // namespace test
24
25 class NET_EXPORT_PRIVATE SpdyAltSvcWireFormat {
26 public:
27 friend class test::SpdyAltSvcWireFormatPeer;
28 static bool ParseHeaderFieldValue(StringPiece value,
29 std::string* protocol_id,
30 std::string* host,
31 uint16* port,
32 uint32* max_age,
33 double* p);
34 static std::string SerializeHeaderFieldValue(const std::string& protocol_id,
35 const std::string& host,
36 uint16 port,
37 uint32 max_age,
38 double p);
39
40 private:
41 static void SkipWhiteSpace(StringPiece::const_iterator* c,
42 StringPiece::const_iterator end);
43 static bool PercentDecode(StringPiece::const_iterator c,
44 StringPiece::const_iterator end,
45 std::string* output);
46 static bool ParseAltAuthority(StringPiece::const_iterator c,
47 StringPiece::const_iterator end,
48 std::string* host,
49 uint16* port);
50 static bool ParsePositiveInteger16(StringPiece::const_iterator c,
51 StringPiece::const_iterator end,
52 uint16* value);
53 static bool ParsePositiveInteger32(StringPiece::const_iterator c,
54 StringPiece::const_iterator end,
55 uint32* value);
56 static bool ParseProbability(StringPiece::const_iterator c,
57 StringPiece::const_iterator end,
58 double* p);
59 };
60
61 } // namespace net
62
63 #endif // NET_SPDY_SPDY_ALT_SVC_WIRE_FORMAT_H_
OLDNEW
« no previous file with comments | « net/net.gypi ('k') | net/spdy/spdy_alt_svc_wire_format.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698