OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DNS_DNS_SESSION_H_ | 5 #ifndef NET_DNS_DNS_SESSION_H_ |
6 #define NET_DNS_DNS_SESSION_H_ | 6 #define NET_DNS_DNS_SESSION_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // Allocate a socket, already connected to the server address. | 103 // Allocate a socket, already connected to the server address. |
104 // When the SocketLease is destroyed, the socket will be freed. | 104 // When the SocketLease is destroyed, the socket will be freed. |
105 std::unique_ptr<SocketLease> AllocateSocket(unsigned server_index, | 105 std::unique_ptr<SocketLease> AllocateSocket(unsigned server_index, |
106 const NetLog::Source& source); | 106 const NetLog::Source& source); |
107 | 107 |
108 // Creates a StreamSocket from the factory for a transaction over TCP. These | 108 // Creates a StreamSocket from the factory for a transaction over TCP. These |
109 // sockets are not pooled. | 109 // sockets are not pooled. |
110 std::unique_ptr<StreamSocket> CreateTCPSocket(unsigned server_index, | 110 std::unique_ptr<StreamSocket> CreateTCPSocket(unsigned server_index, |
111 const NetLog::Source& source); | 111 const NetLog::Source& source); |
112 | 112 |
| 113 void ApplyPersistentData(const base::Value& data); |
| 114 std::unique_ptr<const base::Value> GetPersistentData() const; |
| 115 |
113 private: | 116 private: |
114 friend class base::RefCounted<DnsSession>; | 117 friend class base::RefCounted<DnsSession>; |
115 ~DnsSession() override; | 118 ~DnsSession() override; |
116 | 119 |
117 void UpdateTimeouts(NetworkChangeNotifier::ConnectionType type); | 120 void UpdateTimeouts(NetworkChangeNotifier::ConnectionType type); |
118 void InitializeServerStats(); | 121 void InitializeServerStats(); |
119 | 122 |
120 // Release a socket. | 123 // Release a socket. |
121 void FreeSocket(unsigned server_index, | 124 void FreeSocket(unsigned server_index, |
122 std::unique_ptr<DatagramClientSocket> socket); | 125 std::unique_ptr<DatagramClientSocket> socket); |
(...skipping 29 matching lines...) Expand all Loading... |
152 RttBuckets(); | 155 RttBuckets(); |
153 }; | 156 }; |
154 static base::LazyInstance<RttBuckets>::Leaky rtt_buckets_; | 157 static base::LazyInstance<RttBuckets>::Leaky rtt_buckets_; |
155 | 158 |
156 DISALLOW_COPY_AND_ASSIGN(DnsSession); | 159 DISALLOW_COPY_AND_ASSIGN(DnsSession); |
157 }; | 160 }; |
158 | 161 |
159 } // namespace net | 162 } // namespace net |
160 | 163 |
161 #endif // NET_DNS_DNS_SESSION_H_ | 164 #endif // NET_DNS_DNS_SESSION_H_ |
OLD | NEW |