| OLD | NEW | 
|   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_client.h" |   5 #include "net/dns/dns_client.h" | 
|   6  |   6  | 
|   7 #include "base/bind.h" |   7 #include "base/bind.h" | 
|   8 #include "base/rand_util.h" |   8 #include "base/rand_util.h" | 
|   9 #include "net/base/net_log.h" |   9 #include "net/base/net_log.h" | 
|  10 #include "net/dns/address_sorter.h" |  10 #include "net/dns/address_sorter.h" | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
|  23       : address_sorter_(AddressSorter::CreateAddressSorter()), |  23       : address_sorter_(AddressSorter::CreateAddressSorter()), | 
|  24         net_log_(net_log) {} |  24         net_log_(net_log) {} | 
|  25  |  25  | 
|  26   virtual void SetConfig(const DnsConfig& config) OVERRIDE { |  26   virtual void SetConfig(const DnsConfig& config) OVERRIDE { | 
|  27     factory_.reset(); |  27     factory_.reset(); | 
|  28     session_ = NULL; |  28     session_ = NULL; | 
|  29     if (config.IsValid()) { |  29     if (config.IsValid()) { | 
|  30       session_ = new DnsSession(config, |  30       session_ = new DnsSession(config, | 
|  31                                 ClientSocketFactory::GetDefaultFactory(), |  31                                 ClientSocketFactory::GetDefaultFactory(), | 
|  32                                 base::Bind(&base::RandInt), |  32                                 base::Bind(&base::RandInt), | 
 |  33                                 false, /* don't bypass pools */ | 
|  33                                 net_log_); |  34                                 net_log_); | 
|  34       factory_ = DnsTransactionFactory::CreateFactory(session_); |  35       factory_ = DnsTransactionFactory::CreateFactory(session_); | 
|  35     } |  36     } | 
|  36   } |  37   } | 
|  37  |  38  | 
|  38   virtual const DnsConfig* GetConfig() const OVERRIDE { |  39   virtual const DnsConfig* GetConfig() const OVERRIDE { | 
|  39     return session_.get() ? &session_->config() : NULL; |  40     return session_.get() ? &session_->config() : NULL; | 
|  40   } |  41   } | 
|  41  |  42  | 
|  42   virtual DnsTransactionFactory* GetTransactionFactory() OVERRIDE { |  43   virtual DnsTransactionFactory* GetTransactionFactory() OVERRIDE { | 
| (...skipping 14 matching lines...) Expand all  Loading... | 
|  57  |  58  | 
|  58 }  // namespace |  59 }  // namespace | 
|  59  |  60  | 
|  60 // static |  61 // static | 
|  61 scoped_ptr<DnsClient> DnsClient::CreateClient(NetLog* net_log) { |  62 scoped_ptr<DnsClient> DnsClient::CreateClient(NetLog* net_log) { | 
|  62   return scoped_ptr<DnsClient>(new DnsClientImpl(net_log)); |  63   return scoped_ptr<DnsClient>(new DnsClientImpl(net_log)); | 
|  63 } |  64 } | 
|  64  |  65  | 
|  65 }  // namespace net |  66 }  // namespace net | 
|  66  |  67  | 
| OLD | NEW |