diff options
author | yzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-13 06:48:36 +0000 |
---|---|---|
committer | yzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-13 06:48:36 +0000 |
commit | b1784f4dc9fbf104e4454796edf26d2f76e16a94 (patch) | |
tree | 476affcb92e4fa1e2f0772a935bc3f63f8164630 /ppapi/thunk/ppb_tcp_socket_api.h | |
parent | b1c988bcd7869765e1bd56e592787af123340516 (diff) | |
download | chromium_src-b1784f4dc9fbf104e4454796edf26d2f76e16a94.zip chromium_src-b1784f4dc9fbf104e4454796edf26d2f76e16a94.tar.gz chromium_src-b1784f4dc9fbf104e4454796edf26d2f76e16a94.tar.bz2 |
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
Diffstat (limited to 'ppapi/thunk/ppb_tcp_socket_api.h')
-rw-r--r-- | ppapi/thunk/ppb_tcp_socket_api.h | 41 |
1 files changed, 41 insertions, 0 deletions
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_ |