ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / native_client_sdk / src / libraries / nacl_io / host_resolver.h
blobcb2365f6d0e7527f04129e1c8d6a009080b6518a
1 // Copyright 2013 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 LIBRARIES_NACL_IO_HOST_RESOLVER_H_
6 #define LIBRARIES_NACL_IO_HOST_RESOLVER_H_
8 #include "nacl_io/ossocket.h"
9 #include "nacl_io/pepper_interface.h"
10 #include "sdk_util/simple_lock.h"
12 #ifdef PROVIDES_SOCKET_API
14 namespace nacl_io {
16 class HostResolver {
17 public:
18 HostResolver();
19 ~HostResolver();
21 void Init(PepperInterface* ppapi);
23 void freeaddrinfo(struct addrinfo* res);
24 int getnameinfo(const struct sockaddr *sa,
25 socklen_t salen,
26 char *host,
27 size_t hostlen,
28 char *serv,
29 size_t servlen,
30 int flags);
31 int getaddrinfo(const char* node,
32 const char* service,
33 const struct addrinfo* hints,
34 struct addrinfo** res);
35 struct hostent* gethostbyname(const char* name);
37 private:
38 void hostent_initialize();
39 void hostent_cleanup();
41 struct hostent hostent_;
42 PepperInterface* ppapi_;
43 sdk_util::SimpleLock gethostbyname_lock_;
46 } // namespace nacl_io
48 #endif // PROVIDES_SOCKET_API
49 #endif // LIBRARIES_NACL_IO_HOST_RESOLVER_H_