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

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

Issue 2533753003: Make DnsSocketPool copy RandIntCallback (Closed)
Patch Set: Put methods in right order. Created 4 years 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
« no previous file with comments | « net/dns/dns_socket_pool.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/dns/dns_socket_pool.h" 5 #include "net/dns/dns_socket_pool.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/rand_util.h" 9 #include "base/rand_util.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 private: 146 private:
147 void FillPool(unsigned server_index, unsigned size); 147 void FillPool(unsigned server_index, unsigned size);
148 148
149 typedef std::vector<DatagramClientSocket*> SocketVector; 149 typedef std::vector<DatagramClientSocket*> SocketVector;
150 150
151 std::vector<SocketVector> pools_; 151 std::vector<SocketVector> pools_;
152 152
153 DISALLOW_COPY_AND_ASSIGN(DefaultDnsSocketPool); 153 DISALLOW_COPY_AND_ASSIGN(DefaultDnsSocketPool);
154 }; 154 };
155 155
156 DnsSocketPool::~DnsSocketPool() {}
157
156 // static 158 // static
157 std::unique_ptr<DnsSocketPool> DnsSocketPool::CreateDefault( 159 std::unique_ptr<DnsSocketPool> DnsSocketPool::CreateDefault(
158 ClientSocketFactory* factory, 160 ClientSocketFactory* factory,
159 const RandIntCallback& rand_int_callback) { 161 const RandIntCallback& rand_int_callback) {
160 return std::unique_ptr<DnsSocketPool>( 162 return std::unique_ptr<DnsSocketPool>(
161 new DefaultDnsSocketPool(factory, rand_int_callback)); 163 new DefaultDnsSocketPool(factory, rand_int_callback));
162 } 164 }
163 165
164 void DefaultDnsSocketPool::Initialize( 166 void DefaultDnsSocketPool::Initialize(
165 const std::vector<IPEndPoint>* nameservers, 167 const std::vector<IPEndPoint>* nameservers,
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 for (unsigned pool_index = pool.size(); pool_index < size; ++pool_index) { 220 for (unsigned pool_index = pool.size(); pool_index < size; ++pool_index) {
219 DatagramClientSocket* socket = 221 DatagramClientSocket* socket =
220 CreateConnectedSocket(server_index).release(); 222 CreateConnectedSocket(server_index).release();
221 if (!socket) 223 if (!socket)
222 break; 224 break;
223 pool.push_back(socket); 225 pool.push_back(socket);
224 } 226 }
225 } 227 }
226 228
227 } // namespace net 229 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/dns_socket_pool.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698