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

Unified Diff: ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c

Issue 690903002: Remove timing limitation of SetOption invocation for PPAPI sockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fixed implementation. Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
index 82e09e80370069c0114627a5c7705e2433f71aef..f2cd8ca827f702d7985134d5cdc281ce65623a24 100644
--- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
+++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
@@ -132,8 +132,10 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetworkMonitor_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetworkProxy_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TCPSocket_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TCPSocket_1_1;
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TCPSocket_1_2;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TextInputController_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UDPSocket_1_0;
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UDPSocket_1_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_URLLoader_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_URLRequestInfo_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_URLResponseInfo_1_0;
@@ -1605,6 +1607,70 @@ static int32_t Pnacl_M31_PPB_TCPSocket_SetOption(PP_Resource tcp_socket, PP_TCPS
/* End wrapper methods for PPB_TCPSocket_1_1 */
+/* Begin wrapper methods for PPB_TCPSocket_1_2 */
+
+static PP_Resource Pnacl_M41_PPB_TCPSocket_Create(PP_Instance instance) {
+ const struct PPB_TCPSocket_1_2 *iface = Pnacl_WrapperInfo_PPB_TCPSocket_1_2.real_iface;
+ return iface->Create(instance);
+}
+
+static PP_Bool Pnacl_M41_PPB_TCPSocket_IsTCPSocket(PP_Resource resource) {
+ const struct PPB_TCPSocket_1_2 *iface = Pnacl_WrapperInfo_PPB_TCPSocket_1_2.real_iface;
+ return iface->IsTCPSocket(resource);
+}
+
+static int32_t Pnacl_M41_PPB_TCPSocket_Bind(PP_Resource tcp_socket, PP_Resource addr, struct PP_CompletionCallback* callback) {
+ const struct PPB_TCPSocket_1_2 *iface = Pnacl_WrapperInfo_PPB_TCPSocket_1_2.real_iface;
+ return iface->Bind(tcp_socket, addr, *callback);
+}
+
+static int32_t Pnacl_M41_PPB_TCPSocket_Connect(PP_Resource tcp_socket, PP_Resource addr, struct PP_CompletionCallback* callback) {
+ const struct PPB_TCPSocket_1_2 *iface = Pnacl_WrapperInfo_PPB_TCPSocket_1_2.real_iface;
+ return iface->Connect(tcp_socket, addr, *callback);
+}
+
+static PP_Resource Pnacl_M41_PPB_TCPSocket_GetLocalAddress(PP_Resource tcp_socket) {
+ const struct PPB_TCPSocket_1_2 *iface = Pnacl_WrapperInfo_PPB_TCPSocket_1_2.real_iface;
+ return iface->GetLocalAddress(tcp_socket);
+}
+
+static PP_Resource Pnacl_M41_PPB_TCPSocket_GetRemoteAddress(PP_Resource tcp_socket) {
+ const struct PPB_TCPSocket_1_2 *iface = Pnacl_WrapperInfo_PPB_TCPSocket_1_2.real_iface;
+ return iface->GetRemoteAddress(tcp_socket);
+}
+
+static int32_t Pnacl_M41_PPB_TCPSocket_Read(PP_Resource tcp_socket, char* buffer, int32_t bytes_to_read, struct PP_CompletionCallback* callback) {
+ const struct PPB_TCPSocket_1_2 *iface = Pnacl_WrapperInfo_PPB_TCPSocket_1_2.real_iface;
+ return iface->Read(tcp_socket, buffer, bytes_to_read, *callback);
+}
+
+static int32_t Pnacl_M41_PPB_TCPSocket_Write(PP_Resource tcp_socket, const char* buffer, int32_t bytes_to_write, struct PP_CompletionCallback* callback) {
+ const struct PPB_TCPSocket_1_2 *iface = Pnacl_WrapperInfo_PPB_TCPSocket_1_2.real_iface;
+ return iface->Write(tcp_socket, buffer, bytes_to_write, *callback);
+}
+
+static int32_t Pnacl_M41_PPB_TCPSocket_Listen(PP_Resource tcp_socket, int32_t backlog, struct PP_CompletionCallback* callback) {
+ const struct PPB_TCPSocket_1_2 *iface = Pnacl_WrapperInfo_PPB_TCPSocket_1_2.real_iface;
+ return iface->Listen(tcp_socket, backlog, *callback);
+}
+
+static int32_t Pnacl_M41_PPB_TCPSocket_Accept(PP_Resource tcp_socket, PP_Resource* accepted_tcp_socket, struct PP_CompletionCallback* callback) {
+ const struct PPB_TCPSocket_1_2 *iface = Pnacl_WrapperInfo_PPB_TCPSocket_1_2.real_iface;
+ return iface->Accept(tcp_socket, accepted_tcp_socket, *callback);
+}
+
+static void Pnacl_M41_PPB_TCPSocket_Close(PP_Resource tcp_socket) {
+ const struct PPB_TCPSocket_1_2 *iface = Pnacl_WrapperInfo_PPB_TCPSocket_1_2.real_iface;
+ iface->Close(tcp_socket);
+}
+
+static int32_t Pnacl_M41_PPB_TCPSocket_SetOption(PP_Resource tcp_socket, PP_TCPSocket_Option name, struct PP_Var* value, struct PP_CompletionCallback* callback) {
+ const struct PPB_TCPSocket_1_2 *iface = Pnacl_WrapperInfo_PPB_TCPSocket_1_2.real_iface;
+ return iface->SetOption(tcp_socket, name, *value, *callback);
+}
+
+/* End wrapper methods for PPB_TCPSocket_1_2 */
+
/* Begin wrapper methods for PPB_TextInputController_1_0 */
static void Pnacl_M30_PPB_TextInputController_SetTextInputType(PP_Instance instance, PP_TextInput_Type type) {
@@ -1673,6 +1739,50 @@ static int32_t Pnacl_M29_PPB_UDPSocket_SetOption(PP_Resource udp_socket, PP_UDPS
/* End wrapper methods for PPB_UDPSocket_1_0 */
+/* Begin wrapper methods for PPB_UDPSocket_1_1 */
+
+static PP_Resource Pnacl_M41_PPB_UDPSocket_Create(PP_Instance instance) {
+ const struct PPB_UDPSocket_1_1 *iface = Pnacl_WrapperInfo_PPB_UDPSocket_1_1.real_iface;
+ return iface->Create(instance);
+}
+
+static PP_Bool Pnacl_M41_PPB_UDPSocket_IsUDPSocket(PP_Resource resource) {
+ const struct PPB_UDPSocket_1_1 *iface = Pnacl_WrapperInfo_PPB_UDPSocket_1_1.real_iface;
+ return iface->IsUDPSocket(resource);
+}
+
+static int32_t Pnacl_M41_PPB_UDPSocket_Bind(PP_Resource udp_socket, PP_Resource addr, struct PP_CompletionCallback* callback) {
+ const struct PPB_UDPSocket_1_1 *iface = Pnacl_WrapperInfo_PPB_UDPSocket_1_1.real_iface;
+ return iface->Bind(udp_socket, addr, *callback);
+}
+
+static PP_Resource Pnacl_M41_PPB_UDPSocket_GetBoundAddress(PP_Resource udp_socket) {
+ const struct PPB_UDPSocket_1_1 *iface = Pnacl_WrapperInfo_PPB_UDPSocket_1_1.real_iface;
+ return iface->GetBoundAddress(udp_socket);
+}
+
+static int32_t Pnacl_M41_PPB_UDPSocket_RecvFrom(PP_Resource udp_socket, char* buffer, int32_t num_bytes, PP_Resource* addr, struct PP_CompletionCallback* callback) {
+ const struct PPB_UDPSocket_1_1 *iface = Pnacl_WrapperInfo_PPB_UDPSocket_1_1.real_iface;
+ return iface->RecvFrom(udp_socket, buffer, num_bytes, addr, *callback);
+}
+
+static int32_t Pnacl_M41_PPB_UDPSocket_SendTo(PP_Resource udp_socket, const char* buffer, int32_t num_bytes, PP_Resource addr, struct PP_CompletionCallback* callback) {
+ const struct PPB_UDPSocket_1_1 *iface = Pnacl_WrapperInfo_PPB_UDPSocket_1_1.real_iface;
+ return iface->SendTo(udp_socket, buffer, num_bytes, addr, *callback);
+}
+
+static void Pnacl_M41_PPB_UDPSocket_Close(PP_Resource udp_socket) {
+ const struct PPB_UDPSocket_1_1 *iface = Pnacl_WrapperInfo_PPB_UDPSocket_1_1.real_iface;
+ iface->Close(udp_socket);
+}
+
+static int32_t Pnacl_M41_PPB_UDPSocket_SetOption(PP_Resource udp_socket, PP_UDPSocket_Option name, struct PP_Var* value, struct PP_CompletionCallback* callback) {
+ const struct PPB_UDPSocket_1_1 *iface = Pnacl_WrapperInfo_PPB_UDPSocket_1_1.real_iface;
+ return iface->SetOption(udp_socket, name, *value, *callback);
+}
+
+/* End wrapper methods for PPB_UDPSocket_1_1 */
+
/* Begin wrapper methods for PPB_URLLoader_1_0 */
static PP_Resource Pnacl_M14_PPB_URLLoader_Create(PP_Instance instance) {
@@ -4951,6 +5061,21 @@ static const struct PPB_TCPSocket_1_1 Pnacl_Wrappers_PPB_TCPSocket_1_1 = {
.SetOption = (int32_t (*)(PP_Resource tcp_socket, PP_TCPSocket_Option name, struct PP_Var value, struct PP_CompletionCallback callback))&Pnacl_M31_PPB_TCPSocket_SetOption
};
+static const struct PPB_TCPSocket_1_2 Pnacl_Wrappers_PPB_TCPSocket_1_2 = {
+ .Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M41_PPB_TCPSocket_Create,
+ .IsTCPSocket = (PP_Bool (*)(PP_Resource resource))&Pnacl_M41_PPB_TCPSocket_IsTCPSocket,
+ .Bind = (int32_t (*)(PP_Resource tcp_socket, PP_Resource addr, struct PP_CompletionCallback callback))&Pnacl_M41_PPB_TCPSocket_Bind,
+ .Connect = (int32_t (*)(PP_Resource tcp_socket, PP_Resource addr, struct PP_CompletionCallback callback))&Pnacl_M41_PPB_TCPSocket_Connect,
+ .GetLocalAddress = (PP_Resource (*)(PP_Resource tcp_socket))&Pnacl_M41_PPB_TCPSocket_GetLocalAddress,
+ .GetRemoteAddress = (PP_Resource (*)(PP_Resource tcp_socket))&Pnacl_M41_PPB_TCPSocket_GetRemoteAddress,
+ .Read = (int32_t (*)(PP_Resource tcp_socket, char* buffer, int32_t bytes_to_read, struct PP_CompletionCallback callback))&Pnacl_M41_PPB_TCPSocket_Read,
+ .Write = (int32_t (*)(PP_Resource tcp_socket, const char* buffer, int32_t bytes_to_write, struct PP_CompletionCallback callback))&Pnacl_M41_PPB_TCPSocket_Write,
+ .Listen = (int32_t (*)(PP_Resource tcp_socket, int32_t backlog, struct PP_CompletionCallback callback))&Pnacl_M41_PPB_TCPSocket_Listen,
+ .Accept = (int32_t (*)(PP_Resource tcp_socket, PP_Resource* accepted_tcp_socket, struct PP_CompletionCallback callback))&Pnacl_M41_PPB_TCPSocket_Accept,
+ .Close = (void (*)(PP_Resource tcp_socket))&Pnacl_M41_PPB_TCPSocket_Close,
+ .SetOption = (int32_t (*)(PP_Resource tcp_socket, PP_TCPSocket_Option name, struct PP_Var value, struct PP_CompletionCallback callback))&Pnacl_M41_PPB_TCPSocket_SetOption
+};
+
static const struct PPB_TextInputController_1_0 Pnacl_Wrappers_PPB_TextInputController_1_0 = {
.SetTextInputType = (void (*)(PP_Instance instance, PP_TextInput_Type type))&Pnacl_M30_PPB_TextInputController_SetTextInputType,
.UpdateCaretPosition = (void (*)(PP_Instance instance, const struct PP_Rect* caret))&Pnacl_M30_PPB_TextInputController_UpdateCaretPosition,
@@ -4969,6 +5094,17 @@ static const struct PPB_UDPSocket_1_0 Pnacl_Wrappers_PPB_UDPSocket_1_0 = {
.SetOption = (int32_t (*)(PP_Resource udp_socket, PP_UDPSocket_Option name, struct PP_Var value, struct PP_CompletionCallback callback))&Pnacl_M29_PPB_UDPSocket_SetOption
};
+static const struct PPB_UDPSocket_1_1 Pnacl_Wrappers_PPB_UDPSocket_1_1 = {
+ .Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M41_PPB_UDPSocket_Create,
+ .IsUDPSocket = (PP_Bool (*)(PP_Resource resource))&Pnacl_M41_PPB_UDPSocket_IsUDPSocket,
+ .Bind = (int32_t (*)(PP_Resource udp_socket, PP_Resource addr, struct PP_CompletionCallback callback))&Pnacl_M41_PPB_UDPSocket_Bind,
+ .GetBoundAddress = (PP_Resource (*)(PP_Resource udp_socket))&Pnacl_M41_PPB_UDPSocket_GetBoundAddress,
+ .RecvFrom = (int32_t (*)(PP_Resource udp_socket, char* buffer, int32_t num_bytes, PP_Resource* addr, struct PP_CompletionCallback callback))&Pnacl_M41_PPB_UDPSocket_RecvFrom,
+ .SendTo = (int32_t (*)(PP_Resource udp_socket, const char* buffer, int32_t num_bytes, PP_Resource addr, struct PP_CompletionCallback callback))&Pnacl_M41_PPB_UDPSocket_SendTo,
+ .Close = (void (*)(PP_Resource udp_socket))&Pnacl_M41_PPB_UDPSocket_Close,
+ .SetOption = (int32_t (*)(PP_Resource udp_socket, PP_UDPSocket_Option name, struct PP_Var value, struct PP_CompletionCallback callback))&Pnacl_M41_PPB_UDPSocket_SetOption
+};
+
static const struct PPB_URLLoader_1_0 Pnacl_Wrappers_PPB_URLLoader_1_0 = {
.Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M14_PPB_URLLoader_Create,
.IsURLLoader = (PP_Bool (*)(PP_Resource resource))&Pnacl_M14_PPB_URLLoader_IsURLLoader,
@@ -6000,6 +6136,12 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TCPSocket_1_1 = {
.real_iface = NULL
};
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TCPSocket_1_2 = {
+ .iface_macro = PPB_TCPSOCKET_INTERFACE_1_2,
+ .wrapped_iface = (const void *) &Pnacl_Wrappers_PPB_TCPSocket_1_2,
+ .real_iface = NULL
+};
+
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TextInputController_1_0 = {
.iface_macro = PPB_TEXTINPUTCONTROLLER_INTERFACE_1_0,
.wrapped_iface = (const void *) &Pnacl_Wrappers_PPB_TextInputController_1_0,
@@ -6012,6 +6154,12 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UDPSocket_1_0 = {
.real_iface = NULL
};
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UDPSocket_1_1 = {
+ .iface_macro = PPB_UDPSOCKET_INTERFACE_1_1,
+ .wrapped_iface = (const void *) &Pnacl_Wrappers_PPB_UDPSocket_1_1,
+ .real_iface = NULL
+};
+
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_URLLoader_1_0 = {
.iface_macro = PPB_URLLOADER_INTERFACE_1_0,
.wrapped_iface = (const void *) &Pnacl_Wrappers_PPB_URLLoader_1_0,
@@ -6481,8 +6629,10 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = {
&Pnacl_WrapperInfo_PPB_NetworkProxy_1_0,
&Pnacl_WrapperInfo_PPB_TCPSocket_1_0,
&Pnacl_WrapperInfo_PPB_TCPSocket_1_1,
+ &Pnacl_WrapperInfo_PPB_TCPSocket_1_2,
&Pnacl_WrapperInfo_PPB_TextInputController_1_0,
&Pnacl_WrapperInfo_PPB_UDPSocket_1_0,
+ &Pnacl_WrapperInfo_PPB_UDPSocket_1_1,
&Pnacl_WrapperInfo_PPB_URLLoader_1_0,
&Pnacl_WrapperInfo_PPB_URLRequestInfo_1_0,
&Pnacl_WrapperInfo_PPB_URLResponseInfo_1_0,

Powered by Google App Engine
This is Rietveld 408576698