Prathmesh Prabhu | 3e452f8 | 2013-04-10 16:31:44 -0700 | [diff] [blame] | 1 | // Copyright (c) 2013 The Chromium OS 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 | #include "shill/dns_client_factory.h" |
| 6 | |
| 7 | using std::string; |
| 8 | using std::vector; |
| 9 | |
| 10 | namespace shill { |
| 11 | |
| 12 | namespace { |
| 13 | |
| 14 | base::LazyInstance<DNSClientFactory> g_dns_client_factory |
| 15 | = LAZY_INSTANCE_INITIALIZER; |
| 16 | |
| 17 | } // namespace |
| 18 | |
| 19 | DNSClientFactory::DNSClientFactory() {} |
| 20 | DNSClientFactory::~DNSClientFactory() {} |
| 21 | |
| 22 | DNSClientFactory *DNSClientFactory::GetInstance() { |
| 23 | return g_dns_client_factory.Pointer(); |
| 24 | } |
| 25 | |
| 26 | DNSClient *DNSClientFactory::CreateDNSClient( |
| 27 | IPAddress::Family family, |
| 28 | const string &interface_name, |
| 29 | const vector<string> &dns_servers, |
| 30 | int timeout_ms, |
| 31 | EventDispatcher *dispatcher, |
| 32 | const DNSClient::ClientCallback &callback) { |
| 33 | return new DNSClient(family, |
| 34 | interface_name, |
| 35 | dns_servers, |
| 36 | timeout_ms, |
| 37 | dispatcher, |
| 38 | callback); |
| 39 | } |
| 40 | |
| 41 | } // namespace shill |