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

Side by Side Diff: ppapi/c/private/ppb_host_resolver_private.h

Issue 9455092: HostResolver is exposed to plugin. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: s/class HostPortPair/struct HostPortPair. Created 8 years, 9 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
OLDNEW
(Empty)
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
6 /* From private/ppb_host_resolver_private.idl,
7 * modified Fri Feb 17 11:20:04 2012.
8 */
9
10 #ifndef PPAPI_C_PRIVATE_PPB_HOST_RESOLVER_PRIVATE_H_
11 #define PPAPI_C_PRIVATE_PPB_HOST_RESOLVER_PRIVATE_H_
12
13 #include "ppapi/c/pp_bool.h"
14 #include "ppapi/c/pp_completion_callback.h"
15 #include "ppapi/c/pp_instance.h"
16 #include "ppapi/c/pp_macros.h"
17 #include "ppapi/c/pp_resource.h"
18 #include "ppapi/c/pp_stdint.h"
19 #include "ppapi/c/pp_var.h"
20 #include "ppapi/c/private/ppb_net_address_private.h"
21
22 #define PPB_HOSTRESOLVER_PRIVATE_INTERFACE_0_1 "PPB_HostResolver_Private;0.1"
23 #define PPB_HOSTRESOLVER_PRIVATE_INTERFACE \
24 PPB_HOSTRESOLVER_PRIVATE_INTERFACE_0_1
25
26 /**
27 * @file
28 * This file defines the <code>PPB_HostResolver_Private</code> interface.
29 */
30
31
32 /**
33 * @addtogroup Enums
34 * @{
35 */
36 /**
37 * The <code>PP_HostResolver_Flags</code> is an enumeration of the
38 * different types of flags, that can be OR-ed and passed to host
39 * resolver.
40 */
41 typedef enum {
42 /**
43 * AI_CANONNAME
44 */
45 PP_HOST_RESOLVER_FLAGS_CANONNAME = 1 << 0,
46 /**
47 * Hint to the resolver that only loopback addresses are configured.
48 */
49 PP_HOST_RESOLVER_FLAGS_LOOPBACK_ONLY = 1 << 1
50 } PP_HostResolver_Private_Flags;
51 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_HostResolver_Private_Flags, 4);
52 /**
53 * @}
54 */
55
56 /**
57 * @addtogroup Structs
58 * @{
59 */
60 struct PP_HostResolver_Private_Hint {
61 PP_NetAddressFamily_Private family;
62 PP_HostResolver_Private_Flags flags;
63 };
64 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_HostResolver_Private_Hint, 8);
65 /**
66 * @}
67 */
68
69 /**
70 * @addtogroup Interfaces
71 * @{
72 */
73 struct PPB_HostResolver_Private_0_1 {
74 /**
75 * Allocates a Host Resolver resource.
76 */
77 PP_Resource (*Create)(PP_Instance instance);
78 /**
79 * Determines if a given resource is a Host Resolver.
80 */
81 PP_Bool (*IsHostResolver)(PP_Resource resource);
82 /**
83 * Creates a new request to Host Resolver. |callback| is invoked
84 * when request is processed and a list of network addresses is
85 * obtained. These addresses can be be used in Connect, Bind or
86 * Listen calls to connect to a given |host| and |port|.
87 */
88 int32_t (*Resolve)(PP_Resource host_resolver,
89 const char* host,
90 uint16_t port,
91 const struct PP_HostResolver_Private_Hint* hint,
92 struct PP_CompletionCallback callback);
93 /**
94 * Returns number of network addresses obtained after Resolve call.
95 */
96 uint32_t (*GetSize)(PP_Resource host_resolver);
97 /**
98 * Stores in the |canonname| and |addr| |index|-th canonical name of
99 * host and network address. |canonname| or |addr| can be NULL and
100 * in this case corresponding value not stored. Returns PP_TRUE if
101 * success or PP_FALSE if given resource is not a Host Resolver or
102 * |index| exceeds number of available addresses.
103 */
104 PP_Bool (*GetItem)(PP_Resource host_resolver,
105 uint32_t index,
106 struct PP_Var* canonname,
107 struct PP_NetAddress_Private* addr);
108 };
109
110 typedef struct PPB_HostResolver_Private_0_1 PPB_HostResolver_Private;
111 /**
112 * @}
113 */
114
115 #endif /* PPAPI_C_PRIVATE_PPB_HOST_RESOLVER_PRIVATE_H_ */
116
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698