blob: be89ca333013c4c61c35a522147326fe92b3f621 [file] [log] [blame]
Prathmesh Prabhu3e452f82013-04-10 16:31:44 -07001// 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
7using std::string;
8using std::vector;
9
10namespace shill {
11
12namespace {
13
14base::LazyInstance<DNSClientFactory> g_dns_client_factory
15 = LAZY_INSTANCE_INITIALIZER;
16
17} // namespace
18
19DNSClientFactory::DNSClientFactory() {}
20DNSClientFactory::~DNSClientFactory() {}
21
Paul Stewarta794cd62015-06-16 13:13:10 -070022DNSClientFactory* DNSClientFactory::GetInstance() {
Prathmesh Prabhu3e452f82013-04-10 16:31:44 -070023 return g_dns_client_factory.Pointer();
24}
25
Paul Stewarta794cd62015-06-16 13:13:10 -070026DNSClient* DNSClientFactory::CreateDNSClient(
Prathmesh Prabhu3e452f82013-04-10 16:31:44 -070027 IPAddress::Family family,
Paul Stewarta794cd62015-06-16 13:13:10 -070028 const string& interface_name,
29 const vector<string>& dns_servers,
Prathmesh Prabhu3e452f82013-04-10 16:31:44 -070030 int timeout_ms,
Paul Stewarta794cd62015-06-16 13:13:10 -070031 EventDispatcher* dispatcher,
32 const DNSClient::ClientCallback& callback) {
Prathmesh Prabhu3e452f82013-04-10 16:31:44 -070033 return new DNSClient(family,
34 interface_name,
35 dns_servers,
36 timeout_ms,
37 dispatcher,
38 callback);
39}
40
41} // namespace shill