| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef LIBRARIES_NACL_IO_HOST_RESOLVER_H_ | 5 #ifndef LIBRARIES_NACL_IO_HOST_RESOLVER_H_ |
| 6 #define LIBRARIES_NACL_IO_HOST_RESOLVER_H_ | 6 #define LIBRARIES_NACL_IO_HOST_RESOLVER_H_ |
| 7 | 7 |
| 8 #include "nacl_io/ossocket.h" | 8 #include "nacl_io/ossocket.h" |
| 9 #include "nacl_io/pepper_interface.h" | 9 #include "nacl_io/pepper_interface.h" |
| 10 #include "sdk_util/simple_lock.h" | 10 #include "sdk_util/simple_lock.h" |
| 11 | 11 |
| 12 #ifdef PROVIDES_SOCKET_API | 12 #ifdef PROVIDES_SOCKET_API |
| 13 | 13 |
| 14 namespace nacl_io { | 14 namespace nacl_io { |
| 15 | 15 |
| 16 class HostResolver { | 16 class HostResolver { |
| 17 public: | 17 public: |
| 18 HostResolver(); | 18 HostResolver(); |
| 19 ~HostResolver(); | 19 ~HostResolver(); |
| 20 | 20 |
| 21 void Init(PepperInterface* ppapi); | 21 void Init(PepperInterface* ppapi); |
| 22 | 22 |
| 23 void freeaddrinfo(struct addrinfo *res); | 23 void freeaddrinfo(struct addrinfo* res); |
| 24 int getaddrinfo(const char *node, const char *service, | 24 int getaddrinfo(const char* node, |
| 25 const struct addrinfo *hints, | 25 const char* service, |
| 26 struct addrinfo **res); | 26 const struct addrinfo* hints, |
| 27 struct addrinfo** res); |
| 27 struct hostent* gethostbyname(const char* name); | 28 struct hostent* gethostbyname(const char* name); |
| 29 |
| 28 private: | 30 private: |
| 29 void hostent_initialize(); | 31 void hostent_initialize(); |
| 30 void hostent_cleanup(); | 32 void hostent_cleanup(); |
| 31 | 33 |
| 32 struct hostent hostent_; | 34 struct hostent hostent_; |
| 33 PepperInterface *ppapi_; | 35 PepperInterface* ppapi_; |
| 34 sdk_util::SimpleLock gethostbyname_lock_; | 36 sdk_util::SimpleLock gethostbyname_lock_; |
| 35 }; | 37 }; |
| 36 | 38 |
| 37 } // namespace nacl_io | 39 } // namespace nacl_io |
| 38 | 40 |
| 39 #endif // PROVIDES_SOCKET_API | 41 #endif // PROVIDES_SOCKET_API |
| 40 #endif // LIBRARIES_NACL_IO_HOST_RESOLVER_H_ | 42 #endif // LIBRARIES_NACL_IO_HOST_RESOLVER_H_ |
| OLD | NEW |