summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-15 03:17:10 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-15 03:17:10 +0000
commitcfff9eb8c2dad715a8d4a7be088d82a9e0fada22 (patch)
treeb04fc0ccd37027d07cb1a9dfc38041d9526be8d3 /ppapi/cpp
parentb70a4a2b03c22f4018ee2009d4f88969617104b1 (diff)
downloadchromium_src-cfff9eb8c2dad715a8d4a7be088d82a9e0fada22.zip
chromium_src-cfff9eb8c2dad715a8d4a7be088d82a9e0fada22.tar.gz
chromium_src-cfff9eb8c2dad715a8d4a7be088d82a9e0fada22.tar.bz2
Pepper: Add a test for PPB_TCPSocket_Private.
Actually, the interface is currently known as PPB_Flash_TCPSocket. BUG=103993 TEST=ui_tests OutOfProcessPPAPITest.TCPSocketPrivate TBR=dmichael@chromium.org Review URL: http://codereview.chromium.org/8564034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110026 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp')
-rw-r--r--ppapi/cpp/private/flash_tcp_socket.cc7
-rw-r--r--ppapi/cpp/private/flash_tcp_socket.h7
2 files changed, 8 insertions, 6 deletions
diff --git a/ppapi/cpp/private/flash_tcp_socket.cc b/ppapi/cpp/private/flash_tcp_socket.cc
index 0dec218..18c865f 100644
--- a/ppapi/cpp/private/flash_tcp_socket.cc
+++ b/ppapi/cpp/private/flash_tcp_socket.cc
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// TODO(yzshen): See the comment in corresponding .h file.
-
#include "ppapi/cpp/private/flash_tcp_socket.h"
#include "ppapi/c/pp_bool.h"
@@ -32,6 +30,11 @@ TCPSocket::TCPSocket(Instance* instance) {
}
}
+// static
+bool TCPSocket::IsAvailable() {
+ return has_interface<PPB_Flash_TCPSocket>();
+}
+
int32_t TCPSocket::Connect(const char* host,
uint16_t port,
const CompletionCallback& callback) {
diff --git a/ppapi/cpp/private/flash_tcp_socket.h b/ppapi/cpp/private/flash_tcp_socket.h
index 41d21c0..7d68abb 100644
--- a/ppapi/cpp/private/flash_tcp_socket.h
+++ b/ppapi/cpp/private/flash_tcp_socket.h
@@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// TODO(yzshen): This (and the .cc file) contain C++ wrappers for things
-// in ppapi/c/private/ppb_flash_tcp_socket.h. This is currently not used in
-// (or even compiled with) Chromium.
-
#ifndef PPAPI_CPP_PRIVATE_FLASH_TCP_SOCKET_H_
#define PPAPI_CPP_PRIVATE_FLASH_TCP_SOCKET_H_
@@ -24,6 +20,9 @@ class TCPSocket : public Resource {
public:
explicit TCPSocket(Instance* instance);
+ // Returns true if the required interface is available.
+ static bool IsAvailable();
+
int32_t Connect(const char* host,
uint16_t port,
const CompletionCallback& callback);