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

Side by Side Diff: net/quic/core/quic_utils.h

Issue 2512123004: Remove QuicUtils::AsChars by casting directly. No behavior change. (Closed)
Patch Set: Created 4 years, 1 month 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/quic/core/quic_crypto_client_stream_test.cc ('k') | net/tools/quic/quic_server_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Some helpers for quic. 5 // Some helpers for quic.
6 6
7 #ifndef NET_QUIC_CORE_QUIC_UTILS_H_ 7 #ifndef NET_QUIC_CORE_QUIC_UTILS_H_
8 #define NET_QUIC_CORE_QUIC_UTILS_H_ 8 #define NET_QUIC_CORE_QUIC_UTILS_H_
9 9
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 static const char* TransmissionTypeToString(TransmissionType type); 64 static const char* TransmissionTypeToString(TransmissionType type);
65 65
66 // Returns the list of QUIC tags represented by the comma separated 66 // Returns the list of QUIC tags represented by the comma separated
67 // string in |connection_options|. 67 // string in |connection_options|.
68 static QuicTagVector ParseQuicConnectionOptions( 68 static QuicTagVector ParseQuicConnectionOptions(
69 const std::string& connection_options); 69 const std::string& connection_options);
70 70
71 // Returns PeerAddressChangeType as a std::string. 71 // Returns PeerAddressChangeType as a std::string.
72 static std::string PeerAddressChangeTypeToString(PeerAddressChangeType type); 72 static std::string PeerAddressChangeTypeToString(PeerAddressChangeType type);
73 73
74 static char* AsChars(unsigned char* data) {
75 return reinterpret_cast<char*>(data);
76 }
77
78 // Deletes all the sub-frames contained in |frames|. 74 // Deletes all the sub-frames contained in |frames|.
79 static void DeleteFrames(QuicFrames* frames); 75 static void DeleteFrames(QuicFrames* frames);
80 76
81 // Deletes all the QuicStreamFrames for the specified |stream_id|. 77 // Deletes all the QuicStreamFrames for the specified |stream_id|.
82 static void RemoveFramesForStream(QuicFrames* frames, QuicStreamId stream_id); 78 static void RemoveFramesForStream(QuicFrames* frames, QuicStreamId stream_id);
83 79
84 // Deletes and clears all the frames and the packet from serialized packet. 80 // Deletes and clears all the frames and the packet from serialized packet.
85 static void ClearSerializedPacket(SerializedPacket* serialized_packet); 81 static void ClearSerializedPacket(SerializedPacket* serialized_packet);
86 82
87 // Returns a packed representation of |path_id| and |packet_number| in which 83 // Returns a packed representation of |path_id| and |packet_number| in which
(...skipping 28 matching lines...) Expand all
116 // "0x0000: 4865 6c6c 6f2c 2051 5549 4321 0102 0304 Hello,.QUIC!...." 112 // "0x0000: 4865 6c6c 6f2c 2051 5549 4321 0102 0304 Hello,.QUIC!...."
117 static std::string HexDump(base::StringPiece binary_data); 113 static std::string HexDump(base::StringPiece binary_data);
118 114
119 private: 115 private:
120 DISALLOW_COPY_AND_ASSIGN(QuicUtils); 116 DISALLOW_COPY_AND_ASSIGN(QuicUtils);
121 }; 117 };
122 118
123 } // namespace net 119 } // namespace net
124 120
125 #endif // NET_QUIC_CORE_QUIC_UTILS_H_ 121 #endif // NET_QUIC_CORE_QUIC_UTILS_H_
OLDNEW
« no previous file with comments | « net/quic/core/quic_crypto_client_stream_test.cc ('k') | net/tools/quic/quic_server_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698