Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: net/dns/dns_socket_pool.h

Issue 10878090: Keep pool of pre-connected DNS sockets (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/dns/dns_session_unittest.cc ('k') | net/dns/dns_socket_pool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #include "net/base/net_export.h"
12
13 namespace net {
14
15 class ClientSocketFactory;
16 class DatagramClientSocket;
17 class IPEndPoint;
18 class NetLog;
19
20 class NET_EXPORT_PRIVATE DnsSocketPool {
cbentzel 2012/10/25 21:15:45 Please provide a brief comment about what this cla
21 public:
22 virtual ~DnsSocketPool() { }
23
24 static scoped_ptr<DnsSocketPool> CreateDefault(
25 ClientSocketFactory* factory);
26
27 static scoped_ptr<DnsSocketPool> CreateNull(
28 ClientSocketFactory* factory);
29
30 virtual void Initialize(
31 const std::vector<IPEndPoint>* nameservers,
32 NetLog* net_log) = 0;
33
34 virtual scoped_ptr<DatagramClientSocket> AllocateSocket(
35 unsigned server_index) = 0;
36
37 virtual void FreeSocket(
38 unsigned server_index,
39 scoped_ptr<DatagramClientSocket> socket) = 0;
40
41 protected:
42 DnsSocketPool(ClientSocketFactory* socket_factory);
43
44 void InitializeInternal(
45 const std::vector<IPEndPoint>* nameservers,
46 NetLog* net_log);
47
48 scoped_ptr<DatagramClientSocket> CreateConnectedSocket(
49 unsigned server_index);
50
51 private:
52 ClientSocketFactory* socket_factory_;
53 NetLog* net_log_;
54 const std::vector<IPEndPoint>* nameservers_;
55 bool initialized_;
56
57 DISALLOW_COPY_AND_ASSIGN(DnsSocketPool);
58 };
59
60 } // namespace net
61
62 #endif // NET_DNS_DNS_SOCKET_POOL_H_
OLDNEW
« no previous file with comments | « net/dns/dns_session_unittest.cc ('k') | net/dns/dns_socket_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698