OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 #ifndef NET_QUIC_PLATFORM_IMPL_QUIC_FLAGS_IMPL_H_ |
| 6 #define NET_QUIC_PLATFORM_IMPL_QUIC_FLAGS_IMPL_H_ |
| 7 |
| 8 #include <cstdint> |
| 9 #include <string> |
| 10 |
| 11 #include "net/quic/platform/api/quic_export.h" |
| 12 |
| 13 #define QUIC_FLAG(type, flag, value) QUIC_EXPORT_PRIVATE extern type flag; |
| 14 #include "net/quic/core/quic_flags_list.h" |
| 15 #undef QUIC_FLAG |
| 16 |
| 17 // API compatibility with new-style flags. |
| 18 namespace net { |
| 19 |
| 20 inline bool GetQuicFlagImpl(bool flag) { |
| 21 return flag; |
| 22 } |
| 23 inline int32_t GetQuicFlagImpl(int32_t flag) { |
| 24 return flag; |
| 25 } |
| 26 inline int64_t GetQuicFlagImpl(int64_t flag) { |
| 27 return flag; |
| 28 } |
| 29 inline uint64_t GetQuicFlagImpl(uint64_t flag) { |
| 30 return flag; |
| 31 } |
| 32 inline double GetQuicFlagImpl(double flag) { |
| 33 return flag; |
| 34 } |
| 35 inline std::string GetQuicFlagImpl(const std::string& flag) { |
| 36 return flag; |
| 37 } |
| 38 |
| 39 inline void SetQuicFlagImpl(bool* f, bool v) { |
| 40 *f = v; |
| 41 } |
| 42 inline void SetQuicFlagImpl(int32_t* f, int32_t v) { |
| 43 *f = v; |
| 44 } |
| 45 inline void SetQuicFlagImpl(int64_t* f, int64_t v) { |
| 46 *f = v; |
| 47 } |
| 48 inline void SetQuicFlagImpl(uint64_t* f, uint64_t v) { |
| 49 *f = v; |
| 50 } |
| 51 inline void SetQuicFlagImpl(double* f, double v) { |
| 52 *f = v; |
| 53 } |
| 54 inline void SetQuicFlagImpl(std::string* f, const std::string& v) { |
| 55 *f = v; |
| 56 } |
| 57 |
| 58 } // namespace net |
| 59 |
| 60 #endif // NET_QUIC_PLATFORM_IMPL_QUIC_FLAGS_IMPL_H_ |
OLD | NEW |