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_CRYPTO_PROPERTIES_BASED_QUIC_SERVER_INFO_H_ | |
6 #define NET_QUIC_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/base/net_export.h" | |
15 #include "net/quic/crypto/quic_server_info.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 NET_EXPORT_PRIVATE PropertiesBasedQuicServerInfo : public QuicServerInfo { | |
25 public: | |
26 PropertiesBasedQuicServerInfo(const QuicServerId& server_id, | |
27 HttpServerProperties* http_server_properties); | |
28 ~PropertiesBasedQuicServerInfo() override; | |
29 | |
30 // QuicServerInfo implementation. | |
31 void Start() override; | |
32 int WaitForDataReady(const CompletionCallback& callback) override; | |
33 void ResetWaitForDataReadyCallback() override; | |
34 void CancelWaitForDataReadyCallback() override; | |
35 bool IsDataReady() override; | |
36 bool IsReadyToPersist() override; | |
37 void Persist() override; | |
38 void OnExternalCacheHit() override; | |
39 | |
40 private: | |
41 HttpServerProperties* http_server_properties_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(PropertiesBasedQuicServerInfo); | |
44 }; | |
45 | |
46 class NET_EXPORT_PRIVATE PropertiesBasedQuicServerInfoFactory | |
47 : public QuicServerInfoFactory { | |
48 public: | |
49 explicit PropertiesBasedQuicServerInfoFactory( | |
50 HttpServerProperties* http_server_properties); | |
51 ~PropertiesBasedQuicServerInfoFactory() override; | |
52 | |
53 QuicServerInfo* GetForServer(const QuicServerId& server_id) override; | |
54 | |
55 private: | |
56 HttpServerProperties* http_server_properties_; | |
57 | |
58 DISALLOW_COPY_AND_ASSIGN(PropertiesBasedQuicServerInfoFactory); | |
59 }; | |
60 | |
61 } // namespace net | |
62 | |
63 #endif // NET_QUIC_CRYPTO_PROPERTIES_BASED_QUIC_SERVER_INFO_H_ | |
OLD | NEW |