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 | #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 | |
| 17 | namespace shill { |
| 18 | |
| 19 | class DNSClientFactory { |
| 20 | public: |
| 21 | virtual ~DNSClientFactory(); |
| 22 | |
mukesh agrawal | f407d59 | 2013-07-31 11:37:57 -0700 | [diff] [blame] | 23 | // This is a singleton. Use DNSClientFactory::GetInstance()->Foo(). |
Prathmesh Prabhu | 3e452f8 | 2013-04-10 16:31:44 -0700 | [diff] [blame] | 24 | 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_ |