1 // Copyright 2015 The Chromium Authors 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_PROPERTIES_BASED_QUIC_SERVER_INFO_H_ 6 #define NET_QUIC_PROPERTIES_BASED_QUIC_SERVER_INFO_H_ 7 8 #include "base/memory/raw_ptr.h" 9 #include "base/memory/weak_ptr.h" 10 #include "net/base/net_export.h" 11 #include "net/base/network_anonymization_key.h" 12 #include "net/base/privacy_mode.h" 13 #include "net/quic/quic_server_info.h" 14 15 namespace net { 16 17 class HttpServerProperties; 18 19 // PropertiesBasedQuicServerInfo fetches information about a QUIC server from 20 // HttpServerProperties. Since the information is defined to be non-sensitive, 21 // it's ok for us to keep it on disk. 22 class NET_EXPORT_PRIVATE PropertiesBasedQuicServerInfo : public QuicServerInfo { 23 public: 24 PropertiesBasedQuicServerInfo( 25 const quic::QuicServerId& server_id, 26 PrivacyMode privacy_mode, 27 const NetworkAnonymizationKey& network_anonymization_key, 28 HttpServerProperties* http_server_properties); 29 30 PropertiesBasedQuicServerInfo(const PropertiesBasedQuicServerInfo&) = delete; 31 PropertiesBasedQuicServerInfo& operator=( 32 const PropertiesBasedQuicServerInfo&) = delete; 33 34 ~PropertiesBasedQuicServerInfo() override; 35 36 // QuicServerInfo implementation. 37 bool Load() override; 38 void Persist() override; 39 40 private: 41 const PrivacyMode privacy_mode_ = PRIVACY_MODE_DISABLED; 42 const NetworkAnonymizationKey network_anonymization_key_; 43 const raw_ptr<HttpServerProperties> http_server_properties_; 44 }; 45 46 } // namespace net 47 48 #endif // NET_QUIC_PROPERTIES_BASED_QUIC_SERVER_INFO_H_ 49