blob: 034ce00f581298bf7020b1c422dcd1bec39b3837 [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#ifndef SHILL_DNS_CLIENT_FACTORY_H_
6#define SHILL_DNS_CLIENT_FACTORY_H_
7
8#include <string>
9#include <vector>
10
11#include <base/lazy_instance.h>
12
13#include "shill/dns_client.h"
14#include "shill/event_dispatcher.h"
15#include "shill/ip_address.h"
16
17namespace shill {
18
19class DNSClientFactory {
20 public:
21 virtual ~DNSClientFactory();
22
mukesh agrawalf407d592013-07-31 11:37:57 -070023 // This is a singleton. Use DNSClientFactory::GetInstance()->Foo().
Prathmesh Prabhu3e452f82013-04-10 16:31:44 -070024 static DNSClientFactory *GetInstance();
25
26 virtual DNSClient *CreateDNSClient(
27 IPAddress::Family family,
28 const std::string &interface_name,
29 const std::vector<std::string> &dns_servers,
30 int timeout_ms,
31 EventDispatcher *dispatcher,
32 const DNSClient::ClientCallback &callback);
33
34 protected:
35 DNSClientFactory();
36
37 private:
38 friend struct base::DefaultLazyInstanceTraits<DNSClientFactory>;
39
40 DISALLOW_COPY_AND_ASSIGN(DNSClientFactory);
41};
42
43} // namespace shill
44
45#endif // SHILL_DNS_CLIENT_FACTORY_H_