OLD | NEW |
| (Empty) |
1 // Copyright 2015 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_CRYPTO_PROPERTIES_BASED_QUIC_SERVER_INFO_H_ | |
6 #define NET_QUIC_CORE_CRYPTO_PROPERTIES_BASED_QUIC_SERVER_INFO_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/macros.h" | |
12 #include "base/memory/weak_ptr.h" | |
13 #include "net/base/completion_callback.h" | |
14 #include "net/quic/core/crypto/quic_server_info.h" | |
15 #include "net/quic/platform/api/quic_export.h" | |
16 | |
17 namespace net { | |
18 | |
19 class HttpServerProperties; | |
20 | |
21 // PropertiesBasedQuicServerInfo fetches information about a QUIC server from | |
22 // HttpServerProperties. Since the information is defined to be non-sensitive, | |
23 // it's ok for us to keep it on disk. | |
24 class QUIC_EXPORT_PRIVATE PropertiesBasedQuicServerInfo | |
25 : public QuicServerInfo { | |
26 public: | |
27 PropertiesBasedQuicServerInfo(const QuicServerId& server_id, | |
28 HttpServerProperties* http_server_properties); | |
29 ~PropertiesBasedQuicServerInfo() override; | |
30 | |
31 // QuicServerInfo implementation. | |
32 void Start() override; | |
33 int WaitForDataReady(const CompletionCallback& callback) override; | |
34 void ResetWaitForDataReadyCallback() override; | |
35 void CancelWaitForDataReadyCallback() override; | |
36 bool IsDataReady() override; | |
37 bool IsReadyToPersist() override; | |
38 void Persist() override; | |
39 void OnExternalCacheHit() override; | |
40 | |
41 private: | |
42 HttpServerProperties* http_server_properties_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(PropertiesBasedQuicServerInfo); | |
45 }; | |
46 | |
47 class QUIC_EXPORT_PRIVATE PropertiesBasedQuicServerInfoFactory | |
48 : public QuicServerInfoFactory { | |
49 public: | |
50 explicit PropertiesBasedQuicServerInfoFactory( | |
51 HttpServerProperties* http_server_properties); | |
52 ~PropertiesBasedQuicServerInfoFactory() override; | |
53 | |
54 QuicServerInfo* GetForServer(const QuicServerId& server_id) override; | |
55 | |
56 private: | |
57 HttpServerProperties* http_server_properties_; | |
58 | |
59 DISALLOW_COPY_AND_ASSIGN(PropertiesBasedQuicServerInfoFactory); | |
60 }; | |
61 | |
62 } // namespace net | |
63 | |
64 #endif // NET_QUIC_CORE_CRYPTO_PROPERTIES_BASED_QUIC_SERVER_INFO_H_ | |
OLD | NEW |