| 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_CORE_QUIC_FLAGS_H_ | |
| 6 #define NET_QUIC_CORE_QUIC_FLAGS_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 base { | |
| 19 | |
| 20 inline bool GetFlag(bool flag) { | |
| 21 return flag; | |
| 22 } | |
| 23 inline int32_t GetFlag(int32_t flag) { | |
| 24 return flag; | |
| 25 } | |
| 26 inline int64_t GetFlag(int64_t flag) { | |
| 27 return flag; | |
| 28 } | |
| 29 inline uint64_t GetFlag(uint64_t flag) { | |
| 30 return flag; | |
| 31 } | |
| 32 inline double GetFlag(double flag) { | |
| 33 return flag; | |
| 34 } | |
| 35 inline std::string GetFlag(const std::string& flag) { | |
| 36 return flag; | |
| 37 } | |
| 38 | |
| 39 inline void SetFlag(bool* f, bool v) { | |
| 40 *f = v; | |
| 41 } | |
| 42 inline void SetFlag(int32_t* f, int32_t v) { | |
| 43 *f = v; | |
| 44 } | |
| 45 inline void SetFlag(int64_t* f, int64_t v) { | |
| 46 *f = v; | |
| 47 } | |
| 48 inline void SetFlag(uint64_t* f, uint64_t v) { | |
| 49 *f = v; | |
| 50 } | |
| 51 inline void SetFlag(double* f, double v) { | |
| 52 *f = v; | |
| 53 } | |
| 54 inline void SetFlag(std::string* f, const std::string& v) { | |
| 55 *f = v; | |
| 56 } | |
| 57 | |
| 58 } // namespace base | |
| 59 | |
| 60 #endif // NET_QUIC_CORE_QUIC_FLAGS_H_ | |
| OLD | NEW |