Chromium Code Reviews| OLD | NEW | 
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NET_DNS_DNS_SOCKET_POOL_H_ | |
| 6 #define NET_DNS_DNS_SOCKET_POOL_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 | |
| 12 namespace net { | |
| 13 | |
| 14 class ClientSocketFactory; | |
| 15 class DatagramClientSocket; | |
| 16 class IPEndPoint; | |
| 17 class NetLog; | |
| 18 | |
| 19 class DnsSocketPool { | |
| 20 public: | |
| 21 ~DnsSocketPool() { } | |
| 
 
szym
2012/09/26 21:03:33
IMPORTANT: This has to be virtual to work.
 
Deprecated (see juliatuttle)
2012/10/01 21:30:07
Done.
 
 | |
| 22 | |
| 23 static scoped_ptr<DnsSocketPool> CreateDefault( | |
| 24 ClientSocketFactory* factory); | |
| 25 | |
| 26 virtual void Initialize( | |
| 27 const std::vector<IPEndPoint>* nameservers, | |
| 28 NetLog* net_log) = 0; | |
| 29 | |
| 30 virtual scoped_ptr<DatagramClientSocket> AllocateSocket( | |
| 31 unsigned server_index) = 0; | |
| 32 | |
| 33 virtual void FreeSocket( | |
| 34 unsigned server_index, | |
| 35 scoped_ptr<DatagramClientSocket> socket) = 0; | |
| 36 | |
| 37 protected: | |
| 38 DnsSocketPool(ClientSocketFactory* socket_factory); | |
| 39 | |
| 40 void InitializeInternal( | |
| 41 const std::vector<IPEndPoint>* nameservers, | |
| 42 NetLog* net_log); | |
| 43 | |
| 44 scoped_ptr<DatagramClientSocket> CreateConnectedSocket( | |
| 45 unsigned server_index); | |
| 46 | |
| 47 private: | |
| 48 ClientSocketFactory* socket_factory_; | |
| 49 NetLog* net_log_; | |
| 50 const std::vector<IPEndPoint>* nameservers_; | |
| 51 bool initialized_; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(DnsSocketPool); | |
| 54 }; | |
| 55 | |
| 56 } // namespace net | |
| 57 | |
| 58 #endif // NET_DNS_DNS_SOCKET_POOL_H_ | |
| OLD | NEW |