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

Side by Side Diff: ppapi/thunk/ppb_udp_socket_thunk.cc

Issue 690903002: Remove timing limitation of SetOption invocation for PPAPI sockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // From ppb_udp_socket.idl modified Tue Aug 20 08:13:36 2013. 5 // From ppb_udp_socket.idl modified Fri Nov 7 15:04:15 2014.
6 6
7 #include "ppapi/c/pp_completion_callback.h" 7 #include "ppapi/c/pp_completion_callback.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/ppb_udp_socket.h" 9 #include "ppapi/c/ppb_udp_socket.h"
10 #include "ppapi/shared_impl/tracked_callback.h" 10 #include "ppapi/shared_impl/tracked_callback.h"
11 #include "ppapi/thunk/enter.h" 11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppapi_thunk_export.h" 12 #include "ppapi/thunk/ppapi_thunk_export.h"
13 #include "ppapi/thunk/ppb_udp_socket_api.h" 13 #include "ppapi/thunk/ppb_udp_socket_api.h"
14 14
15 namespace ppapi { 15 namespace ppapi {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 void Close(PP_Resource udp_socket) { 82 void Close(PP_Resource udp_socket) {
83 VLOG(4) << "PPB_UDPSocket::Close()"; 83 VLOG(4) << "PPB_UDPSocket::Close()";
84 EnterResource<PPB_UDPSocket_API> enter(udp_socket, true); 84 EnterResource<PPB_UDPSocket_API> enter(udp_socket, true);
85 if (enter.failed()) 85 if (enter.failed())
86 return; 86 return;
87 enter.object()->Close(); 87 enter.object()->Close();
88 } 88 }
89 89
90 int32_t SetOption1_0(PP_Resource udp_socket,
91 PP_UDPSocket_Option name,
92 struct PP_Var value,
93 struct PP_CompletionCallback callback) {
94 VLOG(4) << "PPB_UDPSocket::SetOption1_0()";
95 EnterResource<PPB_UDPSocket_API> enter(udp_socket, callback, true);
96 if (enter.failed())
97 return enter.retval();
98 return enter.SetResult(enter.object()->SetOption1_0(name,
99 value,
100 enter.callback()));
101 }
102
90 int32_t SetOption(PP_Resource udp_socket, 103 int32_t SetOption(PP_Resource udp_socket,
91 PP_UDPSocket_Option name, 104 PP_UDPSocket_Option name,
92 struct PP_Var value, 105 struct PP_Var value,
93 struct PP_CompletionCallback callback) { 106 struct PP_CompletionCallback callback) {
94 VLOG(4) << "PPB_UDPSocket::SetOption()"; 107 VLOG(4) << "PPB_UDPSocket::SetOption()";
95 EnterResource<PPB_UDPSocket_API> enter(udp_socket, callback, true); 108 EnterResource<PPB_UDPSocket_API> enter(udp_socket, callback, true);
96 if (enter.failed()) 109 if (enter.failed())
97 return enter.retval(); 110 return enter.retval();
98 return enter.SetResult(enter.object()->SetOption(name, 111 return enter.SetResult(enter.object()->SetOption(name,
99 value, 112 value,
100 enter.callback())); 113 enter.callback()));
101 } 114 }
102 115
103 const PPB_UDPSocket_1_0 g_ppb_udpsocket_thunk_1_0 = { 116 const PPB_UDPSocket_1_0 g_ppb_udpsocket_thunk_1_0 = {
104 &Create, 117 &Create,
105 &IsUDPSocket, 118 &IsUDPSocket,
106 &Bind, 119 &Bind,
107 &GetBoundAddress, 120 &GetBoundAddress,
108 &RecvFrom, 121 &RecvFrom,
109 &SendTo, 122 &SendTo,
110 &Close, 123 &Close,
124 &SetOption1_0
125 };
126
127 const PPB_UDPSocket_1_1 g_ppb_udpsocket_thunk_1_1 = {
128 &Create,
129 &IsUDPSocket,
130 &Bind,
131 &GetBoundAddress,
132 &RecvFrom,
133 &SendTo,
134 &Close,
111 &SetOption 135 &SetOption
112 }; 136 };
113 137
114 } // namespace 138 } // namespace
115 139
116 PPAPI_THUNK_EXPORT const PPB_UDPSocket_1_0* GetPPB_UDPSocket_1_0_Thunk() { 140 PPAPI_THUNK_EXPORT const PPB_UDPSocket_1_0* GetPPB_UDPSocket_1_0_Thunk() {
117 return &g_ppb_udpsocket_thunk_1_0; 141 return &g_ppb_udpsocket_thunk_1_0;
118 } 142 }
119 143
144 PPAPI_THUNK_EXPORT const PPB_UDPSocket_1_1* GetPPB_UDPSocket_1_1_Thunk() {
145 return &g_ppb_udpsocket_thunk_1_1;
146 }
147
120 } // namespace thunk 148 } // namespace thunk
121 } // namespace ppapi 149 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698