OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include <vector> | 5 #include <vector> |
6 | 6 |
7 #include "ppapi/c/extensions/dev/ppb_ext_socket_dev.h" | 7 #include "ppapi/c/extensions/dev/ppb_ext_socket_dev.h" |
8 #include "ppapi/shared_impl/tracked_callback.h" | 8 #include "ppapi/shared_impl/tracked_callback.h" |
9 #include "ppapi/thunk/enter.h" | 9 #include "ppapi/thunk/enter.h" |
10 #include "ppapi/thunk/extensions_common_api.h" | 10 #include "ppapi/thunk/extensions_common_api.h" |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 PP_CompletionCallback callback) { | 318 PP_CompletionCallback callback) { |
319 EnterInstanceAPI<ExtensionsCommon_API> enter(instance, callback); | 319 EnterInstanceAPI<ExtensionsCommon_API> enter(instance, callback); |
320 if (enter.failed()) | 320 if (enter.failed()) |
321 return enter.retval(); | 321 return enter.retval(); |
322 | 322 |
323 std::vector<PP_Var> input_args; | 323 std::vector<PP_Var> input_args; |
324 std::vector<PP_Var*> output_args; | 324 std::vector<PP_Var*> output_args; |
325 input_args.push_back(socket_id); | 325 input_args.push_back(socket_id); |
326 input_args.push_back(ttl); | 326 input_args.push_back(ttl); |
327 output_args.push_back(result); | 327 output_args.push_back(result); |
328 return enter.SetResult(enter.functions()->CallBrowser( | 328 return enter.SetResult( |
329 "socket.setMulticastTimeToLive", input_args, output_args, | 329 enter.functions()->CallBrowser("socket.setMulticastTimeToLive", |
330 enter.callback())); | 330 input_args, |
| 331 output_args, |
| 332 enter.callback())); |
331 } | 333 } |
332 | 334 |
333 int32_t SetMulticastLoopbackMode(PP_Instance instance, | 335 int32_t SetMulticastLoopbackMode(PP_Instance instance, |
334 PP_Var socket_id, | 336 PP_Var socket_id, |
335 PP_Var enabled, | 337 PP_Var enabled, |
336 PP_Var* result, | 338 PP_Var* result, |
337 PP_CompletionCallback callback) { | 339 PP_CompletionCallback callback) { |
338 EnterInstanceAPI<ExtensionsCommon_API> enter(instance, callback); | 340 EnterInstanceAPI<ExtensionsCommon_API> enter(instance, callback); |
339 if (enter.failed()) | 341 if (enter.failed()) |
340 return enter.retval(); | 342 return enter.retval(); |
341 | 343 |
342 std::vector<PP_Var> input_args; | 344 std::vector<PP_Var> input_args; |
343 std::vector<PP_Var*> output_args; | 345 std::vector<PP_Var*> output_args; |
344 input_args.push_back(socket_id); | 346 input_args.push_back(socket_id); |
345 input_args.push_back(enabled); | 347 input_args.push_back(enabled); |
346 output_args.push_back(result); | 348 output_args.push_back(result); |
347 return enter.SetResult(enter.functions()->CallBrowser( | 349 return enter.SetResult( |
348 "socket.setMulticastLoopbackMode", input_args, output_args, | 350 enter.functions()->CallBrowser("socket.setMulticastLoopbackMode", |
349 enter.callback())); | 351 input_args, |
| 352 output_args, |
| 353 enter.callback())); |
350 } | 354 } |
351 | 355 |
352 int32_t GetJoinedGroups(PP_Instance instance, | 356 int32_t GetJoinedGroups(PP_Instance instance, |
353 PP_Var socket_id, | 357 PP_Var socket_id, |
354 PP_Var* groups, | 358 PP_Var* groups, |
355 PP_CompletionCallback callback) { | 359 PP_CompletionCallback callback) { |
356 EnterInstanceAPI<ExtensionsCommon_API> enter(instance, callback); | 360 EnterInstanceAPI<ExtensionsCommon_API> enter(instance, callback); |
357 if (enter.failed()) | 361 if (enter.failed()) |
358 return enter.retval(); | 362 return enter.retval(); |
359 | 363 |
360 std::vector<PP_Var> input_args; | 364 std::vector<PP_Var> input_args; |
361 std::vector<PP_Var*> output_args; | 365 std::vector<PP_Var*> output_args; |
362 input_args.push_back(socket_id); | 366 input_args.push_back(socket_id); |
363 output_args.push_back(groups); | 367 output_args.push_back(groups); |
364 return enter.SetResult(enter.functions()->CallBrowser( | 368 return enter.SetResult(enter.functions()->CallBrowser( |
365 "socket.getJoinedGroups", input_args, output_args, enter.callback())); | 369 "socket.getJoinedGroups", input_args, output_args, enter.callback())); |
366 } | 370 } |
367 | 371 |
368 const PPB_Ext_Socket_Dev_0_1 g_ppb_ext_socket_dev_0_1_thunk = { | 372 const PPB_Ext_Socket_Dev_0_1 g_ppb_ext_socket_dev_0_1_thunk = { |
369 &Create, | 373 &Create, &Destroy, &Connect, &Bind, &Disconnect, |
370 &Destroy, | 374 &Read, &Write, &RecvFrom, &SendTo, &Listen, |
371 &Connect, | 375 &Accept, &SetKeepAlive, &SetNoDelay, &GetInfo, &GetNetworkList}; |
372 &Bind, | |
373 &Disconnect, | |
374 &Read, | |
375 &Write, | |
376 &RecvFrom, | |
377 &SendTo, | |
378 &Listen, | |
379 &Accept, | |
380 &SetKeepAlive, | |
381 &SetNoDelay, | |
382 &GetInfo, | |
383 &GetNetworkList | |
384 }; | |
385 | 376 |
386 const PPB_Ext_Socket_Dev_0_2 g_ppb_ext_socket_dev_0_2_thunk = { | 377 const PPB_Ext_Socket_Dev_0_2 g_ppb_ext_socket_dev_0_2_thunk = { |
387 &Create, | 378 &Create, &Destroy, &Connect, |
388 &Destroy, | 379 &Bind, &Disconnect, &Read, |
389 &Connect, | 380 &Write, &RecvFrom, &SendTo, |
390 &Bind, | 381 &Listen, &Accept, &SetKeepAlive, |
391 &Disconnect, | 382 &SetNoDelay, &GetInfo, &GetNetworkList, |
392 &Read, | 383 &JoinGroup, &LeaveGroup, &SetMulticastTimeToLive, |
393 &Write, | 384 &SetMulticastLoopbackMode, &GetJoinedGroups}; |
394 &RecvFrom, | |
395 &SendTo, | |
396 &Listen, | |
397 &Accept, | |
398 &SetKeepAlive, | |
399 &SetNoDelay, | |
400 &GetInfo, | |
401 &GetNetworkList, | |
402 &JoinGroup, | |
403 &LeaveGroup, | |
404 &SetMulticastTimeToLive, | |
405 &SetMulticastLoopbackMode, | |
406 &GetJoinedGroups | |
407 }; | |
408 } // namespace | 385 } // namespace |
409 | 386 |
410 const PPB_Ext_Socket_Dev_0_1* GetPPB_Ext_Socket_Dev_0_1_Thunk() { | 387 const PPB_Ext_Socket_Dev_0_1* GetPPB_Ext_Socket_Dev_0_1_Thunk() { |
411 return &g_ppb_ext_socket_dev_0_1_thunk; | 388 return &g_ppb_ext_socket_dev_0_1_thunk; |
412 } | 389 } |
413 | 390 |
414 const PPB_Ext_Socket_Dev_0_2* GetPPB_Ext_Socket_Dev_0_2_Thunk() { | 391 const PPB_Ext_Socket_Dev_0_2* GetPPB_Ext_Socket_Dev_0_2_Thunk() { |
415 return &g_ppb_ext_socket_dev_0_2_thunk; | 392 return &g_ppb_ext_socket_dev_0_2_thunk; |
416 } | 393 } |
417 | 394 |
418 } // namespace thunk | 395 } // namespace thunk |
419 } // namespace ppapi | 396 } // namespace ppapi |
OLD | NEW |