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

Side by Side Diff: net/quic/platform/api/quic_endian.h

Issue 2850573002: Landing Recent QUIC changes until 3:35 PM, Apr 26, 2017 UTC-4 (Closed)
Patch Set: Remove Disconnect from ~QuicTestClient Created 3 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/quic/core/spdy_utils_test.cc ('k') | net/quic/platform/api/quic_mutex.h » ('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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #ifndef NET_QUIC_PLATFORM_API_QUIC_ENDIAN_H_ 5 #ifndef NET_QUIC_PLATFORM_API_QUIC_ENDIAN_H_
6 #define NET_QUIC_PLATFORM_API_QUIC_ENDIAN_H_ 6 #define NET_QUIC_PLATFORM_API_QUIC_ENDIAN_H_
7 7
8 #include "net/quic/platform/impl/quic_endian_impl.h" 8 #include "net/quic/platform/impl/quic_endian_impl.h"
9 9
10 namespace net { 10 namespace net {
11 11
12 enum Endianness {
13 NETWORK_BYTE_ORDER, // big endian
14 HOST_BYTE_ORDER // little endian
15 };
16
12 // Provide utility functions that convert from/to network order (big endian) 17 // Provide utility functions that convert from/to network order (big endian)
13 // to/from host order (can be either little or big endian depending on the 18 // to/from host order (can be either little or big endian depending on the
14 // platform). 19 // platform).
15 class QuicEndian { 20 class QuicEndian {
16 public: 21 public:
17 // Convert |x| from host order (can be either little or big endian depending 22 // Convert |x| from host order (can be either little or big endian depending
18 // on the platform) to network order (big endian). 23 // on the platform) to network order (big endian).
19 static uint16_t HostToNet16(uint16_t x) { 24 static uint16_t HostToNet16(uint16_t x) {
20 return QuicEndianImpl::HostToNet16(x); 25 return QuicEndianImpl::HostToNet16(x);
21 } 26 }
(...skipping 18 matching lines...) Expand all
40 45
41 // Returns true if current host order is little endian. 46 // Returns true if current host order is little endian.
42 static bool HostIsLittleEndian() { 47 static bool HostIsLittleEndian() {
43 return QuicEndianImpl::HostIsLittleEndian(); 48 return QuicEndianImpl::HostIsLittleEndian();
44 } 49 }
45 }; 50 };
46 51
47 } // namespace net 52 } // namespace net
48 53
49 #endif // NET_QUIC_PLATFORM_API_QUIC_ENDIAN_H_ 54 #endif // NET_QUIC_PLATFORM_API_QUIC_ENDIAN_H_
OLDNEW
« no previous file with comments | « net/quic/core/spdy_utils_test.cc ('k') | net/quic/platform/api/quic_mutex.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698