| 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_CRYPTO_QUIC_SERVER_INFO_H_ | 5 #ifndef NET_QUIC_CRYPTO_QUIC_SERVER_INFO_H_ | 
| 6 #define NET_QUIC_CRYPTO_QUIC_SERVER_INFO_H_ | 6 #define NET_QUIC_CRYPTO_QUIC_SERVER_INFO_H_ | 
| 7 | 7 | 
| 8 #include <string> | 8 #include <string> | 
| 9 #include <vector> | 9 #include <vector> | 
| 10 | 10 | 
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 82 | 82 | 
| 83    private: | 83    private: | 
| 84     DISALLOW_COPY_AND_ASSIGN(State); | 84     DISALLOW_COPY_AND_ASSIGN(State); | 
| 85   }; | 85   }; | 
| 86 | 86 | 
| 87   // Once the data is ready, it can be read using the following members. These | 87   // Once the data is ready, it can be read using the following members. These | 
| 88   // members can then be updated before calling |Persist|. | 88   // members can then be updated before calling |Persist|. | 
| 89   const State& state() const; | 89   const State& state() const; | 
| 90   State* mutable_state(); | 90   State* mutable_state(); | 
| 91 | 91 | 
|  | 92   base::TimeTicks wait_for_data_start_time() const { | 
|  | 93     return wait_for_data_start_time_; | 
|  | 94   } | 
|  | 95 | 
|  | 96   base::TimeTicks wait_for_data_end_time() const { | 
|  | 97     return wait_for_data_end_time_; | 
|  | 98   } | 
|  | 99 | 
| 92  protected: | 100  protected: | 
| 93   // Parse parses pickled data and fills out the public member fields of this | 101   // Parse parses pickled data and fills out the public member fields of this | 
| 94   // object. It returns true iff the parse was successful. The public member | 102   // object. It returns true iff the parse was successful. The public member | 
| 95   // fields will be set to something sane in any case. | 103   // fields will be set to something sane in any case. | 
| 96   bool Parse(const std::string& data); | 104   bool Parse(const std::string& data); | 
| 97   std::string Serialize(); | 105   std::string Serialize(); | 
| 98   State state_; | 106   State state_; | 
| 99 | 107 | 
|  | 108   // Time when WaitForDataReady was called and when it has finished. | 
|  | 109   base::TimeTicks wait_for_data_start_time_; | 
|  | 110   base::TimeTicks wait_for_data_end_time_; | 
|  | 111 | 
| 100  private: | 112  private: | 
| 101   // ParseInner is a helper function for Parse. | 113   // ParseInner is a helper function for Parse. | 
| 102   bool ParseInner(const std::string& data); | 114   bool ParseInner(const std::string& data); | 
| 103 | 115 | 
| 104   // SerializeInner is a helper function for Serialize. | 116   // SerializeInner is a helper function for Serialize. | 
| 105   std::string SerializeInner() const; | 117   std::string SerializeInner() const; | 
| 106 | 118 | 
| 107   // This is the QUIC server (hostname, port, is_https, privacy_mode) tuple for | 119   // This is the QUIC server (hostname, port, is_https, privacy_mode) tuple for | 
| 108   // which we restore the crypto_config. | 120   // which we restore the crypto_config. | 
| 109   const QuicServerId server_id_; | 121   const QuicServerId server_id_; | 
| 110 | 122 | 
| 111   DISALLOW_COPY_AND_ASSIGN(QuicServerInfo); | 123   DISALLOW_COPY_AND_ASSIGN(QuicServerInfo); | 
| 112 }; | 124 }; | 
| 113 | 125 | 
| 114 class NET_EXPORT_PRIVATE QuicServerInfoFactory { | 126 class NET_EXPORT_PRIVATE QuicServerInfoFactory { | 
| 115  public: | 127  public: | 
| 116   QuicServerInfoFactory() {} | 128   QuicServerInfoFactory() {} | 
| 117   virtual ~QuicServerInfoFactory(); | 129   virtual ~QuicServerInfoFactory(); | 
| 118 | 130 | 
| 119   // GetForServer returns a fresh, allocated QuicServerInfo for the given | 131   // GetForServer returns a fresh, allocated QuicServerInfo for the given | 
| 120   // |server_id| or NULL on failure. | 132   // |server_id| or NULL on failure. | 
| 121   virtual QuicServerInfo* GetForServer(const QuicServerId& server_id) = 0; | 133   virtual QuicServerInfo* GetForServer(const QuicServerId& server_id) = 0; | 
| 122 | 134 | 
| 123   DISALLOW_COPY_AND_ASSIGN(QuicServerInfoFactory); | 135   DISALLOW_COPY_AND_ASSIGN(QuicServerInfoFactory); | 
| 124 }; | 136 }; | 
| 125 | 137 | 
| 126 }  // namespace net | 138 }  // namespace net | 
| 127 | 139 | 
| 128 #endif  // NET_QUIC_CRYPTO_QUIC_SERVER_INFO_H_ | 140 #endif  // NET_QUIC_CRYPTO_QUIC_SERVER_INFO_H_ | 
| OLD | NEW | 
|---|