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

Side by Side Diff: ppapi/cpp/extensions/dev/socket_dev.cc

Issue 13985026: Add a default constructor for VarArrayBuffer, so that it can be used by ext::DictField. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« no previous file with comments | « ppapi/cpp/extensions/dev/socket_dev.h ('k') | ppapi/cpp/extensions/from_var_converter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ppapi/cpp/extensions/dev/socket_dev.h" 5 #include "ppapi/cpp/extensions/dev/socket_dev.h"
6 6
7 #include "ppapi/cpp/completion_callback.h" 7 #include "ppapi/cpp/completion_callback.h"
8 #include "ppapi/cpp/extensions/optional.h" 8 #include "ppapi/cpp/extensions/optional.h"
9 #include "ppapi/cpp/extensions/to_var_converter.h" 9 #include "ppapi/cpp/extensions/to_var_converter.h"
10 #include "ppapi/cpp/logging.h" 10 #include "ppapi/cpp/logging.h"
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 return get_interface<PPB_Ext_Socket_Dev_0_1>()->Read( 367 return get_interface<PPB_Ext_Socket_Dev_0_1>()->Read(
368 instance_.pp_instance(), 368 instance_.pp_instance(),
369 socket_id_var.pp_var(), 369 socket_id_var.pp_var(),
370 buffer_size_var.pp_var(), 370 buffer_size_var.pp_var(),
371 callback.output(), 371 callback.output(),
372 callback.pp_completion_callback()); 372 callback.pp_completion_callback());
373 } 373 }
374 374
375 int32_t Socket_Dev::Write( 375 int32_t Socket_Dev::Write(
376 int32_t socket_id, 376 int32_t socket_id,
377 const Var& data, 377 const VarArrayBuffer& data,
378 const CompletionCallbackWithOutput<WriteInfo_Dev>& callback) { 378 const CompletionCallbackWithOutput<WriteInfo_Dev>& callback) {
379 if (!has_interface<PPB_Ext_Socket_Dev_0_1>()) 379 if (!has_interface<PPB_Ext_Socket_Dev_0_1>())
380 return callback.MayForce(PP_ERROR_NOINTERFACE); 380 return callback.MayForce(PP_ERROR_NOINTERFACE);
381 381
382 internal::ToVarConverter<int32_t> socket_id_var(socket_id); 382 internal::ToVarConverter<int32_t> socket_id_var(socket_id);
383 internal::ToVarConverter<Var> data_var(data); 383 internal::ToVarConverter<Var> data_var(data);
384 384
385 return get_interface<PPB_Ext_Socket_Dev_0_1>()->Write( 385 return get_interface<PPB_Ext_Socket_Dev_0_1>()->Write(
386 instance_.pp_instance(), 386 instance_.pp_instance(),
387 socket_id_var.pp_var(), 387 socket_id_var.pp_var(),
(...skipping 15 matching lines...) Expand all
403 return get_interface<PPB_Ext_Socket_Dev_0_1>()->RecvFrom( 403 return get_interface<PPB_Ext_Socket_Dev_0_1>()->RecvFrom(
404 instance_.pp_instance(), 404 instance_.pp_instance(),
405 socket_id_var.pp_var(), 405 socket_id_var.pp_var(),
406 buffer_size_var.pp_var(), 406 buffer_size_var.pp_var(),
407 callback.output(), 407 callback.output(),
408 callback.pp_completion_callback()); 408 callback.pp_completion_callback());
409 } 409 }
410 410
411 int32_t Socket_Dev::SendTo( 411 int32_t Socket_Dev::SendTo(
412 int32_t socket_id, 412 int32_t socket_id,
413 const Var& data, 413 const VarArrayBuffer& data,
414 const std::string& address, 414 const std::string& address,
415 int32_t port, 415 int32_t port,
416 const CompletionCallbackWithOutput<WriteInfo_Dev>& callback) { 416 const CompletionCallbackWithOutput<WriteInfo_Dev>& callback) {
417 if (!has_interface<PPB_Ext_Socket_Dev_0_1>()) 417 if (!has_interface<PPB_Ext_Socket_Dev_0_1>())
418 return callback.MayForce(PP_ERROR_NOINTERFACE); 418 return callback.MayForce(PP_ERROR_NOINTERFACE);
419 419
420 internal::ToVarConverter<int32_t> socket_id_var(socket_id); 420 internal::ToVarConverter<int32_t> socket_id_var(socket_id);
421 internal::ToVarConverter<Var> data_var(data); 421 internal::ToVarConverter<Var> data_var(data);
422 internal::ToVarConverter<std::string> address_var(address); 422 internal::ToVarConverter<std::string> address_var(address);
423 internal::ToVarConverter<int32_t> port_var(port); 423 internal::ToVarConverter<int32_t> port_var(port);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 470
471 return get_interface<PPB_Ext_Socket_Dev_0_1>()->GetNetworkList( 471 return get_interface<PPB_Ext_Socket_Dev_0_1>()->GetNetworkList(
472 instance_.pp_instance(), 472 instance_.pp_instance(),
473 callback.output(), 473 callback.output(),
474 callback.pp_completion_callback()); 474 callback.pp_completion_callback());
475 } 475 }
476 476
477 } // namespace socket 477 } // namespace socket
478 } // namespace ext 478 } // namespace ext
479 } // namespace pp 479 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/extensions/dev/socket_dev.h ('k') | ppapi/cpp/extensions/from_var_converter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698