Chromium Code Reviews| OLD | NEW |
|---|---|
| 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" |
| 11 #include "ppapi/c/pp_instance.h" | 11 #include "ppapi/c/pp_instance.h" |
| 12 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
| 13 #include "ppapi/c/pp_stdint.h" | 13 #include "ppapi/c/pp_stdint.h" |
| 14 #include "ppapi/c/pp_var.h" | 14 #include "ppapi/c/pp_var.h" |
| 15 | 15 |
| 16 #define PPB_TRANSPORT_DEV_INTERFACE_0_5 "PPB_Transport;0.5" | 16 #define PPB_TRANSPORT_DEV_INTERFACE_0_5 "PPB_Transport;0.5" |
|
brettw
2011/08/22 23:59:59
Be sure to rev the interface string.
Sergey Ulanov
2011/08/24 17:22:16
Done.
| |
| 17 #define PPB_TRANSPORT_DEV_INTERFACE PPB_TRANSPORT_DEV_INTERFACE_0_5 | 17 #define PPB_TRANSPORT_DEV_INTERFACE PPB_TRANSPORT_DEV_INTERFACE_0_5 |
| 18 | 18 |
| 19 struct PPB_Transport_Dev { | 19 struct PPB_Transport_Dev { |
| 20 // Creates a new transport object with the specified name using the | 20 // Creates a new transport object with the specified name using the |
| 21 // specified protocol. | 21 // specified protocol. |
| 22 PP_Resource (*CreateTransport)(PP_Instance instance, | 22 PP_Resource (*CreateTransport)(PP_Instance instance, |
| 23 const char* name, | 23 const char* name, |
| 24 const char* proto); | 24 const char* proto); |
| 25 | 25 |
| 26 // Returns PP_TRUE if resource is a Transport, PP_FALSE otherwise. | 26 // Returns PP_TRUE if resource is a Transport, PP_FALSE otherwise. |
| 27 PP_Bool (*IsTransport)(PP_Resource resource); | 27 PP_Bool (*IsTransport)(PP_Resource resource); |
| 28 | 28 |
| 29 // Returns PP_TRUE if the transport is currently writable (i.e. can | 29 // Returns PP_TRUE if the transport is currently writable (i.e. can |
| 30 // send data to the remote peer), PP_FALSE otherwise. | 30 // send data to the remote peer), PP_FALSE otherwise. |
| 31 PP_Bool (*IsWritable)(PP_Resource transport); | 31 PP_Bool (*IsWritable)(PP_Resource transport); |
| 32 // TODO(juberti): other getters/setters | 32 // TODO(juberti): other getters/setters |
| 33 // connect state | 33 // connect state |
| 34 // connect type, protocol | 34 // connect type, protocol |
| 35 // RTT | 35 // RTT |
| 36 | 36 |
| 37 // Set STUN/relay server configuration, as well as other | |
| 38 // configuration parameters. | |
|
brettw
2011/08/22 23:59:59
This documentation gives me no idea what I can pas
Sergey Ulanov
2011/08/23 19:02:04
I like the idea of SetProperty() and enum with all
| |
| 39 int32_t (*SetConfig)(PP_Resource transport, const char* config); | |
| 40 | |
| 37 // Establishes a connection to the remote peer. Returns | 41 // Establishes a connection to the remote peer. Returns |
| 38 // PP_OK_COMPLETIONPENDING and notifies on |cb| when connectivity is | 42 // PP_OK_COMPLETIONPENDING and notifies on |cb| when connectivity is |
| 39 // established (or timeout occurs). | 43 // established (or timeout occurs). |
| 40 int32_t (*Connect)(PP_Resource transport, | 44 int32_t (*Connect)(PP_Resource transport, |
| 41 struct PP_CompletionCallback cb); | 45 struct PP_CompletionCallback cb); |
| 42 | 46 |
| 43 // Obtains another ICE candidate address to be provided to the | 47 // Obtains another ICE candidate address to be provided to the |
| 44 // remote peer. Returns PP_OK_COMPLETIONPENDING if there are no more | 48 // remote peer. Returns PP_OK_COMPLETIONPENDING if there are no more |
| 45 // addresses to be sent. After the callback is called | 49 // addresses to be sent. After the callback is called |
| 46 // GetNextAddress() must be called again to get the address. | 50 // GetNextAddress() must be called again to get the address. |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 65 int32_t (*Send)(PP_Resource transport, | 69 int32_t (*Send)(PP_Resource transport, |
| 66 const void* data, | 70 const void* data, |
| 67 uint32_t len, | 71 uint32_t len, |
| 68 struct PP_CompletionCallback cb); | 72 struct PP_CompletionCallback cb); |
| 69 | 73 |
| 70 // Disconnects from the remote peer. | 74 // Disconnects from the remote peer. |
| 71 int32_t (*Close)(PP_Resource transport); | 75 int32_t (*Close)(PP_Resource transport); |
| 72 }; | 76 }; |
| 73 | 77 |
| 74 #endif /* PPAPI_C_PPB_TRANSPORT_DEV_H_ */ | 78 #endif /* PPAPI_C_PPB_TRANSPORT_DEV_H_ */ |
| OLD | NEW |