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

Side by Side Diff: ppapi/c/dev/ppb_transport_dev.h

Issue 7888022: Add DISABLE_TCP_TRANSPORT flag in the Transport API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 3 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 (c) 2011 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2011 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 PPAPI_C_PPB_TRANSPORT_DEV_H_ 5 #ifndef PPAPI_C_PPB_TRANSPORT_DEV_H_
6 #define PPAPI_C_PPB_TRANSPORT_DEV_H_ 6 #define PPAPI_C_PPB_TRANSPORT_DEV_H_
7 7
8 #include "ppapi/c/pp_bool.h" 8 #include "ppapi/c/pp_bool.h"
9 #include "ppapi/c/pp_completion_callback.h" 9 #include "ppapi/c/pp_completion_callback.h"
10 #include "ppapi/c/pp_module.h" 10 #include "ppapi/c/pp_module.h"
(...skipping 30 matching lines...) Expand all
41 // connections. 41 // connections.
42 PP_TRANSPORTPROPERTY_TCP_SEND_WINDOW = 6, 42 PP_TRANSPORTPROPERTY_TCP_SEND_WINDOW = 6,
43 43
44 // Boolean value that disables Neagle's algorithm when set to 44 // Boolean value that disables Neagle's algorithm when set to
45 // true. When Neagle's algorithm is disabled, all outgoing packets 45 // true. When Neagle's algorithm is disabled, all outgoing packets
46 // are sent as soon as possible. When set to false (by default) data 46 // are sent as soon as possible. When set to false (by default) data
47 // may be buffered until there is a sufficient amount to send. 47 // may be buffered until there is a sufficient amount to send.
48 PP_TRANSPORTPROPERTY_TCP_NO_DELAY = 7, 48 PP_TRANSPORTPROPERTY_TCP_NO_DELAY = 7,
49 49
50 // Delay for ACK packets in milliseconds. By default set to 100ms. 50 // Delay for ACK packets in milliseconds. By default set to 100ms.
51 PP_TRANSPORTPROPERTY_TCP_ACK_DELAY = 8 51 PP_TRANSPORTPROPERTY_TCP_ACK_DELAY = 8,
52
53 // Types of ports to use. An integer that is a bit-mast of
54 // PP_TransportPorts values. By default all ports are disabled.
Wez 2011/09/13 19:57:19 It might be better to use the term "protocols" rat
Sergey Ulanov 2011/09/13 20:31:38 Ok, I'll change it to protocol.
55 PP_TRANSPORTPROPERTY_PORT_TYPES = 9
52 } PP_TransportProperty; 56 } PP_TransportProperty;
53 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TransportProperty, 4); 57 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TransportProperty, 4);
54 58
55 typedef enum { 59 typedef enum {
56 // RFC5766 compliant relay server. 60 // RFC5766 compliant relay server.
57 PP_TRANSPORTRELAYMODE_TURN = 0, 61 PP_TRANSPORTRELAYMODE_TURN = 0,
58 62
59 // Legacy Google relay server. 63 // Legacy Google relay server.
60 PP_TRANSPORTRELAYMODE_GOOGLE = 1 64 PP_TRANSPORTRELAYMODE_GOOGLE = 1
61 } PP_TransportRelayMode; 65 } PP_TransportRelayMode;
62 66
67 typedef enum {
68 PP_TRANSPORTPORTS_UDP = 1 << 0,
69 PP_TRANSPORTPORTS_TCP = 1 << 1,
70 PP_TRANSPORTPORTS_STUN = 1 << 2,
71 PP_TRANSPORTPORTS_RELAY_UDP = 1 << 3,
72 PP_TRANSPORTPORTS_RELAY_TCP = 1 << 4,
73 PP_TRANSPORTPORTS_RELAY_SSLTCP = 1 << 5,
Wez 2011/09/13 19:57:19 Are we ever likely to want to add more of these, e
Sergey Ulanov 2011/09/13 20:31:38 It's probable that we may want to add more protoco
74
75 PP_TRANSPORTPORTS_ALL = 0xFFFFFFFF
76 } PP_TransportPorts;
77
63 struct PPB_Transport_Dev { 78 struct PPB_Transport_Dev {
64 // Creates a new transport object with the specified name using the 79 // Creates a new transport object with the specified name using the
65 // specified protocol. 80 // specified protocol.
66 PP_Resource (*CreateTransport)(PP_Instance instance, 81 PP_Resource (*CreateTransport)(PP_Instance instance,
67 const char* name, 82 const char* name,
68 const char* proto); 83 const char* proto);
69 84
70 // Returns PP_TRUE if resource is a Transport, PP_FALSE otherwise. 85 // Returns PP_TRUE if resource is a Transport, PP_FALSE otherwise.
71 PP_Bool (*IsTransport)(PP_Resource resource); 86 PP_Bool (*IsTransport)(PP_Resource resource);
72 87
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 int32_t (*Send)(PP_Resource transport, 129 int32_t (*Send)(PP_Resource transport,
115 const void* data, 130 const void* data,
116 uint32_t len, 131 uint32_t len,
117 struct PP_CompletionCallback cb); 132 struct PP_CompletionCallback cb);
118 133
119 // Disconnects from the remote peer. 134 // Disconnects from the remote peer.
120 int32_t (*Close)(PP_Resource transport); 135 int32_t (*Close)(PP_Resource transport);
121 }; 136 };
122 137
123 #endif /* PPAPI_C_PPB_TRANSPORT_DEV_H_ */ 138 #endif /* PPAPI_C_PPB_TRANSPORT_DEV_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698