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

Unified Diff: net/quic/quic_utils.h

Issue 15074007: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for windows Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/quic/quic_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_utils.h
diff --git a/net/quic/quic_utils.h b/net/quic/quic_utils.h
index 14345eb6f64b56386a38b87cb7ebbfac26d2ada5..e866a07004753e0eb0aa467fdcf0e844b11c37a5 100644
--- a/net/quic/quic_utils.h
+++ b/net/quic/quic_utils.h
@@ -15,6 +15,11 @@ namespace net {
class NET_EXPORT_PRIVATE QuicUtils {
public:
+ enum Priority {
+ LOCAL_PRIORITY,
+ PEER_PRIORITY,
+ };
+
// returns the 64 bit FNV1a hash of the data. See
// http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param
static uint64 FNV1a_64_Hash(const char* data, int len);
@@ -23,6 +28,21 @@ class NET_EXPORT_PRIVATE QuicUtils {
// http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param
static uint128 FNV1a_128_Hash(const char* data, int len);
+ // FindMutualTag sets |out_result| to the first tag in the priority list that
+ // is also in the other list and returns true. If there is no intersection it
+ // returns false.
+ //
+ // Which list has priority is determined by |priority|.
+ //
+ // If |out_index| is non-NULL and a match is found then the index of that
+ // match in |their_tags| is written to |out_index|.
+ static bool FindMutualTag(const QuicTagVector& our_tags,
+ const QuicTag* their_tags,
+ size_t num_their_tags,
+ Priority priority,
+ QuicTag* out_result,
+ size_t* out_index);
+
// SerializeUint128 writes |v| in little-endian form to |out|.
static void SerializeUint128(uint128 v, uint8* out);
@@ -34,6 +54,12 @@ class NET_EXPORT_PRIVATE QuicUtils {
// Returns the name of the QuicErrorCode as a char*
static const char* ErrorToString(QuicErrorCode error);
+
+ // TagToString is a utility function for pretty-printing handshake messages
+ // that converts a tag to a string. It will try to maintain the human friendly
+ // name if possible (i.e. kABCD -> "ABCD"), or will just treat it as a number
+ // if not.
+ static std::string TagToString(QuicTag tag);
};
} // namespace net
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/quic/quic_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698