From b1784f4dc9fbf104e4454796edf26d2f76e16a94 Mon Sep 17 00:00:00 2001 From: "yzshen@chromium.org" <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> Date: Thu, 13 Jun 2013 06:48:36 +0000 Subject: Introduce PPB_TCPSocket_Dev. This change exposes the PPB_TCPSocket_Dev interface and makes it to share the same backend as PPB_TCPSocket_Private. It doesn't include: - apps permission check; - TCP socket options that PPB_TCPSocket_Private doesn't support. These will be implemented in separate CLs. BUG=247225 TEST=newly added test_tcp_socket.{h,cc}. Review URL: https://chromiumcodereview.appspot.com/16667002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206014 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/thunk/ppb_tcp_socket_api.h | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 ppapi/thunk/ppb_tcp_socket_api.h (limited to 'ppapi/thunk/ppb_tcp_socket_api.h') diff --git a/ppapi/thunk/ppb_tcp_socket_api.h b/ppapi/thunk/ppb_tcp_socket_api.h new file mode 100644 index 0000000..1b94a83 --- /dev/null +++ b/ppapi/thunk/ppb_tcp_socket_api.h @@ -0,0 +1,41 @@ +// Copyright 2013 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. + +#ifndef PPAPI_THUNK_PPB_TCP_SOCKET_API_H_ +#define PPAPI_THUNK_PPB_TCP_SOCKET_API_H_ + +#include "base/memory/ref_counted.h" +#include "ppapi/c/dev/ppb_tcp_socket_dev.h" +#include "ppapi/thunk/ppapi_thunk_export.h" + +namespace ppapi { + +class TrackedCallback; + +namespace thunk { + +class PPAPI_THUNK_EXPORT PPB_TCPSocket_API { + public: + virtual ~PPB_TCPSocket_API() {} + + virtual int32_t Connect(PP_Resource addr, + scoped_refptr<TrackedCallback> callback) = 0; + virtual PP_Resource GetLocalAddress() = 0; + virtual PP_Resource GetRemoteAddress() = 0; + virtual int32_t Read(char* buffer, + int32_t bytes_to_read, + scoped_refptr<TrackedCallback> callback) = 0; + virtual int32_t Write(const char* buffer, + int32_t bytes_to_write, + scoped_refptr<TrackedCallback> callback) = 0; + virtual void Close() = 0; + virtual int32_t SetOption(PP_TCPSocket_Option_Dev name, + const PP_Var& value, + scoped_refptr<TrackedCallback> callback) = 0; +}; + +} // namespace thunk +} // namespace ppapi + +#endif // PPAPI_THUNK_PPB_TCP_SOCKET_API_H_ -- cgit v1.1