Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/host_resolver.h

Issue 99933002: [NaCl SDK] nacl_io: implement getaddrinfo() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 11
11 #ifdef PROVIDES_SOCKET_API 12 #ifdef PROVIDES_SOCKET_API
12 13
13 namespace nacl_io { 14 namespace nacl_io {
14 15
15 class HostResolver { 16 class HostResolver {
16 public: 17 public:
17 HostResolver(); 18 HostResolver();
18 ~HostResolver(); 19 ~HostResolver();
19 20
20 void Init(PepperInterface* ppapi); 21 void Init(PepperInterface* ppapi);
21 22
23 void freeaddrinfo(struct addrinfo *res);
24 int getaddrinfo(const char *node, const char *service,
25 const struct addrinfo *hints,
26 struct addrinfo **res);
22 struct hostent* gethostbyname(const char* name); 27 struct hostent* gethostbyname(const char* name);
23
24 private: 28 private:
25 void hostent_initialize(); 29 void hostent_initialize();
26 void hostent_cleanup(); 30 void hostent_cleanup();
27 31
28 struct hostent hostent_; 32 struct hostent hostent_;
29 PepperInterface *ppapi_; 33 PepperInterface *ppapi_;
34 sdk_util::SimpleLock gethostbyname_lock_;
30 }; 35 };
31 36
32 } // namespace nacl_io 37 } // namespace nacl_io
33 38
34 #endif // PROVIDES_SOCKET_API 39 #endif // PROVIDES_SOCKET_API
35 #endif // LIBRARIES_NACL_IO_HOST_RESOLVER_H_ 40 #endif // LIBRARIES_NACL_IO_HOST_RESOLVER_H_
OLDNEW
« no previous file with comments | « native_client_sdk/src/examples/demo/nacl_io/nacl_io_demo.c ('k') | native_client_sdk/src/libraries/nacl_io/host_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698