| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_QUIC_CORE_CRYPTO_QUIC_SERVER_INFO_H_ | 5 #ifndef NET_QUIC_CORE_CRYPTO_QUIC_SERVER_INFO_H_ |
| 6 #define NET_QUIC_CORE_CRYPTO_QUIC_SERVER_INFO_H_ | 6 #define NET_QUIC_CORE_CRYPTO_QUIC_SERVER_INFO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "net/base/completion_callback.h" | 15 #include "net/base/completion_callback.h" |
| 16 #include "net/base/net_export.h" | |
| 17 #include "net/quic/core/quic_server_id.h" | 16 #include "net/quic/core/quic_server_id.h" |
| 17 #include "net/quic/platform/api/quic_export.h" |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 // QuicServerInfo is an interface for fetching information about a QUIC server. | 21 // QuicServerInfo is an interface for fetching information about a QUIC server. |
| 22 // This information may be stored on disk so does not include keys or other | 22 // This information may be stored on disk so does not include keys or other |
| 23 // sensitive information. Primarily it's intended for caching the QUIC server's | 23 // sensitive information. Primarily it's intended for caching the QUIC server's |
| 24 // crypto config. | 24 // crypto config. |
| 25 class NET_EXPORT_PRIVATE QuicServerInfo { | 25 class QUIC_EXPORT_PRIVATE QuicServerInfo { |
| 26 public: | 26 public: |
| 27 // Enum to track number of times data read/parse/write API calls of | 27 // Enum to track number of times data read/parse/write API calls of |
| 28 // QuicServerInfo to and from disk cache is called. | 28 // QuicServerInfo to and from disk cache is called. |
| 29 enum QuicServerInfoAPICall { | 29 enum QuicServerInfoAPICall { |
| 30 QUIC_SERVER_INFO_START = 0, | 30 QUIC_SERVER_INFO_START = 0, |
| 31 QUIC_SERVER_INFO_WAIT_FOR_DATA_READY = 1, | 31 QUIC_SERVER_INFO_WAIT_FOR_DATA_READY = 1, |
| 32 QUIC_SERVER_INFO_PARSE = 2, | 32 QUIC_SERVER_INFO_PARSE = 2, |
| 33 QUIC_SERVER_INFO_WAIT_FOR_DATA_READY_CANCEL = 3, | 33 QUIC_SERVER_INFO_WAIT_FOR_DATA_READY_CANCEL = 3, |
| 34 QUIC_SERVER_INFO_READY_TO_PERSIST = 4, | 34 QUIC_SERVER_INFO_READY_TO_PERSIST = 4, |
| 35 QUIC_SERVER_INFO_PERSIST = 5, | 35 QUIC_SERVER_INFO_PERSIST = 5, |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 private: | 154 private: |
| 155 // ParseInner is a helper function for Parse. | 155 // ParseInner is a helper function for Parse. |
| 156 bool ParseInner(const std::string& data); | 156 bool ParseInner(const std::string& data); |
| 157 | 157 |
| 158 // SerializeInner is a helper function for Serialize. | 158 // SerializeInner is a helper function for Serialize. |
| 159 std::string SerializeInner() const; | 159 std::string SerializeInner() const; |
| 160 | 160 |
| 161 DISALLOW_COPY_AND_ASSIGN(QuicServerInfo); | 161 DISALLOW_COPY_AND_ASSIGN(QuicServerInfo); |
| 162 }; | 162 }; |
| 163 | 163 |
| 164 class NET_EXPORT_PRIVATE QuicServerInfoFactory { | 164 class QUIC_EXPORT_PRIVATE QuicServerInfoFactory { |
| 165 public: | 165 public: |
| 166 QuicServerInfoFactory() {} | 166 QuicServerInfoFactory() {} |
| 167 virtual ~QuicServerInfoFactory(); | 167 virtual ~QuicServerInfoFactory(); |
| 168 | 168 |
| 169 // GetForServer returns a fresh, allocated QuicServerInfo for the given | 169 // GetForServer returns a fresh, allocated QuicServerInfo for the given |
| 170 // |server_id| or NULL on failure. | 170 // |server_id| or NULL on failure. |
| 171 virtual QuicServerInfo* GetForServer(const QuicServerId& server_id) = 0; | 171 virtual QuicServerInfo* GetForServer(const QuicServerId& server_id) = 0; |
| 172 | 172 |
| 173 private: | 173 private: |
| 174 DISALLOW_COPY_AND_ASSIGN(QuicServerInfoFactory); | 174 DISALLOW_COPY_AND_ASSIGN(QuicServerInfoFactory); |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 } // namespace net | 177 } // namespace net |
| 178 | 178 |
| 179 #endif // NET_QUIC_CORE_CRYPTO_QUIC_SERVER_INFO_H_ | 179 #endif // NET_QUIC_CORE_CRYPTO_QUIC_SERVER_INFO_H_ |
| OLD | NEW |