| Index: net/dns/dns_socket_pool.h
|
| diff --git a/net/dns/dns_socket_pool.h b/net/dns/dns_socket_pool.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3f2dd06cdcc14364a141e591978b8a56e9e75493
|
| --- /dev/null
|
| +++ b/net/dns/dns_socket_pool.h
|
| @@ -0,0 +1,61 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef NET_DNS_DNS_SOCKET_POOL_H_
|
| +#define NET_DNS_DNS_SOCKET_POOL_H_
|
| +
|
| +#include <vector>
|
| +
|
| +#include "base/memory/scoped_ptr.h"
|
| +
|
| +namespace net {
|
| +
|
| +class ClientSocketFactory;
|
| +class DatagramClientSocket;
|
| +class IPEndPoint;
|
| +class NetLog;
|
| +
|
| +class DnsSocketPool {
|
| + public:
|
| + virtual ~DnsSocketPool() { }
|
| +
|
| + static scoped_ptr<DnsSocketPool> CreateDefault(
|
| + ClientSocketFactory* factory);
|
| +
|
| + static scoped_ptr<DnsSocketPool> CreateNull(
|
| + ClientSocketFactory* factory);
|
| +
|
| + virtual void Initialize(
|
| + const std::vector<IPEndPoint>* nameservers,
|
| + NetLog* net_log) = 0;
|
| +
|
| + virtual scoped_ptr<DatagramClientSocket> AllocateSocket(
|
| + unsigned server_index) = 0;
|
| +
|
| + virtual void FreeSocket(
|
| + unsigned server_index,
|
| + scoped_ptr<DatagramClientSocket> socket) = 0;
|
| +
|
| + protected:
|
| + DnsSocketPool(ClientSocketFactory* socket_factory);
|
| +
|
| + void InitializeInternal(
|
| + const std::vector<IPEndPoint>* nameservers,
|
| + NetLog* net_log);
|
| +
|
| + scoped_ptr<DatagramClientSocket> CreateConnectedSocket(
|
| + unsigned server_index);
|
| +
|
| + private:
|
| + ClientSocketFactory* socket_factory_;
|
| + NetLog* net_log_;
|
| + const std::vector<IPEndPoint>* nameservers_;
|
| + bool initialized_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(DnsSocketPool);
|
| +};
|
| +
|
| +} // namespace net
|
| +
|
| +#endif // NET_DNS_DNS_SOCKET_POOL_H_
|
|
|