Pepper_42_C++_interfaces
host_resolver_private.h
Go to the documentation of this file.
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.
4 
5 #ifndef PPAPI_CPP_PRIVATE_HOST_RESOLVER_PRIVATE_H_
6 #define PPAPI_CPP_PRIVATE_HOST_RESOLVER_PRIVATE_H_
7 
8 #include <string>
9 
10 #include "ppapi/c/pp_stdint.h"
11 #include "ppapi/c/private/ppb_host_resolver_private.h"
12 #include "ppapi/cpp/resource.h"
13 #include "ppapi/cpp/var.h"
14 
15 struct PP_NetAddress_Private;
16 
17 namespace pp {
18 
19 class CompletionCallback;
20 class InstanceHandle;
21 
22 class HostResolverPrivate : public Resource {
23  public:
24  explicit HostResolverPrivate(const InstanceHandle& instance);
25 
26  // Returns true if the required interface is available.
27  static bool IsAvailable();
28 
29  int32_t Resolve(const std::string& host,
30  uint16_t port,
31  const PP_HostResolver_Private_Hint& hint,
32  const CompletionCallback& callback);
34  uint32_t GetSize();
35  bool GetNetAddress(uint32_t index, PP_NetAddress_Private* address);
36 };
37 
38 } // namespace pp
39 
40 #endif // PPAPI_CPP_PRIVATE_HOST_RESOLVER_PRIVATE_H_
HostResolverPrivate(const InstanceHandle &instance)
static bool IsAvailable()
bool GetNetAddress(uint32_t index, PP_NetAddress_Private *address)
int32_t Resolve(const std::string &host, uint16_t port, const PP_HostResolver_Private_Hint &hint, const CompletionCallback &callback)
A generic type used for passing data types between the module and the page.
Definition: var.h:21
A reference counted module resource.
Definition: resource.h:20