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

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: Use a single, separate DnsSocketPool object 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> MakeDefault();
szym 2012/09/14 20:49:27 suggest: CreateDefault to avoid ambiguity
Deprecated (see juliatuttle) 2012/09/18 20:28:00 Done.
22
23 virtual void Initialize(
24 ClientSocketFactory* socket_factory,
25 NetLog* net_log,
26 const std::vector<IPEndPoint>* nameservers);
szym 2012/09/14 20:49:27 I suggest taking a reference and making a copy. Al
Deprecated (see juliatuttle) 2012/09/18 20:28:00 Done.
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();
37
38 scoped_ptr<DatagramClientSocket> CreateConnectedSocket(
39 unsigned server_index);
40
41 private:
42 ClientSocketFactory* socket_factory_;
43 NetLog* net_log_;
44 const std::vector<IPEndPoint>* nameservers_;
45 bool initialized_;
szym 2012/09/14 20:49:27 DISALLOW_COPY_AND_ASSIGN
Deprecated (see juliatuttle) 2012/09/18 20:28:00 Done.
46 };
47
48 } // namespace net
49
50 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698