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

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: Created 8 years, 3 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
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
12 namespace net {
13
14 class ClientSocketFactory;
15 class DatagramClientSocket;
16 class IPEndPoint;
17 class NetLog;
18
19 class DnsSocketPool {
20 public:
21 static scoped_ptr<DnsSocketPool> CreateDefault(
22 ClientSocketFactory* factory);
23
szym 2012/09/26 11:16:12 IMPORTANT: Needs a virtual destructor.
Deprecated (see juliatuttle) 2012/09/26 20:44:50 Done.
24 virtual void Initialize(
25 NetLog* net_log,
szym 2012/09/26 11:16:12 I suggest reversing the order of arguments here. |
Deprecated (see juliatuttle) 2012/09/26 20:44:50 Done.
26 const std::vector<IPEndPoint>* nameservers) = 0;
27
28 virtual scoped_ptr<DatagramClientSocket> AllocateSocket(
29 unsigned server_index) = 0;
30
31 virtual void FreeSocket(
32 unsigned server_index,
33 scoped_ptr<DatagramClientSocket> socket) = 0;
34
35 protected:
36 DnsSocketPool(ClientSocketFactory* socket_factory);
37
38 void InitializeInternal(
39 NetLog* net_log,
40 const std::vector<IPEndPoint>* nameservers);
41
42 scoped_ptr<DatagramClientSocket> CreateConnectedSocket(
43 unsigned server_index);
44
45 private:
46 ClientSocketFactory* socket_factory_;
47 NetLog* net_log_;
48 const std::vector<IPEndPoint>* nameservers_;
49 bool initialized_;
50
51 DISALLOW_COPY_AND_ASSIGN(DnsSocketPool);
52 };
53
54 } // namespace net
55
56 #endif
szym 2012/09/26 11:16:12 nit: add // NET_DNS_DNS...
Deprecated (see juliatuttle) 2012/09/26 20:44:50 Done.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698