Index: ppapi/cpp/dev/transport_dev.cc |
diff --git a/ppapi/cpp/dev/transport_dev.cc b/ppapi/cpp/dev/transport_dev.cc |
index 241c3bdddf0d54624ff229ee4ab8c5b7c445474b..4e73359abe2980dda1cdf1d2d3d70a8fc1eee350 100644 |
--- a/ppapi/cpp/dev/transport_dev.cc |
+++ b/ppapi/cpp/dev/transport_dev.cc |
@@ -1,9 +1,10 @@ |
-// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
#include "ppapi/cpp/dev/transport_dev.h" |
+#include "ppapi/c/pp_errors.h" |
#include "ppapi/cpp/instance.h" |
#include "ppapi/cpp/resource.h" |
#include "ppapi/cpp/module.h" |
@@ -27,5 +28,55 @@ Transport_Dev::Transport_Dev(Instance* instance, |
instance->pp_instance(), name, proto)); |
} |
-} // namespace pp |
+bool Transport_Dev::IsWritable() { |
+ if (!has_interface<PPB_Transport_Dev>()) |
+ return false; |
+ return PPBoolToBool( |
+ get_interface<PPB_Transport_Dev>()->IsWritable(pp_resource())); |
+} |
+ |
+int32_t Transport_Dev::Connect(const CompletionCallback& cc) { |
+ if (!has_interface<PPB_Transport_Dev>()) |
+ return PP_ERROR_NOINTERFACE; |
+ return get_interface<PPB_Transport_Dev>()->Connect( |
+ pp_resource(), cc.pp_completion_callback()); |
+} |
+ |
+int32_t Transport_Dev::GetNextAddress(PP_Var* address, |
brettw
2011/02/14 23:16:39
This should be a pp::Var*
To implement this, I'd
Sergey Ulanov
2011/02/15 00:26:25
Done.
|
+ const CompletionCallback& cc) { |
+ if (!has_interface<PPB_Transport_Dev>()) |
+ return PP_ERROR_NOINTERFACE; |
+ return get_interface<PPB_Transport_Dev>()->GetNextAddress( |
+ pp_resource(), address, cc.pp_completion_callback()); |
+} |
+ |
+int32_t Transport_Dev::ReceiveRemoteAddress(const PP_Var& address) { |
+ if (!has_interface<PPB_Transport_Dev>()) |
+ return PP_ERROR_NOINTERFACE; |
+ return get_interface<PPB_Transport_Dev>()->ReceiveRemoteAddress( |
+ pp_resource(), address); |
+} |
+int32_t Transport_Dev::Recv(void* data, uint32_t len, |
+ const CompletionCallback& cc) { |
+ if (!has_interface<PPB_Transport_Dev>()) |
+ return PP_ERROR_NOINTERFACE; |
+ return get_interface<PPB_Transport_Dev>()->Recv( |
+ pp_resource(), data, len, cc.pp_completion_callback()); |
+} |
+ |
+int32_t Transport_Dev::Send(const void* data, uint32_t len, |
+ const CompletionCallback& cc) { |
+ if (!has_interface<PPB_Transport_Dev>()) |
+ return PP_ERROR_NOINTERFACE; |
+ return get_interface<PPB_Transport_Dev>()->Send( |
+ pp_resource(), data, len, cc.pp_completion_callback()); |
+} |
+ |
+int32_t Transport_Dev::Close() { |
+ if (!has_interface<PPB_Transport_Dev>()) |
+ return PP_ERROR_NOINTERFACE; |
+ return get_interface<PPB_Transport_Dev>()->Close(pp_resource()); |
+} |
+ |
+} // namespace pp |