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

Unified Diff: net/quic/quic_utils.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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_unacked_packet_map_test.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
deleted file mode 100644
index 5e76a0da43682b294c4fd1c459bd123e37619975..0000000000000000000000000000000000000000
--- a/net/quic/quic_utils.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// Some helpers for quic.
-
-#ifndef NET_QUIC_QUIC_UTILS_H_
-#define NET_QUIC_QUIC_UTILS_H_
-
-#include <string>
-
-#include "net/base/int128.h"
-#include "net/base/net_export.h"
-#include "net/quic/quic_protocol.h"
-
-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);
-
- // returns the 128 bit FNV1a hash of the data. See
- // http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param
- static uint128 FNV1a_128_Hash(const char* data1, int len1);
-
- // returns the 128 bit FNV1a hash of the two sequences of data. See
- // http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param
- static uint128 FNV1a_128_Hash_Two(const char* data1,
- int len1,
- const char* data2,
- int len2);
-
- // returns the 128 bit FNV1a hash of the |data|, starting with the
- // previous hash.
- static uint128 IncrementalHash(uint128 hash, const char* data, size_t 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-nullptr 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);
-
- // SerializeUint128 writes the first 96 bits of |v| in little-endian form
- // to |out|.
- static void SerializeUint128Short(uint128 v, uint8* out);
-
- // Returns the name of the QuicRstStreamErrorCode as a char*
- static const char* StreamErrorToString(QuicRstStreamErrorCode error);
-
- // Returns the name of the QuicErrorCode as a char*
- static const char* ErrorToString(QuicErrorCode error);
-
- // Returns the level of encryption as a char*
- static const char* EncryptionLevelToString(EncryptionLevel level);
-
- // Returns TransmissionType as a char*
- static const char* TransmissionTypeToString(TransmissionType type);
-
- // 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);
-
- // Returns the list of QUIC tags represented by the comma separated
- // string in |connection_options|.
- static QuicTagVector ParseQuicConnectionOptions(
- const std::string& connection_options);
-
- // Given a binary buffer, return a hex+ASCII dump in the style of
- // tcpdump's -X and -XX options:
- // "0x0000: 0090 69bd 5400 000d 610f 0189 0800 4500 ..i.T...a.....E.\n"
- // "0x0010: 001c fb98 4000 4001 7e18 d8ef 2301 455d ....@.@.~...#.E]\n"
- // "0x0020: 7fe2 0800 6bcb 0bc6 806e ....k....n\n"
- static std::string StringToHexASCIIDump(base::StringPiece in_buffer);
-
- static char* AsChars(unsigned char* data) {
- return reinterpret_cast<char*>(data);
- }
-
- static QuicPriority LowestPriority();
-
- static QuicPriority HighestPriority();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(QuicUtils);
-};
-
-// Utility function that returns an IOVector object wrapped around |str|.
-inline IOVector MakeIOVector(base::StringPiece str) {
- IOVector iov;
- iov.Append(const_cast<char*>(str.data()), str.size());
- return iov;
-}
-
-} // namespace net
-
-#endif // NET_QUIC_QUIC_UTILS_H_
« no previous file with comments | « net/quic/quic_unacked_packet_map_test.cc ('k') | net/quic/quic_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698