Add signalSyncPoint to the WebGraphicsContext3D command buffer impls.
[chromium-blink-merge.git] / net / dns / dns_config_service_posix.h
blob95a4377d93283a42504c592f84efcb370772701f
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
3 // found in the LICENSE file.
5 #ifndef NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_
6 #define NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_
8 #include <sys/types.h>
9 #include <netinet/in.h>
10 #include <resolv.h>
12 #include "base/compiler_specific.h"
13 #include "net/base/net_export.h"
14 #include "net/dns/dns_config_service.h"
16 namespace net {
18 // Use DnsConfigService::CreateSystemService to use it outside of tests.
19 namespace internal {
21 class NET_EXPORT_PRIVATE DnsConfigServicePosix : public DnsConfigService {
22 public:
23 DnsConfigServicePosix();
24 virtual ~DnsConfigServicePosix();
26 protected:
27 // DnsConfigService:
28 virtual void ReadNow() OVERRIDE;
29 virtual bool StartWatching() OVERRIDE;
31 private:
32 class Watcher;
33 class ConfigReader;
34 class HostsReader;
36 void OnConfigChanged(bool succeeded);
37 void OnHostsChanged(bool succeeded);
39 scoped_ptr<Watcher> watcher_;
40 scoped_refptr<ConfigReader> config_reader_;
41 scoped_refptr<HostsReader> hosts_reader_;
43 DISALLOW_COPY_AND_ASSIGN(DnsConfigServicePosix);
46 enum ConfigParsePosixResult {
47 CONFIG_PARSE_POSIX_OK = 0,
48 CONFIG_PARSE_POSIX_RES_INIT_FAILED,
49 CONFIG_PARSE_POSIX_RES_INIT_UNSET,
50 CONFIG_PARSE_POSIX_BAD_ADDRESS,
51 CONFIG_PARSE_POSIX_BAD_EXT_STRUCT,
52 CONFIG_PARSE_POSIX_NULL_ADDRESS,
53 CONFIG_PARSE_POSIX_NO_NAMESERVERS,
54 CONFIG_PARSE_POSIX_MISSING_OPTIONS,
55 CONFIG_PARSE_POSIX_UNHANDLED_OPTIONS,
56 CONFIG_PARSE_POSIX_MAX // Bounding values for enumeration.
59 // Fills in |dns_config| from |res|.
60 ConfigParsePosixResult NET_EXPORT_PRIVATE ConvertResStateToDnsConfig(
61 const struct __res_state& res, DnsConfig* dns_config);
63 } // namespace internal
65 } // namespace net
67 #endif // NET_DNS_DNS_CONFIG_SERVICE_POSIX_H_